PC Screen Font: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
m Add more information about multiple PSF versions.
Line 2:
you don't have to mess with your fonts, you can directly use the ones shipped with your Linux. The other advantage is that
PSF fonts can store the whole UNICODE character set, although consolefonts have maximum 512 glyphs usually.
 
There are two versions of PSF, PSF 1 and PSF 2. Each of these versions can be detected using their magic number.
This page assumes a PSF 2 font is being used.
 
== Structure of file ==
Line 7 ⟶ 10:
 
=== File Header ===
It's a fixed, 32 bytes long chunk at the beginning of the file. It'sYou will need to be able to detect the asversion simplebefore asyou itbegin getsparsing.
 
<source lang="c">
#define PSF1_FONT_MAGIC 0x0434
 
typedef struct {
uint16_t magic; // Magic bytes for idnetiifcation.
uint8_t fontMode; // PSF font mode
uint8_t characterSize; // PSF character size.
} PSF1_Header;
 
 
#define PSF_FONT_MAGIC 0x864ab572