-
Notifications
You must be signed in to change notification settings - Fork 7
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
Noto Sans Mono doesn't declare spacing property #196
Comments
To be clear, this breaks my desktop: I can’t set Noto Sans Mono as the system monospace font so I need to configure all my applications by hand, and many cannot even use the font or breaks badly. The only way to make my desktop usable again was to downgrade the fonts. |
@ariasuni : which version of Noto Sans Mono font gave a result for the following command |
@waksmonskiMT : Sue, could remind me, if Noto Sans Mono should (or should not) have spacing property set? I looked within Glyphs.app at the sources and for whatever I looked the non-condensed glyphs were 600 wide and condensed were 500. These all appeared to be constant, however I haven't looked at everything. |
|
@ariasuni : does the font with the above properties work for you or doesn't as Mono spaced font? also does the previous version that works have spacing property? |
Today it seems to work. I guess replacing all my fonts needs a reboot a not simply a log out. EDIT: Atom doesn’t seem to be able to pick Noto Sans Mono when using «default family» as a setting, although Also, I still can’t select Noto Sans Mono normally in Konsole, I should check «Show all fonts» to also show sans and serif fonts, to be able to select Noto Sans Mono. |
Also, the properties of Noto Mono, which I can select normally in Konsole and other apps:
|
@ariasuni do you have 66-noto-mono.conf enabled in /etc/fonts/conf.d? This sets Noto Sans Mono explicitely as default monospace font, so the fc-match results in that case are not significant. Without explicitely setting it as monospace in /etc/fonts/conf.d, Noto Sans Mono doesn't appear in the output of |
I can confirm that I have |
Just for your information... Qt considers a font monospace if it is bool fixedPitch = spacing_value >= FC_MONO; Noto that, in if (bool(options & QFontDialog::MonospacedFonts) != fdb.isFixedPitch(family))
continue; See this simple test: #include <iostream>
#include <QApplication>
#include <QFontDialog>
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
auto font = QFontDialog::getFont(nullptr, QFont(), nullptr, nullptr, QFontDialog::MonospacedFonts);
std::cout << font.family().toStdString() << std::endl;
} KDE Konsole also uses this: if (showAllFonts) {
currentFont = QFontDialog::getFont(&result, currentFont, this,
i18n("Select Any Font"));
} else {
currentFont = QFontDialog::getFont(&result, currentFont, this,
i18n("Select Fixed Width Font"),
QFontDialog::MonospacedFonts);
} |
Version (fc-scan):
|
@behdad : you updated fc-scan man page last time, so you might know... how do we set spacing in the sources (this could be a source issue or a pipeline issue)? I meant to ask here :-( |
The spacing seems to be detected by looking at and categorizing the advance values. See https://github.com/behdad/fontconfig/blob/a8a6efa805fc03e790214e8a0bc55843a258d774/src/fcfreetype.c#L2348-L2415 |
By the way, even if everything worked properly, the CJK versions probably still won't show up as mono in Qt as the expression shown by Lion ignores FC_DUAL. We need a separate Qt bug for this. |
Not really sure if this is the right place to post this, but on Arch Linux, when I run
Why is Could someone tell me if this is the same problem as described in this issue? Apologies if it isn't, I have a very loose grasp of how all this font stuff works. |
@masaeedu Also on arch and with only
I assume you have additional/other Noto font packages installed? Edit:
|
@masaeedu @tadly Well, in fact, configuration mangles your query first. I guess you have different configuration files. You may use The workflow of fc-match:
|
@tadly I only had @LionNatsu Supposing it's mangling I'm assuming the config file that governs this is |
@masaeedu Yes, config files in /etc/fonts. But also don't forget those config files in your home directory. I guess it could be somewhere in ~/.config/fonts or ~/.local/… . |
@LionNatsu Is there a way to get a comprehensive list of all the locations it looks in? I don't have a |
https://www.freedesktop.org/software/fontconfig/fontconfig-user.html |
Need someone who knows fontconfig to debug this. |
I checked. NotoSansMono has widths at 0, 600, 1200, and 1800. Ie, it has a few "triple-width" glyphs:
I don't know how to resolve that... cc @tagoh |
Maybe we should publish just a width="600" subset somewhere... just a crazy idea to force spacing=mono |
width 1200:
|
width 1800:
|
Should there be an "FC_MULTIPLE" spacing? I proposed this on Fontconfig's repository. |
So... it's been close to eight months. Anything happening with this bug? |
No. |
@kozross just go use something else. Use FiraCode or checkout the new and open-sourced font from microsoft, Cascadia Code or something completely different... |
There’s also Hack that I like a lot — it’s the default monospace font of KDE Plasma (together with Noto Sans for the main font family). Like the suggestions above, it’s been designed for code so it’s much better than Noto Sans Mono for that purpose, in my opinion. |
The great thing about Noto is that it is an open source font project. One can take the sources, change them and as long as the licensing requirements are met (see the info at https://github.com/googlefonts/noto-source ), one can publish or use itself the results without waiting for Google. If there's anybody who could look at fixing this for everybody interested (the fix doesn't have to be named Noto XYZ, as long as the licensing requirements are met) that could be very helpful to the community. Note that the fix might be a modification to Fontconfig repository, to the binary fonts itself or through the Noto Mono sources or ???? |
re timing of the fix: at this point we have no budget to fix this, hence I don't know when we could deliver the fix. |
Arch Linux and perhaps any other distro that uses 66-noto-* conf files (or any other digit above 48) where the config sets a default generic family is too late and will instead have sans-serif. I've described in detail with examples of why this happens here. Gist of it is you'll have a A related issue is when third-party packages install configs without respecting the purpose of the digits in the filenames, which aren't just for priority alone(well they kind of are, but they're meant to be more like categories/stages), I provide some more insights here. Also, Is there any information about what Noto Sans Mono is derived from? It's apparently quite different from the deprecated Noto Mono(which will be recognized as spacing==100), and the getnoto website provides the hinted version of Noto Sans Mono which provides ligatures and/or causes some other issues iirc, my packaged version on Arch Linux appears to be using the newer unhinted version from github where ligatures aren't rendered. I am not aware of what the 1200 and 1800 wide glyphs are for, are they important at all? With a width of 600 units, that sounds like it might be related to Source Code Pro? This is a monospace font that is recognized as having a spacing of 100, and no ligatures. I know that many Noto fonts are rebranded Adobe Source ones, is that the case with Noto Sans Mono? |
At a glance "Noto Mono" appears to be identical to "Droid Sans Mono". If you want to use a replacement font that isn't deprecated, and aren't reliant on whatever changes "Noto Sans Mono" has compared to "Noto Mono", that's probably a good choice? Differences to what "Noto Sans Mono" has is unclear:
On Manjaro Linux "Noto Mono" is still shipped and set as the default font for Konsole. That should be changing in future. Hack adds subtle changes, the bold weight is most noticeable(Noto Mono/Droid Sans Mono only support "Regular" weight). Fira Code/Fira Mono is bit more noticeable of a difference, especially with line-height being larger(EDIT: it's smaller than Noto Sans Mono, so Noto Mono/Droid Sans Mono might be too compact for others?). Fira Mono looks more legible in Konsole. If you toggle the checkbox to see all fonts, there's also a "Droid Sans [MONO]", it has a bold weight and is more compact in lineheight than Droid Sans Mono. Glyphs are also different, like the |
Don’t get me wrong @marekjez86, I think Noto Sans Mono is great but some other fonts are better depending on your use case, and mentioning them may help people who use and can’t fix the font. Also, I think some of the frustration around this issue is that Noto Mono didn’t have this (and other) issues, so it’s quite annoying that it was removed quickly (I think about Arch Linux users using the official package). |
[points to self] |
~just a fellow kitty user is there any way to workaround this issue? kitty wiki advices the following config to manually set/correct spacing value of a font family <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="scan">
<test name="family">
<string>Your Font Family Name</string>
</test>
<edit name="spacing">
<int>100</int>
</edit>
</match>
</fontconfig> and i also tried to make some edits to it according to a fontconfig issue linked above <edit name="spacing" mode="assign"> but this doesn't seems to be helpful and |
You have to run |
@tagoh, still doesn't seem to be helpful, here is my exact <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="scan">
<test name="family">
<string>Noto Sans Mono</string>
</test>
<edit name="spacing" mode="assign">
<int>100</int>
</edit>
</match>
</fontconfig> and even after |
That may be reading older cache on system then. you may want to try a) update system-wide caches with it b) make sure the user cache dir is coming earlier than system-wide in fonts.conf. |
To be sure, b) must be a fontconfig bug. it should be supposed to work without changes in the order. otherwise all of caches will be stored in /root/.cache/fontconfig say on running fc-cache by root. that's wrong. |
@tagoh, i've removed the |
No. that doesn't change anything. well, here may be wrong place to explain more details. but updated caches must be used and has a priority than old one. "old one" here means system-wide caches like something in /var/cache/fontconfig. however, apparently timestamp seems ignoring and referring caches according to the order of cachedir. so what you see wasn't coming from updated caches on your $HOME/.cache/fontconfig. |
@tagoh, jesus christ, it finally works and looks like you are right. i found second fontconfig cache in |
@tagoh Thanks for this, I have been trying to debug some weirdness in behaviour, where the I had 497(6.7MiB) of these cache files. I've noticed that Chrome would sometimes take multiple seconds to show the right click context menu when I had selected some text, I guess it was due to wading through all the cache files.. I also had 1598 files(21.1MiB) in the
Apparently, also doing |
The underlying problem here is that Noto Sans Mono isn't actually monospace, so our build toolchain (correctly!) doesn't set the monospace bit. So in that sense this is a duplicate of #234. |
NotoSansMono-Regular.ttf
Version: 131072 from git b207fc3
Linux
Issue
The spacing property is not declared, so the font is not identified as monospace by some applications (eg. KDE konsole)
fc-scan /usr/share/fonts/noto/NotoSansMono-Regular.ttf | grep spacing
Nothing
spacing: 100 or spacing: mono
The text was updated successfully, but these errors were encountered: