You are not logged in.

#1 2013-05-04 03:28:36

a_neutrino
Member
From: Montreal, Canada
Registered: 2010-03-14
Posts: 50
Website

[solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

Hello,

I am observing strange font rendering in Firefox when text is displayed in the Nimbus Sans L font-family. For example, the selected font on duckduckgo.com is Nimbus Sans L on my machine. Any query result that contains "No" or "TM", inluding inside words such as Notebook or HTML will be substituted for № and ™, or №tebook and H™L. This is a nuisance. It does not happen in LibreOffice with the same font and the same text.

Using Firefox's web console, I edited the CSS and took the following screenshots. On the left is the CSS left alone, and on the right, I removed Nimbus Sans L from the font-family property:

2013_05_03_Nimbus_Sans_problem.jpg

I also wrote this test html file and rendered it in Firefox.

<!DOCTYPE html>
<html>
<head>
    <title>Font test</title>
    <style type="text/css">
        p {
            font-family: "Nimbus Sans L";
            }
        p.a {
            font-family: FreeSans;
            }
    </style>
</head>
<body>
    <p>A test</p>
    <p>No Note HTML</p>
    <p class="a">No Note HTML</p>
</body>
</html>

<screenshot>
2013_05_03_Font_test.png
</screenshot>

I ran out of hypotheses. I haven't found anything helpful in:

Thank you for any support and have a good day.

Alexandre.

Last edited by a_neutrino (2013-05-06 04:54:24)

Offline

#2 2013-05-04 08:45:47

sistematico
Member
From: Campo Grande / MS / Brasil
Registered: 2008-07-26
Posts: 73
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox


Lucas Saliés Brum
blog | medium | vk | twitter | github | .share
Forgive the spelling and grammar, English is not my native language.

Offline

#3 2013-05-04 09:09:12

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

Does this happen to ligature (e.g. ff, fi, fl, ae, etc.) as well?


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#4 2013-05-04 15:07:41

a_neutrino
Member
From: Montreal, Canada
Registered: 2010-03-14
Posts: 50
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

Thank you for your input.

The sub-pixel rendering is fine. It's rather the automatic replacement of glyphs in the wrong context that is bothering.

bohoomil wrote:

Does this happen to ligature (e.g. ff, fi, fl, ae, etc.) as well?

Interestingly, ligatures are happening automatically with FreeSans for ff, ffl and such, but not ae or oe. There was no such ligatures with Nimbus Sans L.

<!DOCTYPE html>
<html>
<head>
    <title>Font test</title>
    <style type="text/css">
        p {
            font-family: "Nimbus Sans L";
            }
        p.freesans {
            font-family: FreeSans;
            }
    </style>
</head>
<body>
    <p>Affidavit, Notebook, HTML, ex aequo, oeil</p>
    <p class="freesans">Affidavit, Notebook, HTML, ex aequo, oeil</p>
    <p class="freesans" style="font-size: 2em;">Affidavit</p>
</body>
</html>

2013_05_04_Nimbus_Sans_L_ffi_ligature.png

Does this help narrow it down?

Offline

#5 2013-05-04 19:33:25

brebs
Member
Registered: 2007-04-03
Posts: 3,401

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

Try downgrading to harfbuzz 0.9.13?

I mention 0.9.13 because it's the version in Raring, so should have had a reasonable amount of testing.

Offline

#6 2013-05-04 19:39:42

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

a_neutrino wrote:

Does this help narrow it down?

A bit: Nimbus Sans L is a T1 font (*.pfb), Free Font is TTF.

Have you got a symlink to /etc/fonts/conf.avail/30-metric-aliases.conf in /etc/fonts/conf.d?

Last edited by bohoomil (2013-05-04 19:53:03)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#7 2013-05-05 14:56:57

a_neutrino
Member
From: Montreal, Canada
Registered: 2010-03-14
Posts: 50
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

bohoomil wrote:

Have you got a symlink to /etc/fonts/conf.avail/30-metric-aliases.conf in /etc/fonts/conf.d?

Yes. This symlinked file contains :

<!-- Map specifics to generics -->

	<!-- PostScript -->
	<alias binding="same">
	  <family>Nimbus Sans L</family>
	  <default>
	  <family>Helvetica</family>
	  </default>
	</alias>

Then later :

<!-- Map generics to specifics -->

	<!-- PostScript -->
	<alias binding="same">
	  <family>Helvetica</family>
	  <accept>
	  <family>Nimbus Sans L</family>
	  </accept>
	</alias>

I ain't sure what to interpret from this. I don't have Helvetica installed.

Offline

#8 2013-05-05 21:20:03

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

This has nothing to do with Helvetica being installed -- I was just thinking about something else, sorry.

Anyway, two things I've been pondering about since I saw the example you provided:

1. Are you using any autocomplete / autotext add-ons / plugins / shortcuts / keyboard layouts with either FF or system wide that would become active for Nimbus Sans L and not any other font face (at least FreeSans)? The fact that ligatures are not displayed with Nimbus while abbrevs are turned into symbols (as opposed to FreeSans) may indicate this. (Nimbus T1 has ligatures coded into as far as I can tell.) As the problem doesn't seem to occur with other applications (you mentioned LibreOffice behaving properly), try temporarily renaming .mozilla directory into .mozilla.bkp and see if FF with a clean profile acts differently. (Some desktop environments can automatically switch to a different keyboard layout for a particular application, so before proceding make sure nothing like that happens in your case.)

2. The problem may be related only to PostScript fonts and not to TTF/OTF ones in general. In such a case, fontconfig may be responsible for things to act this way. A bit rough way to check if this is the case: temporarily rename /etc/fonts/conf.d into /etc/fonts/conf.d.bkp and check if anything has changed. However, I'm not quite sure which sort of fontconfig settings could be involved. Going even further you may try reinstalling both fontconfig and psfonts in case there is really something wrong with any of them.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#9 2013-05-06 01:45:31

a_neutrino
Member
From: Montreal, Canada
Registered: 2010-03-14
Posts: 50
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

brebs wrote:

Try downgrading to harfbuzz 0.9.13?

I tried downgrading to both 0.9.9 and 0.9.13, but there was no improvement/change.

Offline

#10 2013-05-06 04:48:47

a_neutrino
Member
From: Montreal, Canada
Registered: 2010-03-14
Posts: 50
Website

Re: [solved] Bad glyph alternates using "Nimbus Sans L" font in Firefox

Hi bohoomil,

Thank you for helping me troubleshoot. It turns out to be my fault.

A few months ago, I was researching why Type 1 fonts from gsfonts weren't available in my applications. I used this trick to make a custom PKGBUILD of gsfonts that creates copies of the Type 1 fonts in TTF format using a small fontforge script. Since doing this, I could use the Type 1 fonts but they were actually TTF, and I they were possibly broken because I have shallow technical knowledge of what I was doing.

I removed my custom "ttf-gsfonts" package and reinstalled ArchLinux's official gsfonts. Now, duckduckgo.com displayed correctly, although not in Nimbus Sans L, but rather in FreeSans — the next available font in the CSS font-family property. My test page is displayed in my browser's default font, TeX Gyre Schola, where Nimbus Sans L is expected.

Also, Type 1 fonts from gsfonts are no longer available in my applications. Now I have to go back to my original problem although it's a completely different topic.

One last clarification before closing: I know that LibreOffice has it's own font rendering engine. This may explain the different behavior. When I tried writing in Nimbus Sans L in Inkscape, I saw the same thing as in Firefox. But I'd rather not have the font than use a broken one.

Offline

Board footer

Powered by FluxBB