You are not logged in.

#1 2017-03-08 15:34:13

xiver77
Member
Registered: 2017-03-08
Posts: 3

noto-fonts installation aliases "monospace" font wrong

Whenever I install the noto-fonts package via pacman, the "monospace" alias gets configured wrong to a regular font instead of a mono-spaced font.

The problem shows whenever I load a website using monospace fonts, where they are displayed as a normal sans-serif. A bigger problem shows when I load a web editor which expects the font to be monospace while it actually is not fixed sized, where the cursor does not match with the text. Similar thing also happens when I open a gtk-based terminal emulator instead of xterm, in which case the font does not match the space (kind of hard to explain in words).

You can check that the noto-fonts package has a problem as follows.

1. Make a clean Arch installation.
2. (sudo) pacman -S xorg xorg-drivers
3. (sudo) pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji
4. fc-match monospace
5. The above will output: NotoSans-Recular.ttc "Noto Sans" "Regular"
6. (sudo) pacman -S ttf-dejavu
7. fc-match monospace
8. The above will output: DejavuSansMono.ttf: "DejaVu Sans Mono" "Book"

You can see number 5 is clearly wrong. When you install noto-fonts, the monospace alias is aliased to a variable width "Sans" font, unlike ttf-dejavu which handles the alias as expected to a "Mono"-spaced font.

(Writing the following in a later edit) seth has pointed out that:

a) Noto (unlike eg. the Droid family) does not come with an fontconfig snippet that aliases its Mono variant with the "monospace" and
b) fontconfigs 45-latin.conf doesn't cover Noto (unlike several other well known monospace fonts)

The result is that you have no font that matches "monospace" before installing dejavu - file a bug against either noto or fonctconfig to provide aliases (or help yourself and add them)

Last edited by xiver77 (2017-03-14 05:18:17)

Offline

#2 2017-03-08 17:05:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: noto-fonts installation aliases "monospace" font wrong

I've not had problems like this.  Can you post the output of the following when the wrong font is used:

fc-match monospace

Also, if there are times when the font is working properly, the output of the above command again would be useful for comparison.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#3 2017-03-09 13:21:24

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: noto-fonts installation aliases "monospace" font wrong

[root@mypc gl]# fc-match monospace
NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular"

So it's wrong, because my monospace fonts should be dejavu sans mono (for english) and Noto Sans Mono CJK JP (for CJK fonts).
My locale is zh_CN.UTF-8, I doubt any locales other than English will find wrong mono space fonts.  Don't know how to fix it though.

Offline

#4 2017-03-09 13:57:42

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: noto-fonts installation aliases "monospace" font wrong

I have a file "/etc/fonts/conf.d/51-font-alias.conf" where I configure "monospace", "sans-serif" and "serif". You can make a list of fonts that will be searched for missing characters. I think what you asked for would look like this:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

  <alias>
    <family>monospace</family>
    <prefer>
      <family>DejaVu Sans Mono</family>
      <family>Noto Sans CJK JP</family>
    </prefer>
  </alias>

</fontconfig>

Offline

#5 2017-03-10 01:30:36

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: noto-fonts installation aliases "monospace" font wrong

Yes, it works, thank you.

Offline

#6 2017-03-13 13:42:20

xiver77
Member
Registered: 2017-03-08
Posts: 3

Re: noto-fonts installation aliases "monospace" font wrong

Sorry for my late response, but I found an exact way to reproduce this probable bug.

1. Make a clean Arch installation.
2. (sudo) pacman -S xorg xorg-drivers
3. (sudo) pacman -S noto-fonts noto-fonts-cjk noto-fonts-emoji
4. fc-match monospace
5. The above will output: NotoSans-Recular.ttc "Noto Sans" "Regular"
6. (sudo) pacman -S ttf-dejavu
7. fc-match monospace
8. The above will output: DejavuSansMono.ttf: "DejaVu Sans Mono" "Book"

You can see number 5 is clearly wrong. I think something may be wrong with the noto fonts package.

Offline

#7 2017-03-13 13:47:31

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: noto-fonts installation aliases "monospace" font wrong

And what, exactly, did you expect it to find in #5?

Offline

#8 2017-03-13 14:28:24

xiver77
Member
Registered: 2017-03-08
Posts: 3

Re: noto-fonts installation aliases "monospace" font wrong

Scimmia wrote:

And what, exactly, did you expect it to find in #5?

I'm not sure if I really need to explain further, but as you requested, the noto-fonts package installs serif, sans-serif, and monospace variants of Google Noto fonts. The same applies for the ttf-dejavu package. When you install noto-fonts, the monospace alias is aliased to a variable width "Sans" font, unlike ttf-dejavu which handles the alias as expected to a "Mono"-spaced font. Thus the expected output of #5 should contain "NotoMono".

Last edited by xiver77 (2017-03-13 14:30:19)

Offline

#9 2017-03-13 18:02:11

seth
Member
Registered: 2012-09-03
Posts: 51,038

Re: noto-fonts installation aliases "monospace" font wrong

The reason is that
a) Noto (unlike eg. the Droid family) does not come with an fontconfig snippet that aliases its Mono variant with the "monospace" and
b) fontconfigs 45-latin.conf doesn't cover Noto (unlike several other well known monospace fonts)

The result is that you have no font that matches "monospace" before installing dejavu - file a bug against either noto or fonctconfig to provide aliases (or help yourself and add them)

Reading that from the OP is close to impossible, so you might want to clarify the issue in your initial post.

Online

#10 2017-03-13 18:05:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: noto-fonts installation aliases "monospace" font wrong

Is the follow from your first post no longer true?

xiver77 wrote:

Whenever I install a font package via pacman, such as noto-fonts, ttf-dejavu, ttf-droid etc., the "monospace" alias gets configured wrong to a regular font instead of a mono-spaced font.

You are not suggesting that installing ttf-dejavu works fine - and I'd guess ttf-droid, and most "etc." do as well.  The problem seems to be only with noto fonts for which the solution options are as Seth describes.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB