diff --git a/src/Wellspring.c b/src/Wellspring.c index 96b92d7..67e2649 100644 --- a/src/Wellspring.c +++ b/src/Wellspring.c @@ -127,7 +127,7 @@ typedef struct PackedChar { float atlasLeft, atlasTop, atlasRight, atlasBottom; float planeLeft, planeTop, planeRight, planeBottom; - int xAdvance; + float xAdvance; } PackedChar; typedef struct CharRange @@ -436,9 +436,7 @@ Wellspring_Font* Wellspring_CreateFont( font->packer.ranges[charRangeIndex].data = Wellspring_realloc(font->packer.ranges[charRangeIndex].data, sizeof(PackedChar) * font->packer.ranges[charRangeIndex].charCount); PackedChar *packedChar = &font->packer.ranges[charRangeIndex].data[font->packer.ranges[charRangeIndex].charCount - 1]; - - int bearing; - stbtt_GetCodepointHMetrics(&font->fontInfo, codepoint, &packedChar->xAdvance, &bearing); + packedChar->xAdvance = json_object_get_double(currentGlyphObject, "advance"); if (json_object_has_key(currentGlyphObject, "atlasBounds")) {