Added "Panel Title" style to Theme settings.
Allows to make these nice larger or draw differently.

Also tried to put hinting in Style, but this needs to be a per-font
setting. uiFont data is still not being saved (also not allowing
to set own font files for UI). That's a todo for 267 then.
This commit is contained in:
Ton Roosendaal 2013-01-23 16:01:35 +00:00
parent 36641078f8
commit 17b1c19054
5 changed files with 18 additions and 14 deletions

@ -800,6 +800,13 @@ class USERPREF_PT_theme(Panel):
style = context.user_preferences.ui_styles[0] style = context.user_preferences.ui_styles[0]
ui = style.panel_title
col.label(text="Panel Title:")
ui_style_items(col, ui)
col.separator()
col.separator()
ui = style.widget ui = style.widget
col.label(text="Widget:") col.label(text="Widget:")
ui_style_items(col, ui) ui_style_items(col, ui)

@ -183,6 +183,7 @@ void BLF_dir_free(char **dirs, int count);
#define BLF_KERNING_DEFAULT (1 << 3) #define BLF_KERNING_DEFAULT (1 << 3)
#define BLF_MATRIX (1 << 4) #define BLF_MATRIX (1 << 4)
#define BLF_ASPECT (1 << 5) #define BLF_ASPECT (1 << 5)
#define BLF_HINTING (1 << 6)
#define BLF_DRAW_STR_DUMMY_MAX 1024 #define BLF_DRAW_STR_DUMMY_MAX 1024

@ -213,6 +213,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
FT_Error err; FT_Error err;
FT_Bitmap bitmap, tempbitmap; FT_Bitmap bitmap, tempbitmap;
int sharp = (U.text_render & USER_TEXT_DISABLE_AA); int sharp = (U.text_render & USER_TEXT_DISABLE_AA);
int flags = FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP;
FT_BBox bbox; FT_BBox bbox;
unsigned int key; unsigned int key;
@ -220,10 +221,13 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
if (g) if (g)
return g; return g;
if (font->flags & BLF_HINTING)
flags &= ~FT_LOAD_NO_HINTING;
if (sharp) if (sharp)
err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO); err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO);
else else
err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */ err = FT_Load_Glyph(font->face, (FT_UInt)index, flags);
if (err) if (err)
return NULL; return NULL;

@ -66,7 +66,7 @@ typedef struct uiFont {
short blf_id; /* from blfont lib */ short blf_id; /* from blfont lib */
short uifont_id; /* own id */ short uifont_id; /* own id */
short r_to_l; /* fonts that read from left to right */ short r_to_l; /* fonts that read from left to right */
short pad; short hinting;
} uiFont; } uiFont;
/* this state defines appearance of text */ /* this state defines appearance of text */

@ -608,22 +608,14 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna)
RNA_def_struct_clear_flag(srna, STRUCT_UNDO); RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets"); RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets");
/* (not used yet) */
#if 0
prop = RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE);
RNA_def_property_range(prop, 0.5, 2.0);
RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas");
#endif
/* (not used yet) */ prop = RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE);
#if 0
prop = RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "grouplabel"); RNA_def_property_pointer_sdna(prop, NULL, "paneltitle");
RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_struct_type(prop, "ThemeFontStyle");
RNA_def_property_ui_text(prop, "Group Label Font", ""); RNA_def_property_ui_text(prop, "Panel Title Font", "");
RNA_def_property_update(prop, 0, "rna_userdef_update"); RNA_def_property_update(prop, 0, "rna_userdef_update");
#endif
prop = RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE); prop = RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_flag(prop, PROP_NEVER_NULL);
RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel"); RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel");