You are not logged in.

#1 2017-09-15 13:35:48

nmiculinic
Member
Registered: 2015-12-25
Posts: 63

Chrome on github doesn't use monospace font

I have Google Chrome 61.0.3163.79 and am using it to browse the internet. On github, when I'm reviewing pull requests it is displayed in some generic font, instead of monospaced one, which obviously messes things up for programming code. Never before had I had such a problem. How do I debug it even?

I've tried changing the default chrome monospace font to Hack (which is installed on my machine), but to no avail.

I'm using i3wm. (Also maybe unrelated/kinda related I have font issues with polybar and font-awesome and that special gliphs, but that's another bag of worms)

Offline

#2 2017-09-15 15:24:37

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: Chrome on github doesn't use monospace font

What does "fc-match monospace" say?
Also, if you do not have dejavu fonts, please install them. That makes a lot of headaches go away (especially for less experienced users).

Offline

#3 2017-09-18 12:41:05

nmiculinic
Member
Registered: 2015-12-25
Posts: 63

Re: Chrome on github doesn't use monospace font

~ fc-match monospace                                                                                                                                               G master[2W] d82ab32 ⭑ - ?
NotoMono-Regular.ttf: "Noto Mono" "Regular"


Also I already have installed ttf-dejavu

Offline

#4 2017-09-18 20:27:29

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

Re: Chrome on github doesn't use monospace font

*only* github?
Got stylish or tampermonkey?
Did you try the web inspector to see what font is resolved how?

Offline

#5 2017-09-19 08:12:00

nmiculinic
Member
Registered: 2015-12-25
Posts: 63

Re: Chrome on github doesn't use monospace font

Actually, I think it's more spread after all github is the site I predominantly use with monospace fonts.

From devtools screenshot:
https://i.imgur.com/h6h6ahN.png

I'm not sure how to find out what font resolved to which one.

Offline

#6 2017-09-19 14:18:16

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: Chrome on github doesn't use monospace font

The font in both the devtools area and the webpage looks like monospace to me. I am not able to see the problem here.

For font name resolution, just use the fc-match command.

Offline

#7 2017-09-19 14:24:29

nmiculinic
Member
Registered: 2015-12-25
Posts: 63

Re: Chrome on github doesn't use monospace font

https://i.imgur.com/dXbEIFI.png

This isn't monospace; I'm using 4 spaces indentation and I can clearly see the difference on my friend's laptop.

Offline

#8 2017-09-19 18:14:19

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

Re: Chrome on github doesn't use monospace font

I think adesh mistook the left strip on your first shot as the webpage.
Try to fc-match any of the tested fonts - I'd say at least "Courier" should hit some installed monospace before "monospace" is resolved.
Also try installing consolas - and what does this look like?

iiiiii
WWWWWW

Offline

#9 2017-09-21 07:55:10

nmiculinic
Member
Registered: 2015-12-25
Posts: 63

Re: Chrome on github doesn't use monospace font

 ~ fc-match SFMono-Regular                                          G master[3W] d82ab32 ⭑ - ?
NotoSans-Regular.ttc: "Noto Sans" "Regular"
 ~ fc-match Consolas                                                G master[3W] d82ab32 ⭑ - ?
NotoSans-Regular.ttc: "Noto Sans" "Regular"
 ~ fc-match "Liberation Mono"                                       G master[3W] d82ab32 ⭑ - ?
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
 ~ fc-match Menlo                                                   G master[3W] d82ab32 ⭑ - ?
NotoSans-Regular.ttc: "Noto Sans" "Regular"
 ~ fc-match Courier                                                 G master[3W] d82ab32 ⭑ - ?
NimbusMonoPS-Regular.otf: "Nimbus Mono PS" "Regular"
 ~ fc-match monospace                                               G master[3W] d82ab32 ⭑ - ?
NotoMono-Regular.ttf: "Noto Mono" "Regular"

Ok, it appears SFMono-Regular resolves to Noto Sans, not a Monospace font. How do I fix it?

Offline

#10 2017-09-21 08:11:37

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

Re: Chrome on github doesn't use monospace font

So does "Menlo", that's not a problem per se, because the browser should™ understand that this font isn't provided and try the next family.
Although the fallback font here is DejaVu (and has always been) - maybe chrome relies on that? Do you still have dejavu installed?

What about the "code" blocks on this page? Monospaced?

Offline

#11 2018-03-31 16:45:33

Shinto
Member
Registered: 2012-07-27
Posts: 78

Re: Chrome on github doesn't use monospace font

I don't want to necro post, but I have the same issue.
On all Chromium browsers on sites like Github or Phabricator where SFMono-Regular is requested, Noto Sans is being used instead.

Any idea? Maybe somehow remapping SFMono-Regular to a monospace font?

$ fc-match SFMono-Regular
NotoSans-Regular.ttc: "Noto Sans" "Regular"

Offline

#12 2018-03-31 19:24:20

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

Re: Chrome on github doesn't use monospace font

Github should be using

"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;

(inspect the element)
Since "SFMono-Regular" is apparently not installed, it should resort to Consolas (does for me, chromium), "Liberation Mono", Menlo, Courier and ultimately monospace.

fc-match Consolas
fc-match "Liberation Mono"
fc-match Menlo
fc-match Courier
fc-match monospace

You could of course add a rule that maps "SFMono-Regular" to some monospace font, but that's besides the point - the browser should not use it.

Offline

#13 2018-03-31 21:58:27

Shinto
Member
Registered: 2012-07-27
Posts: 78

Re: Chrome on github doesn't use monospace font

Thanks for the response.

I don't have Consolas installed. fc-match says

$ fc-match Consolas
NotoSans-Regular.ttc: "Noto Sans" "Regular"

$ fc-match "Liberation Mono"
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"

It obviously should fall back to Liberation Mono. But it seems like it uses Noto Sans as a fallback instead of going to the next in line. How does Firefox not have this problem?

Offline

#14 2018-04-01 19:43:15

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

Re: Chrome on github doesn't use monospace font

No idea, notably since it doesn't occur here at all.
Did you check the web inspector on whether actually a list of fonts is computed? Or is SFMono-Regular the only one?

Offline

#15 2018-04-02 09:40:57

Shinto
Member
Registered: 2012-07-27
Posts: 78

Re: Chrome on github doesn't use monospace font

seth wrote:

No idea, notably since it doesn't occur here at all.
Did you check the web inspector on whether actually a list of fonts is computed? Or is SFMono-Regular the only one?

Yes, see:
https://i.imgur.com/DQ5sOzz.png

Offline

Board footer

Powered by FluxBB