0
\$\begingroup\$

I have migrated from a 16x2 alpha-numeric display to a 128x64 graphical in existing project. With that in mind, I am planning on using a larger font instead of the "easy" 5x7. How do I integrate TTF font file in C?? How to generate hex for the same?

\$\endgroup\$
3
  • \$\begingroup\$ Have you tried using your toolchain's tool for converting binary files into object code? \$\endgroup\$ Oct 27, 2014 at 6:21
  • \$\begingroup\$ I didn't get you \$\endgroup\$
    – spp
    Oct 27, 2014 at 6:28
  • 1
    \$\begingroup\$ I have used MuGUI for this. \$\endgroup\$
    – David
    Oct 27, 2014 at 7:31

1 Answer 1

1
\$\begingroup\$

TTF is a vector font format, you first need to convert it into a bitmap with 1 bit color depth, then load it as an array in your code.

GIMP can save the bitmap as a C array.

\$\endgroup\$
2
  • \$\begingroup\$ Unless the rest of your C code includes a TTF renderer. \$\endgroup\$ Oct 27, 2014 at 7:53
  • \$\begingroup\$ Good luck doing that on a low resolution LCD, probably with a small (<256KB RAM) fixed point only MCU... \$\endgroup\$
    – Lior Bilia
    Oct 27, 2014 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.