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

Noto Sans Mono doesn't declare spacing property #196

Closed
antonio-rojas opened this issue Apr 5, 2018 · 52 comments
Closed

Noto Sans Mono doesn't declare spacing property #196

antonio-rojas opened this issue Apr 5, 2018 · 52 comments

Comments

@antonio-rojas
Copy link

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)

  1. Steps to reproduce
    fc-scan /usr/share/fonts/noto/NotoSansMono-Regular.ttf | grep spacing
  2. Observed results
    Nothing
  3. Expected results
    spacing: 100 or spacing: mono
@ariasuni
Copy link

ariasuni commented Apr 9, 2018

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.

@marekjez86
Copy link

@ariasuni : which version of Noto Sans Mono font gave a result for the following command
fc-scan /usr/share/fonts/noto/NotoSansMono-Regular.ttf | grep spacing
Could you upload it here or at least give me a version number?

@marekjez86
Copy link

@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
Copy link

ariasuni commented Apr 9, 2018

❯ fc-scan usr/share/fonts/noto/NotoSansMono-Regular.ttf 
Pattern has 24 elts (size 32)
        family: "Noto Sans Mono"(s)
        familylang: "en"(s)
        style: "Regular"(s)
        stylelang: "en"(s)
        fullname: "Noto Sans Mono Regular"(s)
        fullnamelang: "en"(s)
        slant: 0(i)(s)
        weight: 80(f)(s)
        width: 100(f)(s)
        foundry: "GOOG"(s)
        file: "usr/share/fonts/noto/NotoSansMono-Regular.ttf"(s)
        index: 0(i)(s)
        outline: True(s)
        scalable: True(s)
        charset: 
        0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
        0002: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
        0003: ffffffff ffffffff ffffffff fcffffff ffffd7f0 fffffffb ffffffff ffff0003
        0004: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
        0005: ffffffff 0000ffff 00000000 00000000 00000000 00000000 00000000 00000000
        001a: 00000000 00000000 00000000 00000000 00000000 7fff0000 00000000 00000000
        001c: 00000000 00000000 00000000 00000000 000001ff 00000000 00000000 00000000
        001d: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff f83fffff
        001e: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
        001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
        0020: ffffffff ffffffff ffffffff fff3ffdf 1fff7fff 7fffffff 00000000 00010000
        0021: ffffffff ffffffff ffffffff 00000000 00000210 00000000 00000000 00000000
        0022: 46000000 00000200 00000100 00000032 00000000 00000000 00000000 00000000
        0023: 00010000 00000003 00000000 00000000 00000000 00000000 00000000 00000000
        0025: ffffffff ffffffff ffffffff ffffffff ffffffff 00000001 00000000 00000000
        002c: 00000000 00000000 00000000 ffffffff 00000000 00000000 00000000 00000000
        002d: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffffffff
        002e: ffffffff ffffffff 0000001f 00000000 00000000 00000000 00000000 00000000
        00a6: 00000000 00000000 ffffffff ffffffff ffffffff 00000000 00000000 00000000
        00a7: ffffffff ffffffff ffffffff ffffffff ffffffff 00ff7fff 00000000 ff800000
        00a9: 00000000 00004000 00000000 00000000 00000000 00000000 00000000 00000000
        00ab: 00000000 ffff0000 ffffffff 0000003f 00000000 00000000 00000000 00000000
        00fb: 0000007f 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        00fe: 00000001 0000ffff 00000000 00000000 00000000 00000000 00000000 80000000
        00ff: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 30000000
(s)
        lang: aa|ab|af|ast|av|ay|az-az|ba|bm|be|bg|bi|bin|br|bs|bua|ca|ce|ch|chm|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|ff|fur|fy|ga|gd|gl|gn|gv|ha|haw|ho|hr|hu|ia|ig|id|ie|ik|io|is|it|kaa|ki|kk|kl|ku-am|kum|kv|kw|ky|la|lb|lez|ln|lt|lv|mg|mh|mi|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|sco|se|sel|sh|shs|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|to|tr|ts|tt|tw|tyv|uk|uz|ve|vi|vo|vot|wa|wen|wo|xh|yap|yo|zu|ak|an|ber-dz|crh|csb|ee|fat|fil|hsb|ht|hz|jv|kab|kj|kr|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|nv|pap-an|pap-aw|qu|quz|rn|rw|sc|sg|sn|su|ty|za(s)
        fontversion: 131072(i)(s)
        capability: "otlayout:DFLT otlayout:cyrl otlayout:grek otlayout:latn"(s)
        fontformat: "TrueType"(s)
        decorative: False(s)
        postscriptname: "NotoSansMono-Regular"(s)
        color: False(s)
        symbol: False(s)
        variable: False(s)

