Closed vaheqelyan closed 3 years ago
First of all, don't use -autoframe
. I even added a disclaimer on the front page but everyone still uses it and then wonders how to typeset with each letter scaled differently and centered (losing any sort of positioning). Then you gotta set the translation and scale that you compute with some sophisticated logic.
I don't know what exactly you're trying to do but I think you might want to take a look at https://github.com/Chlumsky/msdf-atlas-gen and see if it maybe solves the exact same problem you're working on.
thank you for your quick response
First of all, don't use -autoframe
yeah i know, i used this command earlier
./msdfgen msdf -font Lato-Regular.ttf '72' -size 96 96 -pxrange 12 -scale 2 -translate 3 20 -o ../basic-gl/H.png
but i practically had the same problem as now
I don't know what exactly you're trying to do but I think you might want to take a look at https://github.com/Chlumsky/msdf-atlas-gen and see if it maybe solves the exact same problem you're working on.
i store each image in a texture array, i don't use texture atlas. can this cause a problem ?
You can use a texture array, that's not a problem but you seem to have a hard time getting the positioning right, so I was thinking that you may want to use something that already has this solved.
ok i will try msdf-atlas-gen. I'll let you know. thank's.
i know this is not the right place to ask this question, but I need help. this was the command I ended up using.
i used FreeType 2 to provide the kerning, size, etc.
Here is my result (Lato Font, 40px)
I highlighted the characters
Can you tell me how I can scale bitmaps or get the right metrics for rendering ? I mean, the character "H" should be a little wider How can I maintain bitmap data along with generated textures
Here is a comparison of text in a web browser
Here's what my fragment shader looks like
This is the only progress I have made so far.
./msdfgen msdf -font Lato-Regular.ttf '72' -size 96 96 -pxrange 12 -autoframe -scale 5 -o ../basic-gl/H.png
btw thank you for your software !