Is there a user-level font table available on Linux?

So how is it: http://en.wikipedia.org/wiki/Code_page_437 On MSDOS, is there something similar for Linux systems? Can I access font data through a user program? I just need access to the actual bit patterns that define the font, and I will do the rendering myself. I’m sure something like this exists, but I couldn’t find what it was and how to access it. In the end, for example. the font in text mode should be somewhere somewhere, and I really hope that it is "roughly" available somehow for the user program.

Before forgetting, I program my program in C and only have access to the "standard" linux / posix development headers. The only thing I could think of was to use fonts in / usr / share / fonts, but the need to write custom implementations to extract data from there doesn't really seem to be an option; I would really like to achieve this with the least number of bytes, so I feel like I have to find a standard way to do this.

It is not possible to save my own 8x8 ASCII-compatible font with the program (it takes about 1024 bytes (128 characters * 8x8 bits) to save the font, which is definitely unacceptable for the strict size restrictions (some <1024 bytes for code + data) that I work with ), so the ability to use font data stored in the system itself will greatly simplify my task.

+3
source share
2 answers

I looked at consolechars sources, and it looks like there is a whole library for this. In Ubuntu, it is called libconsole, and the header files (e.g. lct / font.h) are in the console-tools-dev package. There are functions for finding and downloading fonts that appear to be exactly what you need. And the consolechars source is a good example of how to use them.

+1
source

You must use freetype , it is usually installed on all Linuxes.

0
source

Source: https://habr.com/ru/post/1782915/


All Articles