fix font scale calculation
continuous-integration/drone/push Build is passing Details

pull/1/head
cosmonaut 2023-12-06 17:04:05 -08:00
parent d22c95a493
commit 80382cc83d
1 changed files with 1 additions and 1 deletions

View File

@ -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 */