diff options
author | Michael Fox <mfoxdogg@gmail.com> | 2010-11-27 01:12:46 +0300 |
---|---|---|
committer | Michael Fox <mfoxdogg@gmail.com> | 2010-11-27 01:12:46 +0300 |
commit | d47a519cbb70fabe7a105fee31be86d181541dbb (patch) | |
tree | d42b3159e66784d1aa4dd6bf72148f923ee7dd54 /source/blender/blenfont/intern/blf_glyph.c | |
parent | 8f4d8ad5bc173ab38a18c380dc5a5161eab6aa17 (diff) |
added option to turn off Text anti-aliasing in the UI
(userpref->system), with a great help from brecht (its been way too long
for me).
However as brecht pointed out that the non-AA text is slightly lareger
then AA'ed Text :S, i did not do anything about this as this commit was
just the option not the text drawing.
this commit also makes it possible to do all kinds of UI textrender options
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 2c0b833297e..c36496fb542 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -41,6 +41,7 @@ #include "MEM_guardedalloc.h" #include "DNA_vec_types.h" +#include "DNA_userdef_types.h" #include "BLI_blenlib.h" @@ -115,6 +116,23 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font) return(gc); } +void blf_glyph_cache_clear(FontBLF *font) +{ + GlyphCacheBLF *gc; + GlyphBLF *g; + int i; + + for(gc=font->cache.first; gc; gc=gc->next) { + for (i= 0; i < 257; i++) { + while (gc->bucket[i].first) { + g= gc->bucket[i].first; + BLI_remlink(&(gc->bucket[i]), g); + blf_glyph_free(g); + } + } + } +} + void blf_glyph_cache_free(GlyphCacheBLF *gc) { GlyphBLF *g; @@ -193,12 +211,10 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c) GlyphBLF *g; FT_Error err; FT_Bitmap bitmap, tempbitmap; - int sharp; + int sharp = (U.text_render & USER_TEXT_DISABLE_AA); FT_BBox bbox; unsigned int key; - sharp = 0; /* TODO make the value be configurable somehow */ - g= blf_glyph_search(font->glyph_cache, c); if (g) return(g); |