🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Any D3D+OpenGL formatted text libraries?

Started by
0 comments, last by SyncViews 3 years, 11 months ago

Originally I was using DirectWrite, but I want to get Linux/OpenGL up and going.

I have some basic code via FreeType, but seeing how much work getting formatted text (or kerning/gpos, other , various Unicode features, languages/scripts, etc.) to work was hoping for something existing, either as a library or at least could be used as an example.

I looked at Dear ImGui, SFML and SDL, but looks like that have about what I already have in technical capabilities, laying out a left to right sequence of glyphs with a single style and maybe inserting line breaks to fit within some width.

But maybe I missed one and shouldn't spend probably dozens/hundreds of hours on my own solution?

Some things I was looking for was:

  • Different styles within one “paragraph”, so wrapping/line-breaking might need to split them, correct character spacing between two spans, differing height metrics, etc.
    Font family, size, weight, italic, underline, foreground colour, background colour.
  • The ability to insert other symbols into the sequence (be that encoded in a font file, or like an inline <img>).
  • Support for correct character spacing, I understand on many fonts this means dealing with a "GPOS" table?
  • Support for Unicode. I can pass in a Unicode string, but I need pre-composed/composite glyphs, face fallbacks, etc. Right now this is only for English/Latin scripts (£€áéß etc. or symbols like ⟶ ), but if I adopt a new library I'd like it to be able to handle other scripts.
  • Infrastructure needed to make controls (figuring out positions for the cursor, selection, position for buttons/"hyperlinks"etc.).
  • Bonus: If it can do subpixel rendering that would be nice, I think not required though as I don't intend to render at the very small sizes found in some software/webpages right now.

This topic is closed to new replies.

Advertisement