JNIEXPORT jint JNICALL Java_com_badlogic_gdx_graphics_g2d_stbtt_StbTrueType_getGlyphKernAdvance(JNIEnv* env, jclass clazz, jlong info, jint glyph1, jint glyph2) { //@line:99 return stbtt_GetGlyphKernAdvance((stbtt_fontinfo*)info, glyph1, glyph2); }
float text_show(float x, float y, char *str) { int ucs, gid; int kern; int left = 0; while (*str) { str += chartorune(&ucs, str); gid = stbtt_FindGlyphIndex(&text_font->info, ucs); kern = stbtt_GetGlyphKernAdvance(&text_font->info, left, gid); x += add_glyph(gid, x, y); x += kern * text_scale; left = gid; } return x; }
static float font_width_imp(struct font *font, float scale, char *str) { int ucs, gid; int advance, kern; float w = 0.0; int left = 0; while (*str) { str += chartorune(&ucs, str); gid = stbtt_FindGlyphIndex(&font->info, ucs); stbtt_GetGlyphHMetrics(&font->info, gid, &advance, NULL); kern = stbtt_GetGlyphKernAdvance(&font->info, left, gid); w += advance * scale; w += kern * scale; left = gid; } return w; }
float Face::advance(int first, int second, float scale) const { return stbtt_GetGlyphKernAdvance(m_info, first, second) * scale; }