1
\$\begingroup\$

enter image description here

I'm an artist. I have several pixel art fonts prepared like so. My platform, Godot, accepts only TrueType and FNT file formats. My images are of raster pixels so obviously a conversion needs to take place. Vector graphics are fine, but I'd like to keep the pixel squares in my design and have them remain aligned with the pixels on screen.

Is anyone aware of a method to build a font from a PNG without too many headaches? I could always make my own text writer using sprites, but that sounds like meaningless reduplication of effort when I Godot provides such useful Label nodes.

\$\endgroup\$
5
  • \$\begingroup\$ superuser.com/questions/48879/… \$\endgroup\$
    – dot_Sp0T
    Commented Nov 4, 2020 at 20:54
  • 1
    \$\begingroup\$ It wouldn't be too hard with the libpng and several lines of C or C++, but I understand you're not that much into prograaming (="headache" :-)). Seems like the problem has been addressed before: gamedev.stackexchange.com/questions/154097/…. Once you have a true type font you can do anything. \$\endgroup\$
    – user144188
    Commented Nov 4, 2020 at 23:35
  • \$\begingroup\$ The headache isn't the coding, it's the integration into the existing API. I want to use a font, not reprogram a GUI from scratch just because I can. \$\endgroup\$
    – Lake
    Commented Nov 5, 2020 at 1:44
  • \$\begingroup\$ If coding's not a problem: usually one loads a font a creates a texture for rendering, here it's the other way round, there's texture and we must create a font. To load the texture: use libpng or something ready made like stb_image, to create a font use freetype2. Can't lookup the exact calls right now because freetype documentation is unreachable for me but it shouldn't be that magical ... Or maybe there are even converters online, idk, ... \$\endgroup\$
    – user144188
    Commented Nov 5, 2020 at 8:17
  • 1
    \$\begingroup\$ I just realized there's an answer in form of a plugin for godot that creates a font from a bitmap image. godotforums.org/discussion/24499/…. Headaches averted :-) \$\endgroup\$
    – user144188
    Commented Nov 5, 2020 at 11:11

0

You must log in to answer this question.

Browse other questions tagged .