why does yoff return negative values?
f32 scale = stbtt_ScaleForMappingEmToPixels(&fontInfo, 64.0f);
i32 padding = 5;
u8 onedgeValue = 180;
f32 pixelDistScale = 180 / 5.0;
i32 glyphIndex = stbtt_FindGlyphIndex(&fontInfo, codepoint);
i32 advance{0}; i32 lsb{0};
stbtt_GetGlyphHMetrics(&fontInfo, glyphIndex, &advance, &lsb);
i32 width{0}; i32 height{0}; i32 xoff{0}; i32 yoff{0};
u8* sdf = stbtt_GetGlyphSDF(&fontInfo, scale, glyphIndex, padding, onedgeValue, pixelDistScale, &width, &height, &xoff, &yoff);
-40
-53
-40
-54
-40
-53
-52
-52
-53
-53
-40
-40
-40
-40
-40
-40
-40
this is how i store it into json.
json glyph;
glyph["width"] = width;
glyph["height"] = height;
glyph["xadvance"] = (advance * scale);
glyph["xoff"] = xoff;
glyph["yoff"] = yoff;
glyph["texcoord"] = { texTop, texRight, texBottom, texLeft };
somehow, because its negative, it place it above. is this a bug?
tried to open this json file, yoff is mostly negative. be aware im using the SDF function one. stbtt_GetGlyphSDF()
Roboto-Regular.json
this is how i put it on screen
//f32 posY = current.y - (mFont->getCharacters()[currentUnicode].size.y - mFont->getCharacters()[currentUnicode].offset.y) * text.fontSize;
f32 posY = current.y + (mFont->getCharacters()[currentUnicode].offset.y) * text.fontSize;
// yoff = mFont->getCharacters()[currentUnicode].offset.y)



why does yoff return negative values?
this is how i store it into json.
somehow, because its negative, it place it above. is this a bug?
tried to open this json file, yoff is mostly negative. be aware im using the SDF function one. stbtt_GetGlyphSDF()
Roboto-Regular.json
this is how i put it on screen