@marekjez86
Copy link

marekjez86 commented Apr 9, 2018

@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?

@ariasuni
Copy link

ariasuni commented Apr 9, 2018

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 fc-match -s monospace returns NotoSansMono-Regular.ttf in first position.

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.

@ariasuni
Copy link

ariasuni commented Apr 9, 2018

Also, the properties of Noto Mono, which I can select normally in Konsole and other apps:

❯ fc-scan /usr/share/fonts/noto/NotoMono-Regular.ttf 
Pattern has 24 elts (size 32)
        family: "Noto Mono"(s)
        familylang: "en"(s)
        style: "Regular"(s)
        stylelang: "en"(s)
        fullname: "Noto Mono"(s)
        fullnamelang: "en"(s)
        slant: 0(i)(s)
        weight: 80(f)(s)
        width: 100(f)(s)
        spacing: 100(i)(s)
        foundry: "GOOG"(s)
        file: "/usr/share/fonts/noto/NotoMono-Regular.ttf"(s)
        index: 0(i)(s)
        outline: True(s)
        scalable: True(s)
        charset: 
        0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        0001: ffffffff ffffffff ffffffff ffffffff 00040000 00018003 00000000 fc010000
        0002: 0f000000 00000000 00000000 00000000 00000000 10000000 3f0002c0 00080000
        0003: 0000820b 00000008 00000000 00000000 ffffd7f0 fffffffb 00467fff 00000000
        0004: ffffffff ffffffff ffffffff ffffffff ffffff7f ffffffff ffffffff ffffffff
        0005: 000fffff 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        001e: 00000003 c0000000 00000000 00000000 0000003f ffffffff ffffffff 03ffffff
        001f: 00000000 00000000 00002000 00000000 00000000 00000000 00000000 00000000
        0020: 7fb80fff 160d0047 00000010 80000000 00000000 00001898 00000000 00000000
        0021: 00480020 00004044 78000000 00000000 00000000 00000000 00000000 00000000
        0022: 44068044 00000800 00000100 00000031 00000000 00000000 00000000 00000000
        0025: 00000000 00000000 00000000 00000000 00000000 00000000 00000400 00000000
        00fb: 0000001e 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        00fe: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 80000000
        00ff: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 30000000
(s)
        lang: aa|ab|af|av|ay|ba|be|bg|bi|bin|br|bs|bua|ca|ce|ch|chm|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gn|gv|ho|hr|hu|ia|ig|id|ie|ik|io|is|it|kaa|ki|kk|kl|kum|kv|ky|la|lb|lez|lt|lv|mg|mh|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|tr|ts|tt|tyv|uk|uz|vo|vot|wa|wen|wo|xh|yap|zu|an|crh|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|ty|za(s)
        fontversion: 65536(i)(s)
        fontformat: "TrueType"(s)
        decorative: False(s)
        postscriptname: "NotoMono"(s)
        color: False(s)
        symbol: False(s)
        variable: False(s)

@antonio-rojas
Copy link
Author

@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 fc-match -s monospace

@ariasuni
Copy link

ariasuni commented Apr 9, 2018

I can confirm that I have 66-noto-mono.conf in /etc/fonts/conf.d (I symlinked it myself — this is not done by default on Arch Linux). And as I said, even when NotoSansMono-Regular.ttf is the first result of fc-match -s monospace, Konsole doesn’t consider it a monospace font.

@LionNatsu
Copy link

LionNatsu commented Apr 10, 2018

Just for your information...

Qt considers a font monospace if it is fixedPitch,

bool fixedPitch = spacing_value >= FC_MONO;

Noto that, in QFontDialog with QFontDialog::MonospacedFonts, QFontDialogPrivate::updateFamilies() hides fonts if

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);
}

@LionNatsu
Copy link

Version (fc-scan):

fontversion: 131072(i)(s)
fontformat: "TrueType"(s)
postscriptname: "NotoSansMono-Regular"(s)

@marekjez86
Copy link

