Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-08-16 07:13:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-08-16 07:35:38 +0300
commit4300050e20a7fa5c06a990c1f7df3792b7fed656 (patch)
tree040188ab496021e16a7de92760f53aa5950e6114 /source/blender/blenfont
parent87adcbc94fc78d2c227aff992d045b287fcf2337 (diff)
Cleanup: rename kerning table to ascii_table
It wasn't obvious this was only for ASCII characters.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_font.c2
-rw-r--r--source/blender/blenfont/intern/blf_glyph.c4
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h8
3 files changed, 8 insertions, 6 deletions
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 {