Cleanup: rename kerning table to ascii_table

It wasn't obvious this was only for ASCII characters.
This commit is contained in:
Campbell Barton
2021-08-16 14:13:53 +10:00
parent 87adcbc94f
commit 4300050e20
3 changed files with 8 additions and 6 deletions

View File

@@ -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;

View File

@@ -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;
}
}
}

View File

@@ -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 {