@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 :-(

@Artoria2e5
Copy link

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

@Artoria2e5
Copy link

Artoria2e5 commented Apr 10, 2018

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.

@masaeedu
Copy link

masaeedu commented Jun 6, 2018

Not really sure if this is the right place to post this, but on Arch Linux, when I run fc-match -s monospace | head, I get:

NotoSans-Regular.ttf: "Noto Sans" "Regular"
PowerlineSymbols.otf: "PowerlineSymbols" "Medium"
NotoSansArmenian-Regular.ttf: "Noto Sans Armenian" "Regular"
NotoSansMono-Regular.ttf: "Noto Sans Mono" "Regular"
NotoSansAdlam-Regular.ttf: "Noto Sans Adlam" "Regular"
NotoSansAnatolianHieroglyphs-Regular.ttf: "Noto Sans Anatolian Hieroglyphs" "Regular"
NotoSansArabic-Regular.ttf: "Noto Sans Arabic" "Regular"
NotoSansAvestan-Regular.ttf: "Noto Sans Avestan" "Regular"
NotoSansBamum-Regular.ttf: "Noto Sans Bamum" "Regular"
NotoSansBatak-Regular.ttf: "Noto Sans Batak" "Regular"

Why is NotoSans-Regular.ttf at the top of the list? I ended up here by noticing that code snippets in firefox were rendering in a non-monospaced font, and in fact specifically as Noto Sans Regular. This is odd given that NotoSansMono-Regular.ttf is clearly available on the system.

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.

@tadly
Copy link

tadly commented Jun 7, 2018

@masaeedu Also on arch and with only extra/noto-fonts and extra/noto-fonts-emoji installed I do see a way different output to yours.

DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DejaVuSansMono-Bold.ttf: "DejaVu Sans Mono" "Bold"
DejaVuSansMono-Oblique.ttf: "DejaVu Sans Mono" "Oblique"
NimbusMonoPS-Regular.otf: "Nimbus Mono PS" "Regular"
dotum.ttf: "Baekmuk Dotum" "Regular"
FreeMono.ttf: "FreeMono" "Regular"
FreeSans.ttf: "FreeSans" "Regular"
FreeSerif.ttf: "FreeSerif" "Regular"
GE_Inspira.ttf: "GE Inspira" "Regular"
DejaVuMathTeXGyre.ttf: "DejaVu Math TeX Gyre" "Regular"

I assume you have additional/other Noto font packages installed?

Edit:
Increasing head shows that Noto will show up eventually...

...
NotoSansArmenian-Regular.ttf: "Noto Sans Armenian" "Regular"
...
Roboto Condensed-Regular.ttf: "Roboto Condensed" "Regular"
...
NotoSans-Regular.ttf: "Noto Sans" "Regular"
NotoSansAdlam-Regular.ttf: "Noto Sans Adlam" "Regular"
NotoSansAnatolianHieroglyphs-Regular.ttf: "Noto Sans Anatolian Hieroglyphs" "Regular"
...

@LionNatsu
Copy link

LionNatsu commented Jun 7, 2018

@masaeedu @tadly Well, in fact, configuration mangles your query first. I guess you have different configuration files. You may use fc-pattern -c … to check how configuration mangled your patterns.

The workflow of fc-match:

  1. You give a pattern, say, "(family=)monospace"
  2. Rules from configuration mangle the pattern, for example, "if family contains 'monospace', prepend a weak 'Noto Sans Mono' to family". Use fc-pattern -c … to see what will happen.
  3. Calculate "distance" of pattern to all fonts. Use fc-match -s … to check the sorted font list.

The distance from the pattern to the font is measured for each of several properties: foundry, charset, family, lang, spacing, pixelsize, style, slant, weight, antialias, rasterizer and outline. This list is in priority order -- results of comparing earlier elements of this list weigh more heavily than later elements.

@masaeedu
Copy link

masaeedu commented Jun 7, 2018

@tadly I only had extra/noto afaik, I eventually went ahead and installed fonts-meta-base and fonts-meta-extended-lt on arch to get decent looking rendering in firefox. These are actively maintained font bundles extracted out of the now inactive infinality bundle.

@LionNatsu Supposing it's mangling monospace into Noto Sans Mono, why is NotoSans-Regular.ttf interpreted as being a closer match than the actual NotoSansMono-Regular.ttf? I was assuming this was because out of all the properties you quoted, some that would normally be used to discriminate NotoSansMono from NotoSans (specifically the spacing) are not declared, and so it comes out to a wash between them.

I'm assuming the config file that governs this is /etc/fonts/fonts.conf, but i've never manually modified that file.

@LionNatsu
Copy link

@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/… .

@masaeedu
Copy link

masaeedu commented Jun 7, 2018

@LionNatsu Is there a way to get a comprehensive list of all the locations it looks in? I don't have a ~/.config/fonts folder, but there's a number of other things in ~/.config.

@LionNatsu
Copy link

@masaeedu

/etc/fonts/fonts.conf
/etc/fonts/fonts.dtd
/etc/fonts/conf.d
$XDG_CONFIG_HOME/fontconfig/conf.d
$XDG_CONFIG_HOME/fontconfig/fonts.conf
~/.fonts.conf.d
~/.fonts.conf

https://www.freedesktop.org/software/fontconfig/fontconfig-user.html

@behdad
Copy link

behdad commented Jul 23, 2018

Need someone who knows fontconfig to debug this.

@behdad
Copy link

behdad commented Aug 1, 2018

I checked. NotoSansMono has widths at 0, 600, 1200, and 1800. Ie, it has a few "triple-width" glyphs:

    <mtx name="uni2031" width="1800" lsb="67"/>
    <mtx name="uni213B" width="1800" lsb="95"/>
    <mtx name="uni2152" width="1800" lsb="248"/>
    <mtx name="uni2E3B" width="1800" lsb="0"/>

I don't know how to resolve that...

cc @tagoh

@marekjez86
Copy link

marekjez86 commented Aug 2, 2018

Maybe we should publish just a width="600" subset somewhere... just a crazy idea to force spacing=mono
When I have time I'll investigate what we would need to delete (I assume ttx <font> | grep mtx | grep -v 600 )

@marekjez86
Copy link

width 1200:

<mtx name="Rfraktur" width="1200" lsb="168"/>
<mtx name="arrowdblboth" width="1200" lsb="304"/>
<mtx name="arrowdblleft" width="1200" lsb="304"/>
<mtx name="arrowdblright" width="1200" lsb="304"/>
<mtx name="circlemultiply" width="1200" lsb="253"/>
<mtx name="circleplus" width="1200" lsb="253"/>
<mtx name="dzligcurl" width="1200" lsb="77"/>
<mtx name="emptyset" width="1200" lsb="214"/>
<mtx name="f_f" width="1200" lsb="66"/>
<mtx name="f_f_i" width="1200" lsb="56"/>
<mtx name="f_f_l" width="1200" lsb="56"/>
<mtx name="f_i" width="1200" lsb="66"/>
<mtx name="f_l" width="1200" lsb="66"/>
<mtx name="fiveeighths" width="1200" lsb="160"/>
<mtx name="oneeighth" width="1200" lsb="148"/>
<mtx name="s_t" width="1200" lsb="105"/>
<mtx name="seveneighths" width="1200" lsb="165"/>
<mtx name="symbolforsamaritansource" width="1200" lsb="70"/>
<mtx name="tcligcurl" width="1200" lsb="56"/>
<mtx name="threeeighths" width="1200" lsb="155"/>
<mtx name="u1F67C" width="1200" lsb="41"/>
<mtx name="u1F67D" width="1200" lsb="41"/>
<mtx name="u1F67E" width="1200" lsb="0"/>
<mtx name="u1F67F" width="1200" lsb="0"/>
<mtx name="uni01A2" width="1200" lsb="88"/>
<mtx name="uni01C4" width="1200" lsb="114"/>
<mtx name="uni01C5" width="1200" lsb="70"/>
<mtx name="uni01C6" width="1200" lsb="55"/>
<mtx name="uni01C7" width="1200" lsb="115"/>
<mtx name="uni01C8" width="1200" lsb="115"/>
<mtx name="uni01C9" width="1200" lsb="80"/>
<mtx name="uni01CA" width="1200" lsb="70"/>
<mtx name="uni01CB" width="1200" lsb="70"/>
<mtx name="uni01CC" width="1200" lsb="80"/>
<mtx name="uni01F1" width="1200" lsb="114"/>
<mtx name="uni01F2" width="1200" lsb="70"/>
<mtx name="uni01F3" width="1200" lsb="55"/>
<mtx name="uni0468" width="1200" lsb="160"/>
<mtx name="uni046C" width="1200" lsb="137"/>
<mtx name="uni046D" width="1200" lsb="145"/>
<mtx name="uni0478" width="1200" lsb="45"/>
<mtx name="uni0479" width="1200" lsb="55"/>
<mtx name="uni0518" width="1200" lsb="118"/>
<mtx name="uni0520" width="1200" lsb="79"/>
<mtx name="uni0521" width="1200" lsb="94"/>
<mtx name="uni0522" width="1200" lsb="203"/>
<mtx name="uni0523" width="1200" lsb="189"/>
<mtx name="uni052A" width="1200" lsb="20"/>
<mtx name="uni052B" width="1200" lsb="59"/>
<mtx name="uni1D7A" width="1200" lsb="56"/>
<mtx name="uni1F0A" width="1200" lsb="243"/>
<mtx name="uni1F0B" width="1200" lsb="210"/>
<mtx name="uni1F0C" width="1200" lsb="230"/>
<mtx name="uni1F0D" width="1200" lsb="230"/>
<mtx name="uni1F0E" width="1200" lsb="204"/>
<mtx name="uni1F0F" width="1200" lsb="188"/>
<mtx name="uni1F1A" width="1200" lsb="238"/>
<mtx name="uni1F1B" width="1200" lsb="229"/>
<mtx name="uni1F1C" width="1200" lsb="241"/>
<mtx name="uni1F1D" width="1200" lsb="225"/>
<mtx name="uni1F2A" width="1200" lsb="170"/>
<mtx name="uni1F2B" width="1200" lsb="167"/>
<mtx name="uni1F2C" width="1200" lsb="166"/>
<mtx name="uni1F2D" width="1200" lsb="169"/>
<mtx name="uni1F2E" width="1200" lsb="128"/>
<mtx name="uni1F2F" width="1200" lsb="132"/>
<mtx name="uni1F4A" width="1200" lsb="174"/>
<mtx name="uni1F4B" width="1200" lsb="165"/>
<mtx name="uni1F4C" width="1200" lsb="198"/>
<mtx name="uni1F4D" width="1200" lsb="195"/>
<mtx name="uni1F5B" width="1200" lsb="163"/>
<mtx name="uni1F5D" width="1200" lsb="165"/>
<mtx name="uni1F5F" width="1200" lsb="128"/>
<mtx name="uni1F6A" width="1200" lsb="138"/>
<mtx name="uni1F6B" width="1200" lsb="141"/>
<mtx name="uni1F6C" width="1200" lsb="164"/>
<mtx name="uni1F6D" width="1200" lsb="170"/>
<mtx name="uni1F6E" width="1200" lsb="124"/>
<mtx name="uni1F6F" width="1200" lsb="126"/>
<mtx name="uni1F88" width="1200" lsb="106"/>
<mtx name="uni1F89" width="1200" lsb="94"/>
<mtx name="uni1F8A" width="1200" lsb="-9"/>
<mtx name="uni1F8B" width="1200" lsb="5"/>
<mtx name="uni1F8C" width="1200" lsb="33"/>
<mtx name="uni1F8D" width="1200" lsb="28"/>
<mtx name="uni1F8E" width="1200" lsb="5"/>
<mtx name="uni1F8F" width="1200" lsb="5"/>
<mtx name="uni1F98" width="1200" lsb="13"/>
<mtx name="uni1F99" width="1200" lsb="37"/>
<mtx name="uni1F9A" width="1200" lsb="-36"/>
<mtx name="uni1F9B" width="1200" lsb="-37"/>
<mtx name="uni1F9C" width="1200" lsb="-39"/>
<mtx name="uni1F9D" width="1200" lsb="-39"/>
<mtx name="uni1F9E" width="1200" lsb="-88"/>
<mtx name="uni1F9F" width="1200" lsb="-93"/>
<mtx name="uni1FA8" width="1200" lsb="77"/>
<mtx name="uni1FA9" width="1200" lsb="48"/>
<mtx name="uni1FAA" width="1200" lsb="-17"/>
<mtx name="uni1FAB" width="1200" lsb="-11"/>
<mtx name="uni1FAC" width="1200" lsb="4"/>
<mtx name="uni1FAD" width="1200" lsb="6"/>
<mtx name="uni1FAE" width="1200" lsb="-2"/>
<mtx name="uni1FAF" width="1200" lsb="-13"/>
<mtx name="uni1FBC" width="1200" lsb="219"/>
<mtx name="uni1FCC" width="1200" lsb="245"/>
<mtx name="uni1FFC" width="1200" lsb="236"/>
<mtx name="uni203B" width="1200" lsb="231"/>
<mtx name="uni2042" width="1200" lsb="79"/>
<mtx name="uni2047" width="1200" lsb="130"/>
<mtx name="uni2053" width="1200" lsb="128"/>
<mtx name="uni2057" width="1200" lsb="235"/>
<mtx name="uni20A8" width="1200" lsb="95"/>
<mtx name="uni20B7" width="1200" lsb="128"/>
<mtx name="uni2103" width="1200" lsb="161"/>
<mtx name="uni2109" width="1200" lsb="137"/>
<mtx name="uni210B" width="1200" lsb="56"/>
<mtx name="uni2110" width="1200" lsb="146"/>
<mtx name="uni2112" width="1200" lsb="152"/>
<mtx name="uni2114" width="1200" lsb="90"/>
<mtx name="uni211B" width="1200" lsb="132"/>
<mtx name="uni212C" width="1200" lsb="118"/>
<mtx name="uni2131" width="1200" lsb="88"/>
<mtx name="uni2133" width="1200" lsb="21"/>
<mtx name="uni2150" width="1200" lsb="148"/>
<mtx name="uni2151" width="1200" lsb="148"/>
<mtx name="uni2153" width="1200" lsb="148"/>
<mtx name="uni2154" width="1200" lsb="155"/>
<mtx name="uni2155" width="1200" lsb="148"/>
<mtx name="uni2156" width="1200" lsb="155"/>
<mtx name="uni2157" width="1200" lsb="155"/>
<mtx name="uni2158" width="1200" lsb="130"/>
<mtx name="uni2159" width="1200" lsb="148"/>
<mtx name="uni215A" width="1200" lsb="160"/>
<mtx name="uni2189" width="1200" lsb="135"/>
<mtx name="uni219C" width="1200" lsb="308"/>
<mtx name="uni219D" width="1200" lsb="308"/>
<mtx name="uni219E" width="1200" lsb="304"/>
<mtx name="uni21A0" width="1200" lsb="304"/>
<mtx name="uni21A2" width="1200" lsb="304"/>
<mtx name="uni21A3" width="1200" lsb="304"/>
<mtx name="uni21A4" width="1200" lsb="304"/>
<mtx name="uni21A6" width="1200" lsb="304"/>
<mtx name="uni21DA" width="1200" lsb="304"/>
<mtx name="uni21DB" width="1200" lsb="304"/>
<mtx name="uni21E6" width="1200" lsb="304"/>
<mtx name="uni21E8" width="1200" lsb="304"/>
<mtx name="uni2296" width="1200" lsb="253"/>
<mtx name="uni2298" width="1200" lsb="253"/>
<mtx name="uni2299" width="1200" lsb="253"/>
<mtx name="uni229A" width="1200" lsb="253"/>
<mtx name="uni229B" width="1200" lsb="253"/>
<mtx name="uni229C" width="1200" lsb="253"/>
<mtx name="uni233D" width="1200" lsb="265"/>
<mtx name="uni233E" width="1200" lsb="265"/>
<mtx name="uni2349" width="1200" lsb="265"/>
<mtx name="uni235A" width="1200" lsb="220"/>
<mtx name="uni235C" width="1200" lsb="264"/>
<mtx name="uni235D" width="1200" lsb="303"/>
<mtx name="uni235F" width="1200" lsb="265"/>
<mtx name="uni2365" width="1200" lsb="265"/>
<mtx name="uni2366" width="1200" lsb="309"/>
<mtx name="uni2367" width="1200" lsb="237"/>
<mtx name="uni236B" width="1200" lsb="263"/>
<mtx name="uni236C" width="1200" lsb="263"/>
<mtx name="uni236D" width="1200" lsb="263"/>
<mtx name="uni2371" width="1200" lsb="264"/>
<mtx name="uni2372" width="1200" lsb="264"/>
<mtx name="uni2474" width="1200" lsb="100"/>
<mtx name="uni2475" width="1200" lsb="100"/>
<mtx name="uni25A2" width="1200" lsb="301"/>
<mtx name="uni25A3" width="1200" lsb="301"/>
<mtx name="uni25A4" width="1200" lsb="301"/>
<mtx name="uni25A5" width="1200" lsb="301"/>
<mtx name="uni25A6" width="1200" lsb="301"/>
<mtx name="uni25A7" width="1200" lsb="301"/>
<mtx name="uni25A8" width="1200" lsb="301"/>
<mtx name="uni25A9" width="1200" lsb="301"/>
<mtx name="uni25AD" width="1200" lsb="100"/>
<mtx name="uni25B0" width="1200" lsb="103"/>
<mtx name="uni25B1" width="1200" lsb="103"/>
<mtx name="uni25B3" width="1200" lsb="308"/>
<mtx name="uni25B6" width="1200" lsb="308"/>
<mtx name="uni25B7" width="1200" lsb="308"/>
<mtx name="uni25BB" width="1200" lsb="284"/>
<mtx name="uni25BD" width="1200" lsb="308"/>
<mtx name="uni25C0" width="1200" lsb="301"/>
<mtx name="uni25C1" width="1200" lsb="308"/>
<mtx name="uni25C5" width="1200" lsb="285"/>
<mtx name="uni25C6" width="1200" lsb="300"/>
<mtx name="uni25C7" width="1200" lsb="300"/>
<mtx name="uni25C8" width="1200" lsb="300"/>
<mtx name="uni25CD" width="1200" lsb="149"/>
<mtx name="uni25E2" width="1200" lsb="301"/>
<mtx name="uni25E3" width="1200" lsb="301"/>
<mtx name="uni25E4" width="1200" lsb="301"/>
<mtx name="uni25E5" width="1200" lsb="301"/>
<mtx name="uni25E7" width="1200" lsb="301"/>
<mtx name="uni25E8" width="1200" lsb="301"/>
<mtx name="uni25E9" width="1200" lsb="301"/>
<mtx name="uni25EA" width="1200" lsb="301"/>
<mtx name="uni25EB" width="1200" lsb="301"/>
<mtx name="uni25EC" width="1200" lsb="308"/>
<mtx name="uni25ED" width="1200" lsb="308"/>
<mtx name="uni25EE" width="1200" lsb="308"/>
<mtx name="uni25EF" width="1200" lsb="230"/>
<mtx name="uni25F0" width="1200" lsb="301"/>
<mtx name="uni25F1" width="1200" lsb="301"/>
<mtx name="uni25F2" width="1200" lsb="301"/>
<mtx name="uni25F3" width="1200" lsb="301"/>
<mtx name="uni2736" width="1200" lsb="256"/>
<mtx name="uni27D5" width="1200" lsb="181"/>
<mtx name="uni27D6" width="1200" lsb="181"/>
<mtx name="uni27D7" width="1200" lsb="81"/>
<mtx name="uni27F5" width="1200" lsb="26"/>
<mtx name="uni27F6" width="1200" lsb="26"/>
<mtx name="uni29B8" width="1200" lsb="253"/>
<mtx name="uni2A00" width="1200" lsb="214"/>
<mtx name="uni2E3A" width="1200" lsb="0"/>
<mtx name="uniA656" width="1200" lsb="160"/>
<mtx name="uniA657" width="1200" lsb="191"/>
<mtx name="uniA65C" width="1200" lsb="160"/>
<mtx name="uniA65D" width="1200" lsb="211"/>
<mtx name="uniA666" width="1200" lsb="97"/>
<mtx name="uniA667" width="1200" lsb="151"/>
<mtx name="uniA66C" width="1200" lsb="130"/>
<mtx name="uniA66D" width="1200" lsb="152"/>
<mtx name="uniA684" width="1200" lsb="64"/>
<mtx name="uniA698" width="1200" lsb="132"/>
<mtx name="uniA699" width="1200" lsb="154"/>
<mtx name="uniA728" width="1200" lsb="133"/>
<mtx name="uniA729" width="1200" lsb="56"/>
<mtx name="uniA732" width="1200" lsb="56"/>
<mtx name="uniA734" width="1200" lsb="99"/>
<mtx name="uniA736" width="1200" lsb="151"/>
<mtx name="uniA738" width="1200" lsb="176"/>
<mtx name="uniA73A" width="1200" lsb="196"/>
<mtx name="uniA73C" width="1200" lsb="176"/>
<mtx name="uniA74E" width="1200" lsb="132"/>
<mtx name="uniA74F" width="1200" lsb="154"/>
<mtx name="uniA773" width="1200" lsb="80"/>
<mtx name="uniA7FF" width="1200" lsb="20"/>
<mtx name="uniFFFC" width="1200" lsb="136"/>
<mtx name="uniFFFD" width="1200" lsb="141"/>
<mtx name="weierstrass" width="1200" lsb="219"/>

@marekjez86
Copy link

marekjez86 commented Aug 2, 2018

width 1800:

<mtx name="uni2031" width="1800" lsb="67"/>
<mtx name="uni213B" width="1800" lsb="95"/>
<mtx name="uni2152" width="1800" lsb="248"/>
<mtx name="uni23DC" width="1800" lsb="60"/>
<mtx name="uni23DD" width="1800" lsb="60"/>
<mtx name="uni23DE" width="1800" lsb="60"/>
<mtx name="uni23DF" width="1800" lsb="60"/>
<mtx name="uni23E0" width="1800" lsb="60"/>
<mtx name="uni23E1" width="1800" lsb="60"/>
<mtx name="uni2E3B" width="1800" lsb="0"/>

@LionNatsu
Copy link

Should there be an "FC_MULTIPLE" spacing?

I proposed this on Fontconfig's repository.
https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/176

@kozross
Copy link

kozross commented Oct 9, 2019

So... it's been close to eight months. Anything happening with this bug?

@behdad
Copy link

behdad commented Oct 9, 2019

No.

@tadly
Copy link

tadly commented Oct 9, 2019

@kozross just go use something else.
Anything google is notorious for taking literally years to fix (sorry for the rant but facts are facts)

Use FiraCode or checkout the new and open-sourced font from microsoft, Cascadia Code or something completely different...

@ariasuni
Copy link

ariasuni commented Oct 9, 2019

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.

@marekjez86 marekjez86 added the help wanted Extra attention is needed label Oct 9, 2019
@marekjez86
Copy link

marekjez86 commented Oct 10, 2019

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 ????

@marekjez86
Copy link

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.

@polarathene
Copy link

Why is NotoSans-Regular.ttf at the top of the list? I ended up here by noticing that code snippets in firefox were rendering in a non-monospaced font, and in fact specifically as Noto Sans Regular. This is odd given that NotoSansMono-Regular.ttf is clearly available on the system.

@masaeedu

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 49-sansserif.conf file which runs before any user configs(50-user.conf), so any font not assigned a generic family ends up as sans-serif and configs after that point will respond to sans-serif rules instead of monospace. Your Noto fonts, if they have configs at all, may be like Arch and assign the generic family too late(only relevant to fallbacks from specified font, not when application is set to use generic font family which should work fine if you have a config for it).

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, monospace as a generic font family, is not the same as :spacing=100 when you want to search for fonts that fontconfig identifies as true monospace compatible fonts(all same width glyphs within the font, as mentioned earlier in the thread). You can assign a spacing value to 100 to enforce this, and this is the suggested advice in Kitty's FAQ page, fc-match will work with that, but fc-list does not appear to(just looks at the fonts directly instead of going through configs I assume). For more info, see my post here.


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?

@polarathene
Copy link

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:

Noto Sans Mono is a replacement and not just an update. The entire build process is different. Some glyphs will change. We do not have a comprehensive description of the differences.


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 g, Noto Mono and Noto Sans Mono have related differences like that.

@ariasuni
Copy link

ariasuni commented Oct 18, 2019

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).

