-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save previous font and Unicode map broken #94
Comments
Hm. I can't reproduce it. #!/bin/sh -e
kbd-2.16.0/src/setfont /lib/kbd/consolefonts/default8x16.psfu.gz
kbd-2.16.0/src/setfont -O /tmp/default8x16.psfu
kbd-2.16.0/src/setfont /tmp/default8x16.psfu The script runs without errors.
I don't see any difference in font dumps between old and current version. |
@Tecol87 Please provide more information. |
@legionus
Here are the two different fonts files. I gzipped them, because github does not accept .psfu files. I don't know what additional data I can provide, but I am happy to provide any data or info you request, also I am happy to try patches. |
What kernel version are you using? |
@legionus 6.3.8-arch1-1 |
@legionus |
@Tecol87 It seems to be related to tall font support. https://github.com/legionus/kbd/archive/1e15af4d8b272ca50e9ee1d0c584c5859102c848.zip |
@legionus |
@Tecol87 Interesting. Then could you please attach the output of the command: strace -o /tmp/setfont.log setfont /tmp/myfont |
Ops. Sorry. Not output, but |
@legionus |
@legionus |
Is there a reason you want the strace from loading the font? I thought the problem is saving the font (-O). |
The thing is that kernel 6.2 introduced support for tall fonts. They need to be fetched and loaded via a new operation. Then this font will be written to the file. Then you try to read this file again and load it into the kernel. You have a normal font in the linux kernel so there is no difference. The old setfont retrieves the font according to the old scheme and write it. The result is a correct .psfu. The new setfont on a new kernel should use the new mechanism (should be visible in strace). I think that at the time of writing the font to the file, the psfu header is written incorrectly and therefore an error occurs at the time of loading the font. |
Thank you very much for the detailed explanation. |
Unfortunately I have an older kernel and can't reproduce this problem. But I tried to fix the font reading/writing in for-master. Please try this version. https://github.com/legionus/kbd/archive/refs/heads/for-master.zip |
@legionus |
@Tecol87 Thank you. Now the situation has become perfectly clear. Please try the for-master version again. I believe the problem is fixed there. |
@legionus |
The new KD_FONT_OP_GET_TALL uses the height as the size for each character (the old KD_FONT_OP_GET always uses 32). This works for fonts larger than 32x32. But if we get the old 8x16 font using the KD_FONT_OP_GET_TALL for it, then vpitch becomes 16. When saving such a font to a file in psf format, the vpitch information will be lost and the font will turn into garbage. psf1 has no height information at all. psf2 preserves the height, but if it's less than 32 we can't tell the vpitch for that font from a normal font that has 32. In the future we may add a flag to psf2 to distinguish fonts with vpitch < 32, but this would require carrying this information until the font is loaded into the linux kernel. There is currently no place to store this information. For now, we will use the KD_FONT_OP_GET for fonts, and only if the font has a height greater than 32 will we use KD_FONT_OP_GET_TALL. In this case, we can understand that we need to use psf2 to save such a font and then, when reading, we can understand which interface should be used to load into the kernel. Fixes: 287a3ba ("font: Leverage KD_FONT_OP_GET/SET_TALL font operations") Link: #94 Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Fixed in master. |
Saving the previous font is broken since 2.6.0. The tty just shows garbage.
It works to save a font with 2.5.1 and load it with 2.6.0.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: