Chlumsky / msdf-atlas-gen

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

Question: How do i make it output the atlas in a grid layout? #63

Closed GoldenAdrien closed 7 months ago

GoldenAdrien commented 1 year ago

Basically, I want each tile in the atlas to be fit into an evenly spaced grid, which would ideally look something like this image:

ShaderToyFontTexture

Is there any way to do that?

Chlumsky commented 1 year ago

No, the tool does not support this out of the box, but it would be pretty easy to implement. I might do that during this or the next weekend if you're interested.

GoldenAdrien commented 1 year ago

That would be really awesome! I really like the idea of this program as it is useful for generating SDFS that I can use for generating geometry in blender or even shaders in unity, which are things I have struggled with trying to do before.

Chlumsky commented 1 year ago

It took a bit longer because I decided to allow customizing the layout of the grid with several arguments of which any combination can be set or omitted, so that complicated things a little bit, but I have a working prototype ready in the branch grid-atlas. Please check it out and see if it meets your needs.

jabamaus commented 1 year ago

@GoldenAdrien maybe you should pick up on this since he's gone to the trouble of adding this for you?

Detector-I commented 1 year ago

Hi, I'm also interested in this. Is there any update to it? In particular I'm looking for a option like Equalize the cell heights in bmfont, sometimes we don't to just cramp everything together, it's easier to have everything in same height... And also is it possible to add an option like Force offsets to zero? As the name suggest it force offsets of every glyph to zero

Chlumsky commented 1 year ago

As I said, a working version is available in the grid-atlas branch. I don't understand what you mean by offsets to zero since that would mean you wouldn't be able to see anything below the baseline, but there is a mode where the offsets are the same for all glyphs.

Detector-I commented 1 year ago

As I said, a working version is available in the grid-atlas branch. I don't understand what you mean by offsets to zero since that would mean you wouldn't be able to see anything below the baseline, but there is a mode where the offsets are the same for all glyphs.

Thank you, I will check it out then. Force offsets to zero is useful when we don't need the baseline and we just want to simply offset all the characters to zero (so we can just render the glyph without care for offset)

Chlumsky commented 7 months ago

The feature has been merged to master.