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

Implement support for bitmap fonts #97

Closed
huffman opened this issue Jul 29, 2017 · 23 comments
Closed

Implement support for bitmap fonts #97

huffman opened this issue Jul 29, 2017 · 23 comments

Comments

@huffman
Copy link

huffman commented Jul 29, 2017

I use the terminus bitmap font on my linux machine, but unfortunately kitty does not support bitmap fonts.

@kovidgoyal
Copy link
Owner

There is not much point in supporting bitmap fonts in kitty. Each glyph is rendered only a single time (and then cached), so there is no significant performance advantage. I suppose some people prefer the rendering of botmap fonts, but I am not amongst their number. As such, this is not something I care to spend time on. But patches are welcome.

@AlexDaniel
Copy link

The point of using bitmap fonts is so that you wouldn't have to look at smudgy 💩. I was told that I'd be better off using non-bitmap fonts that have proper hinting, but at this point I don't think I've ever seen a good free font like that (but there are non-free fonts).

IMO this should be on the roadmap and not rejected like this.

@kovidgoyal
Copy link
Owner

Actually, I should amend my stated position here. I wont accept pull requests for bitmap font support. One of kitty's fundamental features is the ability to display fonts at arbitrary font sizes, which bitmap fonts are not suited for.

So if you like bitmap fonts, kitty is not for you.

@AlexDaniel
Copy link

Even better! Thanks.

@ghost
Copy link

ghost commented Sep 9, 2018

Listen here you little fucking shit. You WILL give me my bitmap fonts or there will be HELL to be pay!!!

YOU FUCKING HEAR ME YOU LITTLE FUCKING SHIT!? THE CONSEQUENCES WILL NEVER BE THE SAME!!!

REEEEEEEEEEEEEEEE

@SolitudeSF
Copy link
Contributor

stop visiting r/unixporn and desktop threads, and you wont need bitmap fonts. they are absolute meme

@diamondburned
Copy link

stop visiting r/unixporn and desktop threads, and you wont need bitmap fonts. they are absolute meme

Again, quoting from another guy:

The point of using bitmap fonts is so that you wouldn't have to look at smudgy hankey.

Using bitmap fonts really helped me see more text at smaller font sizes. I didn't give a crap about unixporn before. Legibility wise, monospace bitmap fonts are way better than TrueType/anti-aliased fonts.

@im-n1
Copy link

im-n1 commented Jan 10, 2019

Sooner or later someone will make a fork of this project and implement bitmap font support. Then this repo will just die. You cant stop improvement.

In the meantime we will stick with our urxvt terminals ;)

@Luflosi
Copy link
Contributor

Luflosi commented Jan 10, 2019

@kovidgoyal didn't say that he would stop improvement, he said

patches are welcome.

And that he's just not interested in implementing it himself. So feel free to implement it and make a pull request.

@maximbaz
Copy link
Contributor

Not in this case :) #97 (comment)

Actually, I should amend my stated position here. I wont accept pull requests for bitmap font support. One of kitty's fundamental features is the ability to display fonts at arbitrary font sizes, which bitmap fonts are not suited for.

So if you like bitmap fonts, kitty is not for you.

@Luflosi
Copy link
Contributor

Luflosi commented Jan 10, 2019

Oh, sorry, I only read his earlier message.

@ctrlcctrlv
Copy link
Contributor

As FreeType is used for rendering, on Linux via Fontconfig, it's already possible to use bitmap fonts. So really this issue is moot. If the font contains embedded bitmaps, and Fontconfig is configured to use them, they should display unless kitty specifically rejects them, which I highly doubt it does.

@kovidgoyal
Copy link
Owner

It does reject them. bitmap fonts are not freely re-scaleabale (without
severe artifacts), kitty is.

@ctrlcctrlv
Copy link
Contributor

ctrlcctrlv commented Jan 28, 2020

As a contributor to FontForge project, I know for a fact that I can fashion fonts with embedded bitmaps which Kitty will not reject. Let me demonstrate.

Let's consider Terminus, a popular font among some. Here's a BDF version of it: terminus-32pt.bdf

Now let's open it in FontForge master. As we discuss in fontforge/fontforge#3853, this process is a bit buggy. Specifically, it is our position that users do not try to put multiple strikes in an OTB. However, for one BDF, it will work fine.

