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
File diff suppressed because one or more lines are too long
+4 -2
View File
@@ -225,8 +225,10 @@ RD_VocabTable:
@default(1) 'scrolling_animations': bool,
//- rjf: fonts
'main_font': string,
'code_font': string,
@display_name('UI Font') @description("The name or path to the font used when displaying non-code UI elements.")
'main_font': string,
@display_name('Code Font') @description("The name or path to the font used when displaying code.")
'code_font': string,
//- rjf: colors
@display_name('Color Preset')
+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;
}
+3 -4
View File
@@ -207,10 +207,6 @@
////////////////////////////////
//~ rjf: Hot, Medium Priority Tasks (Low-Hanging-Fruit Features, UI Jank, Cleanup)
//
// [ ] Setting the code_font/main_font values to a font name doesn't work.
// Should probably make note that you have to set it to a path to a TTF,
// since that's not normally how Windows fonts work.
//
// [ ] "root" concept in hash store, which buckets keys & allows usage code to
// jettison a collection of keys in retained mode fashion
//
@@ -422,6 +418,9 @@
// size dynamically
// [x] automatically start search query with selected text
// [x] @feature processor/data breakpoints
// [x] Setting the code_font/main_font values to a font name doesn't work.
// Should probably make note that you have to set it to a path to a TTF,
// since that's not normally how Windows fonts work.
////////////////////////////////
//~ rjf: Build Options