@kozross
Copy link

kozross commented Oct 18, 2019

(I think about Arch Linux users using the official package)

[points to self]

@absolutelynothelix
Copy link

~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 fc-list : family spacing | grep spacing still shows only few fonts not from noto family

@tagoh
Copy link

tagoh commented Oct 21, 2019

You have to run fc-cache -f to take effect.

@absolutelynothelix
Copy link

absolutelynothelix commented Oct 21, 2019

@tagoh, still doesn't seem to be helpful, here is my exact ~/.config/fontconfig/fonts.conf

<?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 fc-cache -f (even fc-cache -fr) fc-list : family spacing | grep spacing still doesn't show noto sans mono

@tagoh
Copy link

tagoh commented Oct 21, 2019

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.

@tagoh
Copy link

tagoh commented Oct 21, 2019

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.

@absolutelynothelix
Copy link

absolutelynothelix commented Oct 21, 2019

@tagoh, i've removed the .cache folder in my home directory (actually, removing the .cache/fontconfig should be enough but idc), run fc-cache -fr, but still no luck

@tagoh
Copy link

tagoh commented Oct 21, 2019

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.

@absolutelynothelix
Copy link

absolutelynothelix commented Oct 21, 2019

@tagoh, jesus christ, it finally works and looks like you are right. i found second fontconfig cache in /var/cache/fontconfig (exactly where you pointed me above), i tried to search for it with locate before posting my previous message, but with no luck, looks like locate is hiding either not indexing /var/ folder. i also duplicated this config into the /root/.config/fontconfig/fonts.conf (it's seems more like a workaround because in this case i guess i should place it into /etc/fontconfig). thank you!

@polarathene
Copy link

@tagoh Thanks for this, I have been trying to debug some weirdness in behaviour, where the fc-cache -fr(with/without sudo) made no difference, but other fontconfig changes to seem to have an affect.

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 ~/.cache/fontconfig. I guess the -r flag for fc-cache doesn't do what it claims to...:

-r, --really-force erase all existing caches, then rescan

Apparently, also doing fc-match queries was adding a new file to the cache each time, even if nothing changes.. Firefox would add 4 cache files each time it's opened, and 1 new cache file per tab(process?).

@simoncozens
Copy link
Contributor

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.

@simoncozens simoncozens closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests