Skip to content
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

Hi-DPI versions have wrong sizes? #7

Open
rnhmjoj opened this issue Mar 2, 2019 · 5 comments
Open

Hi-DPI versions have wrong sizes? #7

rnhmjoj opened this issue Mar 2, 2019 · 5 comments

Comments

@rnhmjoj
Copy link

rnhmjoj commented Mar 2, 2019

I'm trying to convert the 2x scaled bdf fonts to psf and pcf formats, using bdf2psf and bdftopcf respectively.
The first tool fails complaining the 22px font has size 0, the second one converts the fonts successfully but both appears in xfontsel as 0px and 17px sized.
Do you have any idead what is going on?

@hchargois
Copy link
Owner

I'm not sure.

Can you try experimenting with these modifications (for the 22px size)?

--- a/hidpi/gohufont-22.bdf
+++ b/hidpi/gohufont-22.bdf
@@ -1,10 +1,11 @@
 STARTFONT 2.1
 FONT -Gohu-GohuFont-Medium-R-Normal--11-80-100-100-C-60-ISO8859-1
-SIZE 11 100 100
+SIZE 22 100 100
 FONTBOUNDINGBOX 12 22 0 -4
 STARTPROPERTIES 8
 DEFAULT_CHAR 255
 FACE_NAME "-Gohu-GohuFont-Medium-R-Normal--11-80-100-100-C-60-ISO8859-1"
+AVERAGE_WIDTH 120
 FONT_ASCENT 18
 FONT_DESCENT 4
 PIXEL_SIZE 16

I've seen from bdf2psf's code that it needs the AVERAGE_WIDTH value (which is the width, found in the first value of the FONTBOUNDINGBOX, multiplied by 10).

And the SIZE 22 makes more sense even though I'm not sure if it's important.

@rnhmjoj
Copy link
Author

rnhmjoj commented Mar 6, 2019

I tried the patch and now bdf2pfs fails with

BDF Error on line 14: missing 'ENDPROPERTIES'
bdftopcf: bdf input, /build/source/hidpi/gohufont-22.bdf, corrupt

@rnhmjoj
Copy link
Author

rnhmjoj commented Jan 17, 2020

ping

@jessestricker
Copy link

I ran into the same issue with bdf2pdf reporting width 0 zero or too big.

The proposed patch works, maybe @rnhmjoj applied the patch incorrectly?

I changed the SIZE from 11 to 22 and added the AVERAGE_WIDTH 120 line below the FACE_NAME line. Then I converted it with the following command line:

bdf2psf --fb gohufont-22.bdf '' '' 512 gohufont-22.psf

@rnhmjoj
Copy link
Author

rnhmjoj commented May 23, 2022

Quite possible, I'll give it another try when I have some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants