DaoxGlyph* DaoxFont_LoadGlyph( DaoxFont *self, size_t codepoint ) { DaoxGlyph *glyph = DaoxGlyph_New(); stbtt_vertex *vertices = NULL; int id = stbtt_FindGlyphIndex( & self->info, codepoint ); int i, num_verts = stbtt_GetGlyphShape( & self->info, id, & vertices ); stbtt_GetGlyphHMetrics( & self->info, id, & glyph->advanceWidth, & glyph->leftSideBearing ); DMap_Insert( self->glyphs, (void*) codepoint, glyph ); DaoxPath_SetRelativeMode( glyph->shape, 0 ); for(i=0; i<num_verts; ++i){ stbtt_vertex_type x = vertices[i].x; stbtt_vertex_type y = vertices[i].y; stbtt_vertex_type cx = vertices[i].cx; stbtt_vertex_type cy = vertices[i].cy; switch( vertices[i].type ){ case STBTT_vmove : if( i ) DaoxPath_Close( glyph->shape ); DaoxPath_MoveTo( glyph->shape, x, y ); break; case STBTT_vline : DaoxPath_LineTo( glyph->shape, x, y ); break; case STBTT_vcurve : DaoxPath_QuadTo( glyph->shape, cx, cy, x, y ); break; } } if( i ) DaoxPath_Close( glyph->shape ); stbtt_FreeShape( & self->info, vertices ); return glyph; }
JNIEXPORT void JNICALL Java_com_badlogic_gdx_graphics_g2d_stbtt_StbTrueType_freeShape(JNIEnv* env, jclass clazz, jlong info, jlong vertices) { //@line:138 stbtt_FreeShape((stbtt_fontinfo*)info, (stbtt_vertex*)vertices); }