-
Notifications
You must be signed in to change notification settings - Fork 4
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
Some fonts do not render correctly or at all #2
Comments
Looking at the automatically generated preview images you are correct the big fonts seem to have problems. However unscii seems to render correctly. I did used a quick and dirty fontx2png command line tool to render them so the problem might be in |
Hi, Maybe this will fix your issue : tuupola/fontx_tools#1 |
At least the patch fixed the automatically generated preview images. |
Also, all of ISO fonts shifted to the right one byte. hagl_put_text(u"ABCD", 0, 0, COLOR_GREEN, font5x7_ISO8859_1); ----> Show "BCDE" on display hagl_put_text(u"ABCD", 0, 0, COLOR_GREEN, font9x18B_ISO8859_1); ----> Show "BCDE" on display |
Is this a new issue or did this happen before ? |
It happened before. |
I just did a quick test with SDL2 and there is off by one error somewhere. hagl_put_text(L"abcABC", 10, 120, green, font9x18B_ISO8859_1); displays bcdBCD on screen and hagl_put_text(L"`ab@AB", 10, 120, green, font9x18B_ISO8859_1); displays abcABC on screen. Not sure yet whether the problem is how the ISO variants are generated or is it in HAGL rendering code. |
I think it is the bdf2fontx tool. The resulting fnt file seems to miss 0x00 and 0x01 characters. The first character in the fnt file is 0x02 but even that is off by one and it is actually numbered as 0x01. |
Culprit seems to be the following line which causes the off by one error. Will investigate more tomorrow. https://github.com/tuupola/fontx_tools/blob/master/src/bdf2fontx.c#L283 |
The off by one error should be fixed with ISO fonts (see #3). I did not test them all but I did test five random fonts manually and they were ok. Not to self: I really need to do a proper rewrite of the conversion tools. |
Hello, I finally took some time to work on the RPi Pico VGA board HAL, and still got no display for unscii font. So I modernized my test program to make it work with latest HAGL, see https://github.com/CHiPs44/hagl_gd/blob/0e189ddd84861a1a61db5cfa785f697e2c5d5392/example/hagl_font_test.c, and got the same issues. Mandelbroot & palette work fine on my Ubuntu 22.04 machine, so I'm rather confident with my setup. |
I saw that I couldn't render text with the unscii-8-fantasy font in my Pico VGA HAGL HAL, but it worked with X11 font8x13.
To verify it doesn't come from my HAL, I made a little example outputting text to GD HAGL HAL (by duplicating and adapting palette.c):
The result is below:
The text was updated successfully, but these errors were encountered: