diff options
Diffstat (limited to 'source/blender/editors/interface/interface_style.c')
-rw-r--r-- | source/blender/editors/interface/interface_style.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index ae149cad480..aaebdf5693a 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -237,9 +237,19 @@ void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, char *str) int UI_GetStringWidth(char *str) { uiStyle *style= U.uistyles.first; + uiFontStyle *fstyle= &style->widget; + int width; - uiStyleFontSet(&style->widget); - return BLF_width(str); + if (fstyle->kerning==1) /* for BLF_width */ + BLF_enable(BLF_KERNING_DEFAULT); + + uiStyleFontSet(fstyle); + width= BLF_width(str); + + if (fstyle->kerning==1) + BLF_disable(BLF_KERNING_DEFAULT); + + return width; } /* temporarily, does widget font */ |