diff --git a/src/Wellspring.c b/src/Wellspring.c index 67e2649..5e38770 100644 --- a/src/Wellspring.c +++ b/src/Wellspring.c @@ -355,7 +355,6 @@ Wellspring_Font* Wellspring_CreateFont( stbtt_InitFont(&font->fontInfo, font->fontBytes, 0); int stbAscender, stbDescender, stbLineHeight; stbtt_GetFontVMetrics(&font->fontInfo, &stbAscender, &stbDescender, &stbLineHeight); - font->scale = stbtt_ScaleForPixelHeight(&font->fontInfo, 1); json_value_t *jsonRoot = json_parse(atlasJsonBytes, atlasJsonBytesLength); json_object_t *jsonObject = jsonRoot->payload; @@ -400,6 +399,7 @@ Wellspring_Font* Wellspring_CreateFont( font->lineHeight = json_object_get_double(metricsObject, "lineHeight"); font->geometryScale = font->ascender / stbAscender; + font->scale = 1 / (font->ascender - font->descender); /* Pack unicode ranges */