read advance from JSON
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
7fa1c279ce
commit
d22c95a493
|
@ -127,7 +127,7 @@ typedef struct PackedChar
|
||||||
{
|
{
|
||||||
float atlasLeft, atlasTop, atlasRight, atlasBottom;
|
float atlasLeft, atlasTop, atlasRight, atlasBottom;
|
||||||
float planeLeft, planeTop, planeRight, planeBottom;
|
float planeLeft, planeTop, planeRight, planeBottom;
|
||||||
int xAdvance;
|
float xAdvance;
|
||||||
} PackedChar;
|
} PackedChar;
|
||||||
|
|
||||||
typedef struct CharRange
|
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);
|
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];
|
PackedChar *packedChar = &font->packer.ranges[charRangeIndex].data[font->packer.ranges[charRangeIndex].charCount - 1];
|
||||||
|
packedChar->xAdvance = json_object_get_double(currentGlyphObject, "advance");
|
||||||
int bearing;
|
|
||||||
stbtt_GetCodepointHMetrics(&font->fontInfo, codepoint, &packedChar->xAdvance, &bearing);
|
|
||||||
|
|
||||||
if (json_object_has_key(currentGlyphObject, "atlasBounds"))
|
if (json_object_has_key(currentGlyphObject, "atlasBounds"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue