Chlumsky / msdf-atlas-gen

MSDF font atlas generator
MIT License
783 stars 175 forks source link

where is the width and height information at? #87

Closed Intervel closed 1 year ago

Intervel commented 1 year ago

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

1

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