From 4300050e20a7fa5c06a990c1f7df3792b7fed656 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Aug 2021 14:13:53 +1000 Subject: Cleanup: rename kerning table to ascii_table It wasn't obvious this was only for ASCII characters. --- source/blender/blenfont/intern/blf_font.c | 2 +- source/blender/blenfont/intern/blf_glyph.c | 4 ++-- source/blender/blenfont/intern/blf_internal_types.h | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 512e2babf74..d9396bd0f90 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -372,7 +372,7 @@ BLI_INLINE void blf_kerning_step_fast(FontBLF *font, if (g_prev != NULL) { if ((c_prev < KERNING_CACHE_TABLE_SIZE) && (c < GLYPH_ASCII_TABLE_SIZE)) { - *pen_x_p += font->kerning_cache->table[c][c_prev]; + *pen_x_p += font->kerning_cache->ascii_table[c][c_prev]; } else { FT_Vector delta; diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 35938a7d5c3..a2571860c94 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -95,10 +95,10 @@ KerningCacheBLF *blf_kerning_cache_new(FontBLF *font, GlyphCacheBLF *gc) .y = 0, }; if (g && g_prev && FT_Get_Kerning(font->face, g_prev->idx, g->idx, kc->mode, &delta) == 0) { - kc->table[i][j] = (int)delta.x >> 6; + kc->ascii_table[i][j] = (int)delta.x >> 6; } else { - kc->table[i][j] = 0; + kc->ascii_table[i][j] = 0; } } } diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 6bcacc62a30..ece9a5ffae4 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -55,9 +55,11 @@ typedef struct KerningCacheBLF { /* kerning mode. */ FT_UInt mode; - /* only cache a ascii glyph pairs. Only store the x - * offset we are interested in, instead of the full FT_Vector. */ - int table[KERNING_CACHE_TABLE_SIZE][KERNING_CACHE_TABLE_SIZE]; + /** + * Cache a ascii glyph pairs. Only store the x offset we are interested in, + * instead of the full #FT_Vector since it's not used for drawing at the moment. + */ + int ascii_table[KERNING_CACHE_TABLE_SIZE][KERNING_CACHE_TABLE_SIZE]; } KerningCacheBLF; typedef struct GlyphCacheBLF { -- cgit v1.2.3