fix font scale calculation
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
d22c95a493
commit
80382cc83d
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in New Issue