diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2021-08-19 06:30:58 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2021-08-19 06:31:47 +0300 |
commit | 22ab0159a9754365e2d10a1bc658d4409d084fa6 (patch) | |
tree | f253335ffe71492a7e64df605008b91bad3dccec /source/blender/blenfont/intern/blf_glyph.c | |
parent | 4734de1093a1a60621ec6b10e2e56cd09aa3fc64 (diff) |
Refactor: BLF Without Kerning Modes
Simplification of BLF code after removal of kerning modes.
See D12262 for more details.
Differential Revision: https://developer.blender.org/D12262
Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/blenfont/intern/blf_glyph.c')
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index c5abc5982e8..5fb69251466 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -57,16 +57,7 @@ KerningCacheBLF *blf_kerning_cache_find(FontBLF *font) { - KerningCacheBLF *p; - - p = (KerningCacheBLF *)font->kerning_caches.first; - while (p) { - if (p->mode == font->kerning_mode) { - return p; - } - p = p->next; - } - return NULL; + return (KerningCacheBLF *)font->kerning_caches.first; } /* Create a new glyph cache for the current kerning mode. */ @@ -75,7 +66,6 @@ KerningCacheBLF *blf_kerning_cache_new(FontBLF *font, GlyphCacheBLF *gc) KerningCacheBLF *kc = MEM_mallocN(sizeof(KerningCacheBLF), __func__); kc->next = NULL; kc->prev = NULL; - kc->mode = font->kerning_mode; GlyphBLF *g_table[KERNING_CACHE_TABLE_SIZE]; for (uint i = 0; i < KERNING_CACHE_TABLE_SIZE; i++) { @@ -99,7 +89,7 @@ KerningCacheBLF *blf_kerning_cache_new(FontBLF *font, GlyphCacheBLF *gc) continue; } FT_Vector delta; - if (FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) { + if (FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_DEFAULT, &delta) == 0) { kc->ascii_table[i][j] = (int)delta.x >> 6; } } |