diff options
| author | Thomas Zimmermann <tzimmermann@suse.de> | 2026-03-09 15:14:54 +0100 |
|---|---|---|
| committer | Helge Deller <deller@gmx.de> | 2026-03-09 15:47:21 +0100 |
| commit | c37bd7c8d36f760c064de2639423866dc0270997 (patch) | |
| tree | e78209ee8a3712a02de6257960c9b0b296f3f33c /tools/perf/scripts/python | |
| parent | 514d0de7cf403144d3e6c5b9fabb1ce4c15974ca (diff) | |
lib/fonts: Store font data for user space with font_data_export()
Add font_data_export() and update consoles to use it.
The helper font_data_export() is based on code in fbcon_get_font().
It extends the size of a single glyph to match the requested vpitch,
which us usually 32 bytes for fonts from user space. Internal fonts
have a pitch according to the glyph's height.
The implementation of font_data_export() differs in several ways from
the original code. The original implementation distinguished between
different pitches of the font data. This is not necessary as the pitch
is a parameter in the copying.
There was also special handling for a font pitch of 3 bytes, which got
expanded to 4 bytes (with trailing bits on each scanline). The logic
originated from long before git history exists even in the historical
tree. So it is not clear why this was implemented. It is not what user
space expects. The setfont utitlity loads font with 3-bytes pitches and
expects to read such fonts with a 3-byte pitch. For any font width, the
font pitch is always the width extended to the next multiple of 8. See
[1] for the user-space font-reading code.
With the changes to handling the font pitches, font_data_export() replaces
the original code's various special cases with a single copying logic.
v3:
- fix typos (Helge)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://github.com/legionus/kbd/blob/v2.9.0/src/libkfont/kdfontop.c#L73 # [1]
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
