accept font names, as well as font paths

This commit is contained in:
Ryan Fleury
2025-04-26 21:41:27 -07:00
parent 693ba7d077
commit 66187931aa
6 changed files with 78 additions and 26 deletions
+5 -6
View File
@@ -10394,7 +10394,11 @@ rd_font_from_slot(RD_FontSlot slot)
// rjf: map name -> tag
FNT_Tag result = {0};
if(font_name.size == 0)
if(font_name.size != 0)
{
result = fnt_tag_from_path(font_name);
}
if(font_name.size == 0 || fnt_tag_match(fnt_tag_zero(), result))
{
switch(slot)
{
@@ -10404,11 +10408,6 @@ rd_font_from_slot(RD_FontSlot slot)
case RD_FontSlot_Icons:{result = fnt_tag_from_static_data_string(&rd_icon_font_bytes);}break;
}
}
else
{
// TODO(rjf): need to handle "system font names" here.
result = fnt_tag_from_path(font_name);
}
return result;
}