diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-13 20:23:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-13 20:32:38 +0400 |
commit | b96172cb054ce22407f8cfeb16592ecc8e216d6e (patch) | |
tree | 35f498c03c0b2f1ee6f680bf2a10ffc2108a4683 /source/blender/blenfont | |
parent | 5861e528d64906325632a490b1682f696abd3ebc (diff) |
UI: Add back ability to select a custom interface font
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r-- | source/blender/blenfont/BLF_api.h | 2 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index fd80e1293ee..206345582b2 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -40,6 +40,7 @@ struct ColorManagedDisplay; int BLF_init(int points, int dpi); void BLF_exit(void); void BLF_default_dpi(int dpi); +void BLF_default_set(int fontid); void BLF_cache_clear(void); @@ -50,6 +51,7 @@ int BLF_load_unique(const char *name) ATTR_NONNULL(); int BLF_load_mem_unique(const char *name, const unsigned char *mem, int mem_size) ATTR_NONNULL(); void BLF_unload(const char *name) ATTR_NONNULL(); +void BLF_unload_id(int fontid); /* Attach a file with metrics information from memory. */ void BLF_metrics_attach(int fontid, unsigned char *mem, int mem_size); diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 235d8ecbf46..cdccbe044bb 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -152,6 +152,14 @@ static int blf_search_available(void) return -1; } +void BLF_default_set(int fontid) +{ + FontBLF *font = blf_get(fontid); + if (font || fontid == -1) { + global_font_default = fontid; + } +} + static int blf_global_font_init(void) { if (global_font_default == -1) { @@ -335,6 +343,15 @@ void BLF_unload(const char *name) } } +void BLF_unload_id(int fontid) +{ + FontBLF *font = blf_get(fontid); + if (font) { + blf_font_free(font); + global_font[fontid] = NULL; + } +} + void BLF_enable(int fontid, int option) { FontBLF *font = blf_get(fontid); |