Replies: 2 comments 2 replies
-
Try subtracting left/right and bottom/top and you will get width and height. |
Beta Was this translation helpful? Give feedback.
2 replies
-
also, the how does this advance calculated? im using bitshift >> 6 to calculate the advance.x. i got this from this tutorial https://learnopengl.com/In-Practice/Text-Rendering the result produce 0.67900000000000005 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
first of all, i want to thank you for making this great technique for free! love it so far!
thanks man!
anyway, im using json as an output :
{ "atlas": { "type": "msdf", "distanceRange": 2, "size": 48, "width": 64, "height": 64, "yOrigin": "bottom" }, "name": "raleway_regular", "metrics": { "emSize": 1, "lineHeight": 1.1739999999999999, "ascender": 0.94000000000000006, "descender": -0.23400000000000001, "underlineY": -0.10000000000000001, "underlineThickness": 0.050000000000000003 }, "glyphs": [ { "unicode": 65, "advance": 0.67900000000000005, "planeBounds": { "left": -0.013666666666666617, "bottom": -0.030416666666666609, "right": 0.69466666666666677, "top": 0.74041666666666672 }, "atlasBounds": { "left": 0.5, "bottom": 26.5, "right": 34.5, "top": 63.5 } }, { "unicode": 66, "advance": 0.66800000000000004, "planeBounds": { "left": 0.064833333333333368, "bottom": -0.030416666666666609, "right": 0.64816666666666678, "top": 0.74041666666666672 }, "atlasBounds": { "left": 35.5, "bottom": 26.5, "right": 63.5, "top": 63.5 } } ], "kerning": [ { "unicode1": 66, "unicode2": 65, "advance": -0.014 } ] }
i couldnt find the width and height information for each of Glyphs?
also i tried to parse the information using freetype in my project.
im using 48 as pixel size. i got this results
why does it produce difference results? what am i doing wrong?
im using this command line
msdf-atlas-gen.exe -font raleway_regular.ttf -fontname raleway_regular -type msdf -format png -size 48 -pxrange 2 -charset charset.txt -imageout test.png -json font.json -csv font.csv
Beta Was this translation helpful? Give feedback.
All reactions