Cozette icon indicating copy to clipboard operation
Cozette copied to clipboard

Scaling for HiDPI displays

Open sidosoft opened this issue 3 years ago • 10 comments

Hi! While Cozette looks beautiful, it is way to small to be used on HiDPI displays. Would it be possible to scale every glyph by a factor of 2 or more? Or at least could you please advise the best way one can scale an .otb font, pixel-perfectly, so each pixel becomes a 2x2 block? Thank you.

sidosoft avatar Aug 30 '20 23:08 sidosoft

UPDATE: I managed to scale Cozette using this tool for scaling BDF fonts: https://github.com/philj56/bdfscale Also, with a minor modification of the above script, I scaled the font so that each pixel becomes 2x3 or 3x4 block. I report that Cozette looks beautiful scaled by 3x4! (See issue #3 which requests a taller variant.)

sidosoft avatar Aug 31 '20 09:08 sidosoft

I'm probably not going to provide builds with the scaling applied, but I'll add instructions on how to do that to the README - glad you figured it out and that it works for you!

slavfox avatar Aug 31 '20 10:08 slavfox

UPDATE: I managed to scale Cozette using this tool for scaling BDF fonts: https://github.com/philj56/bdfscale Also, with a minor modification of the above script, I scaled the font so that each pixel becomes 2x3 or 3x4 block. I report that Cozette looks beautiful scaled by 3x4! (See issue #3 which requests a taller variant.)

Can you provide instructions on how to do this please?

eggjoystick avatar Aug 31 '20 15:08 eggjoystick

Can you provide instructions on how to do this please?

Not OP, but run the python script they linked.

fluix-dev avatar Aug 31 '20 15:08 fluix-dev

Can you provide instructions on how to do this please?

Not OP, but run the python script they linked.

Thanks; I was running the script but not correctly outputting a new BDF file. Eventually, I was able to figure out that I needed to add > cozette-scaled.bdf to generate the new BDF file.

eggjoystick avatar Aug 31 '20 15:08 eggjoystick

Thanks; I was running the script but not correctly outputting a new BDF file. Eventually, I was able to figure out that I needed to add > cozette-scaled.bdf to generate the new BDF file.

After scaling, I additionally had to load the scaled .BDF font in FontForge, select all "glyphs worth outputting", and then in Metrics --> Set Width specify the width that is 4/3 times what was there before; then export as .OTB. Without this step, the characters were spaced strangely (on GNU/Linux). I suspect that this extra step is necessary due to bdfscale not correctly scaling one or more of the font metrics.

sidosoft avatar Aug 31 '20 19:08 sidosoft

With that last note, it sounds like something I could provide a build command for to make it simpler. Should happen in the next release.

slavfox avatar Sep 03 '20 22:09 slavfox

Hi, I am experiencing the same issue with Cozette appearing too small. When I try scaling it using bdfscale with a factor of 2 and then converting it to .otb using FontForge, the font then appears too big. I have been struggling with this for weeks now and I can't figure it out on my own since I don't have a lot of experience working with fonts. Could someone please suggest an alternative method to scale Cozette (of bitmap fonts in general) or send an already scaled version? Any help would be greatly appreciated!

robert5800 avatar Mar 28 '21 11:03 robert5800

@sidosoft Can you please provide your scaled version?

minikN avatar Oct 10 '21 18:10 minikN

This is still an issue. I love this font and want to use it everywhere, but we need to have support for HiDPI displays. :disappointed:

tjbarber avatar Feb 16 '22 17:02 tjbarber

I dropped the ball on this - it's almost three years later, and I forgot about this issue entirely. I'll take a look at shipping scaled-up versions this week.

slavfox avatar Jun 10 '23 07:06 slavfox

I'm years late, but v.1.19.2-hidpi is now live; it contains a 2x upscaled version of the bitmap font.

slavfox avatar Jun 11 '23 03:06 slavfox

Hey @slavfox, I gave the hidpi version a shot and things look a little off on arch using the foot terminal. Is there some step necessary to make these look better?

swappy-20230611_185557

nyonson avatar Jun 12 '23 01:06 nyonson

What pixel size is this at? Bitmap fonts are intended to render correctly at one and one size only, and the target for cozette_hidpi is 26pts.

slavfox avatar Jun 12 '23 05:06 slavfox

That is with size 26. I tried a few other sizes as well and they all have the same look. Maybe something up with my foot terminal settings?

nyonson avatar Jun 12 '23 12:06 nyonson

Huh, yeah; I can reproduce this in Alacritty. I'll look at it further. Reopening this issue for now.

slavfox avatar Jun 12 '23 13:06 slavfox

Found the issue. Should have a fix out today.

slavfox avatar Jun 12 '23 13:06 slavfox

This should be fixed in v1.19.2-hidpi2. image

slavfox avatar Jun 12 '23 13:06 slavfox