rougier / freetype-gl

OpenGL text using one vertex buffer, one texture and FreeType
Other
1.65k stars 267 forks source link

Multi-channel SDF #111

Open rougier opened 8 years ago

rougier commented 8 years ago

It would be nice to adapt the multichannel SDF (https://github.com/Chlumsky/msdfgen) into freetype-gl. Unfortunately, I don't have much time right now but, any volunteer ?

behdad commented 8 years ago

I think we should merge freetype-gl, GLyphy, and msdfgen into a unified library that exposes a sane API while allowing for different algorithms, as well as mix-and-matching them based on size, etc. Unfortunately, I don't have much time right now but, any volunteer ? :)

rougier commented 8 years ago

Yes, that would be awesome !

Type1J commented 8 years ago

I'd really like that integration.

behdad commented 8 years ago

One major difference in how GLyphy is implemented vs the other two, is that GLyphy does it's font processing online, on a per-glyph basis, whereas freetype-gl and msdfgen preprocess the font, as far as I understand? If we can find a good atlas implementation, we can start merging the three approaches.

rougier commented 8 years ago

Freetype-gl also processes on a per-glyph basis and on demand. For the atlas, I use the Skyline Bottom-Left algorithm (from Jylänki, J., 2010. A Thousand Ways to Pack the Bin - A Practical Approach to Two-Dimensional Rectangle Bin Packing. http://clb.demon.fi/files/ RectangleBinPack.pdf)

Type1J commented 8 years ago

msdf might confuse the atlas algorithm, I would think, but it's probably the most desired format.

behdad commented 8 years ago

msdf might confuse the atlas algorithm, I would think, but it's probably the most desired format.

Why? If anything, glyphy will confuse atlases as it's storing one-dimensional binary data, not an image whatsoever...

behdad commented 8 years ago

Freetype-gl also processes on a per-glyph basis and on demand. For the atlas, I use the Skyline Bottom-Left algorithm (from Jylänki, J., 2010. A Thousand Ways to Pack the Bin - A Practical Approach to Two-Dimensional Rectangle Bin Packing. http://clb.demon.fi/files/ RectangleBinPack.pdf)

Cool. Thanks. I looked at msdf and the core of the algorithm looks very simple and should not be a lot of work to integrate into freetype-gl.

Type1J commented 8 years ago

msdfgen is GPL

Type1J commented 8 years ago

Ok, now, it's not: https://github.com/Chlumsky/msdfgen/issues/4#issuecomment-217719668 :smile:

adrianbroher commented 8 years ago

I think we should merge freetype-gl, GLyphy, and msdfgen into a unified library that exposes a sane API while allowing for different algorithms, as well as mix-and-matching them based on size, etc. Unfortunately, I don't have much time right now but, any volunteer ? :)

For starters the projects could be moved into a common organization. Any ideas for a new project name?

behdad commented 8 years ago

For starters the projects could be moved into a common organization. Any ideas for a new project name?

That can always be done later ;)

ZeunO8 commented 1 year ago

+1