Optional: To prevent collisions, I went to «Element→Font Info» and changed the font name to KittyOTB.

So, «Generate Fonts»…output to ~/.fonts/KittyOTB.otb, choose No Outline Font, X11 bitmap only font (otb). Wonderful.

Let's tell Kitty a few white lies. What it doesn't know won't hurt it, isn't it? 😉

<match target="scan">
   <test name="family">
      <string>KittyOTB</string>
   </test>
   <edit name="spacing">
      <int>100</int>
   </edit>
   <edit name="scalable">
      <bool>true</bool>
   </edit>
   <edit name="outline">
      <bool>true</bool>
   </edit>
</match>

By default, Kitty doesn't want to open, it thinks line-height is 0.

[028 13:58:24.417116] Cell height invalid after adjustment, ignoring adjust_line_height
[028 13:58:24.417146] Line height too small: 0

No problem, just say:

font_size 32.0
adjust_line_height  32

2020-01-28-140337_1880x1115_scrot

Resizing window font size (e.g. via CtrlShift+) will no longer work, naturally. Everything else seems to. This process can be automated, please see our Python documentation.

Hope you won't be offended @kovidgoyal. Don't mean to contradict, only to educate.

@kovidgoyal
Copy link
Owner

Well yes, kitty relies on fontconfig not lying to it about the fonts. Or
to be precise, it checks the scaleable property from fontconfig and
rejects any fonts that have that false as the main font.

@ctrlcctrlv
Copy link
Contributor

It should be possible to craft a font that doesn't need to lie. For example, you can put squares in the outline table, and also make sure scale is 100. If configured correctly, the embedded bitmaps should be chosen at size 32 and the squares used to make (ugly) output otherwise.

@al-caveman
Copy link

@kovidgoyal You seem to be unable to understand these concepts:

  • Unique advantages of bitmaps: Bitmap fonts allow superior pixel utilization by enabling us to choose smaller fonts without getting overly blurred.
  • Free font scaling isn't used by most users: Most users simply use a fixed font for their terminal.

I just uninstalled kitty. Looking forward for forks of this project with bitmap support. Using konsole manwhile.

@ctrlcctrlv
Copy link
Contributor

@al-caveman Why is a fork supposedly necessary? Did you try my method? Does it work for you?

@AlexDaniel
Copy link

AlexDaniel commented Jul 8, 2020

Given that I commented on this issue previously, here's my solution. For anyone who's looking for a fast modern terminal that can work with bitmap fonts, I recently stumbled upon alacritty. It's another gpu-accelerated terminal but it seems to work with bitmap fonts just fine. In fact, speaking of font rendering, it's even better than urvxt after recent pango breakage. I'm not sure if you need bitmap fonts in otb format, but most distros are now converting everything to otb anyway, so that shouldn't be a problem.

So, basically, you can install alacritty (on debian you can use their released .deb file) and set the font in its config, it should work.

Just for fun, here's a screenshot of alacritty (default config) vs urxvt (with broken rendering after recent pango accident):

image

@ghost
Copy link

ghost commented Jul 28, 2020

I switched to Alacritty for this reason. I tried bitmap font (not because unixporn, because tamsyn and tamzen looked really good) and I liked it. but still I think kitty is more mature.
now, looks like someone did it
https://aur.archlinux.org/packages/kitty-bitmap/
Sadly, I don't use arch anymore btw so I have to read the pkgbuild and make overlay for my distro.

@ctrlcctrlv
Copy link
Contributor

I do not understand why people continue to comment on this issue. A workaround is available for kitty master. You don't need Alacritty (which is a laughable "alternative" and does not support most of Kitty's features, it having one feature Kitty does not does not outweigh the hundreds it's missing), nor do you need a fork.

If I were @kovidgoyal I would lock this issue to contributors. My workaround works, nobody reported problems with it, etc.

@diamondburned
Copy link

If I were @kovidgoyal, I would've locked this issue before you could even post a fix.

@ctrlcctrlv
Copy link
Contributor

ctrlcctrlv commented Jul 28, 2020

I know this was meant to offend me, but that would perhaps have been prudent; I could have simply posted my fix to Medium or Gist, lol.

(Or PR'd it to Kitty's docs.)

Repository owner locked as resolved and limited conversation to collaborators Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants