-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
fonts: provide opentype files for X11 bitmap fonts #75160
Comments
There's also the fonts in the xorg attrset such as fontmiscmisc. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/what-are-your-goals-for-20-03/4773/13 |
Should we keep the former PCF / BDF fonts in? |
Definitely: most software still use PCF/BDF fonts, especially older one. |
@rnhmjoj given the following powerline-fonts package and this i3 font config: |
@multun: I'm not sure. It could be pango is loading the pcf first and failing. Does that happen with other fonts too? |
@multun I think that the |
@rnhmjoj I tried the font myself with awesomewm and I have the same issue. I indeed think that Pango loads the pcf/bdf version first. I tried a disabling type1 bitmap fonts and/or bitmaps as a whole in fontconfig using fonts.fontconfig = {
allowBitmaps = false;
allowType1 = false;
}; but it seems that otb fonts are still considered as bitmap fonts by fontconfig, so this doesn't work. |
Void decided to downgrade pango to 1.43. In facts the 1.44 doesn't really bring any new feature (the package is in "maintenance mode") but only breakages: besides bitmap also lots of vector fonts now have spacing issues. We may consider this. |
Many programs (e.g. Nautilus) already depend on Pango 1.44. |
Another solution that is found on the AUR is to provide two different packages, for instance |
@Vxid: maybe we could use multiple outputs to avoid duplicating the packages. |
@rnhmjoj I did not know this was possible. That would be much cleaner indeed. I am not sure on how to do it though. I could change all the problematics don't packages if I had an blueprint on how to do so. I did the same thing with bitmap fonts on the AUR, by copying existing PKGBUILDs. |
Before doing this on a scale, I'd like to solve the problem that fonttosfnt is not deterministic, or rather, it produces slightly different outputs on diferent architectures. Currently this breaks all fonts being fixed-output derivations. |
Things generated by fonttosfnt probably should not be FODs anyway. |
@jtojnar Why not? Fonts are just data: they shouldn't depend on the platform generating them and should be fixed outputs. |
Good news: I sorted out the trouble with fonttosfnt in #75163.
The bad news is that fixed output and multiple outputs are incompatible so we'll have to choose one. I don't know if there is any workaround. Another option I tried is renaming the font family to something like |
@rnhmjoj That's very good news. If the otb output works as intended for both GTK and X11 applications, I think your last solution involving renaming old bdf files would be the best. I am ready to test-drive some fonts to make sure they all display correctly after renaming them. |
By the way, @jtojnar made me realized fixed output for a package that isn't strictly unpacking some source is a cheat: because an update to any dependency could theoretically change the result but nix won't rebuild the package. So it's actually better to remove the fixed output constraint and split the outputs.
I now think the best approach is to split the outputs. Renaming can't be done in general, because many fonts are provided as pcf and they can't be modified so easily (it requires writing a fontforge script). Also renaming the font will require people to change their configuration files. |
You can check out my PR for gohufont. |
You can install the unstable fonts easily:
and in configuration.nix {
fonts.fonts =
let unstable = import <nixos-unstable> { };
in [ unstable.uw-ttyp0.otb ];
} |
That is a good point.
I kindly disagree. As is well known, the whole pango issue already caused a lot of headache for many people, having it fixed in NixOS once and for all ASAP would be my personal preference. |
Backporting these changes as is going to to very little: since the fonts are split in different outputs and OpenType fonts are not in the default one, GTK applications will still be broken by default. Moverover, I was using the same bitmap font in GTK and X11 applications so I had to change my .Xresources to use the OpenType variant because the two can't be installed together. This situation could change if Pango were to fix the font loading issue: I would just merge the outputs and backport the changes along with a pango patch. |
Pango drops support for non-Opentype bitmap fonts with version 1.44 [1,2]. The proposed alternative is to use bitmap-only OpenType fonts, that are supported. The otb file has been generated from the bdf file with the following command (see [3,4] for reference): fonttosfnt -b -c -g 2 -m 2 -o otb/siji.otb -- bdf/siji.bdf [1] https://gitlab.gnome.org/GNOME/pango/issues/386 [2] https://blogs.gnome.org/mclasen/2019/05/25/pango-future-directions/ [3] https://fedoraproject.org/wiki/BitmapFontConversion [4] NixOS/nixpkgs#75160
Pango doesn't support PCF and BDF fonts since v1.44 [1], but still supports OTB fonts. As such, we've had to generate OTB fonts for fonts that don't supply them [2], including tamzen. As of v1.11.5, tamzen supplies its own OTB fonts [3], so we don't need to make them ourselves. [1]: https://gitlab.gnome.org/GNOME/pango/-/issues/386 [2]: NixOS#75160 [3]: sunaku/tamzen-font#25
Pango doesn't support PCF and BDF fonts since v1.44 [1], but still supports OTB fonts. As such, we've had to generate OTB fonts for fonts that don't supply them [2], including tamzen. As of v1.11.5, tamzen supplies its own OTB fonts [3], so we don't need to make them ourselves. [1]: https://gitlab.gnome.org/GNOME/pango/-/issues/386 [2]: #75160 [3]: sunaku/tamzen-font#25
Pango doesn't support PCF and BDF fonts since v1.44 [1], but still supports OTB fonts. As such, we've had to generate OTB fonts for fonts that don't supply them [2], including tamzen. As of v1.11.5, tamzen supplies its own OTB fonts [3], so we don't need to make them ourselves. [1]: https://gitlab.gnome.org/GNOME/pango/-/issues/386 [2]: NixOS#75160 [3]: sunaku/tamzen-font#25 (cherry picked from commit 1975e4b)
I'm taking a look at the xorg fonts, now. The packages containing type 1 bitmap fonts apparently are:
These are all collections of fonts and there are pcf, pfa and afm, which I'm not sure they are supported by fonttosfnt. Reading their |
Having removed the vector fonts and run fonttosfnt we are left with:
The first "type1" half simply can't be converted with this tool, the second half should but it's failing. |
So, with #91777 and #95907 applications using pango should be able to load bitmap fonts without more user intervations. The only problem left is the convertion of the |
Here's the expression: https://gist.github.com/rnhmjoj/bfa1af90c7f0f99b730eb8d4a7f6bd32 |
@rnhmjoj Thanks a lot for your on bitmap fonts, I have been using the otb output you provided for the past six months without any issues. |
Note that on unstable the |
So the only thing preventing this from getting closed seem to be How do we want to proceed with this?
|
Well, yes but there are also hundreds of fonts in |
I marked this as stale due to inactivity. → More info |
It seems fonttosfnt has improved a bit since last time I tried it. It's worth trying another round of convertions. |
Unfortunately no big changes: fonttosfnt is still producing fonts with broken metrics, mostly; fontforge seems to have gotten better, but still far from the original. |
I marked this as stale due to inactivity. → More info |
I guess we can close this issue now: it doesn't look like there's much interest in converting the remaining fonts. |
Since 23edc9c bitmap fonts in PCF and BDF format stopped working in applications using pango as a backend (gtk apps for example).
Bitmap fonts packaged in nixpkgs should be updated to provide OTB (OpenType Bitmap) fonts. If unsupported upstream the
xorg.fonttofsnt
tool may be used to generate them.Possibly affected packages:
clearlyU
(clearlyU: split outputs in out and otb #79638)creep
(creep: split outputs in out and otb #79641)dina
(dina: generate otb files with fontforge #79664)dina-pcf
(dina: generate otb files with fontforge #79664)envypn-font
(envypn-font: split outputs in out and otb #79666)gohufont
(gohufont: generate opentype files #75163)(already provides OTF and TTF)powerline-fonts
profont
(profont: install otb variant #79756)proggyfonts
(no upstream support or good results with ff or fonttosfnt)siji
(siji: split output into out, bdf, otb #80220)spleen
(spleen: install otf font #79671)tamsyn
(tamsyn: generate otb and split output #80228)terminus_font
(terminus_font: generate otb and split output #80261)tewi
(tewi-font: generate otb and split output #80270)ucs-fonts
(ucs-fonts: generate pcf, otb and split output #80366)unifont
(unifont: generate otb and split output #80322)uni-vga
(uni-vga: generate otb, psf and split output #80326)unscii
(already provides OTF and TTF)uw-ttyp0
(uw-ttyp0: split outputs in out and otb #79633)Maintainer information:
The text was updated successfully, but these errors were encountered: