Browser Font Issue: 9 replaced by dash

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
JoeInMN
Level 3
Level 3
Posts: 107
Joined: Wed Nov 17, 2010 5:52 pm

Browser Font Issue: 9 replaced by dash

Post by JoeInMN » Wed May 08, 2019 11:03 pm

Apologies if there already is a thread about this; the forum search doesn't seem to be working for me for some reason.

This happens in both Firefox and Google Chrome, but only on certain sites, for example in the CloudyNights astronomy classified ads...
Screenshot from 2019-05-08 21-12-27.png
Screenshot from 2019-05-08 21-12-27.png (10.83 KiB) Viewed 508 times
Screenshot from 2019-05-08 21-19-30.png
Screenshot from 2019-05-08 21-19-30.png (27.6 KiB) Viewed 508 times
The number 9 character is replaced by a long dash in the main forum text, though it appears normally in the righthand sidebar.
As I preview this post, I see it happening here as well; my entered text has the dash, while the attached file ID has a normal 9 in it.
Screenshot from 2019-05-08 21-54-34.png
Screenshot from 2019-05-08 21-54-34.png (5.08 KiB) Viewed 508 times
Obviously this is annoying... Any help will be much appreciated.

Thanks,
Joe In MN
Sysinfo:
Mint 19.1
HP 250 G2 Notebook
Intel i3-3110M 2.40GHz/4 Gig RAM
Intel 3rd Gen Core processor Graphics Controller
Intel 7 Series/C210 Series Chipset Family High Def Audio Controller
Qualcomm Atheros QCA9565 / AR9565 Wireless Netwk Adapter (rev 01)

User avatar
xenopeek
Level 24
Level 24
Posts: 24136
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Browser Font Issue: 9 replaced by dash

Post by xenopeek » Thu May 09, 2019 4:49 am

Your signature says you're using Linux Mint 17. I hope it's your signature that needs updating but otherwise note that Linux Mint 17 has reached end of life last month and you'll no longer receive (security) updates for your system. It is most likely not related to your font issue but before investing time in trying to solve this use that time instead to upgrade your system to Linux Mint 18.3 or 19.1.

I couldn't reproduce the issue here. I looked at the ad https://www.cloudynights.com/classified ... 0mm-es-68/. It show a 9 in both the date and price. At the time of this writing that ad was on the 6th page of classifieds.

The website is using system fonts so it's not a problem caused by the website's web fonts. The system font it uses on my systems (Linux Mint 19.1 Cinnamon and checked also on another distro) are Liberation Sans or Nimbus Sans. You can check what font is used with Firefox' inspector. If you've not used the inspector before, here's summary of how to use it:
- Press Ctrl+Shift+I (letter i) to bring up the inspector panel at the bottom half of your browser window
- On the top left corner of the inspector panel click the "square with a mouse pointer" looking icon to pick an element from the page
- Then click on a piece of text on the page that shows a 9 (or dash in your case) to select that element
- Now on the right side of the inspector panel click on the Fonts tab (it's on the second row from the top)
- This should show you the font used for this element (this piece of text)
- You can close the inspector panel with the X icon in its top right corner.
Image

User avatar
Flemur
Level 17
Level 17
Posts: 7333
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Browser Font Issue: 9 replaced by dash

Post by Flemur » Thu May 09, 2019 8:04 am

I've had fonts act funny when using a generic name, like "sans", which isn't properly defined, so you might try setting the browser font to some definite named font (e.g. Ubuntu), NOT a generic name like "sans" or "monospace".

If that fixes it, see here for defining the generic font names:
https://jichu4n.com/posts/how-to-set-de ... -on-linux/

Edit: also tell the browser to use your font and not the website's font, at least as a test.

FWIW, I get "Arimo bold" font on the URL xenopeek posted, on the "$95" text.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

User avatar
JoeInMN
Level 3
Level 3
Posts: 107
Joined: Wed Nov 17, 2010 5:52 pm

Re: Browser Font Issue: 9 replaced by dash

Post by JoeInMN » Thu May 09, 2019 10:12 pm

xenopeek wrote:
Thu May 09, 2019 4:49 am
Your signature says you're using Linux Mint 17. I hope it's your signature that needs updating but otherwise note that Linux Mint 17 has reached end of life last month and you'll no longer receive (security) updates for your system. It is most likely not related to your font issue but before investing time in trying to solve this use that time instead to upgrade your system to Linux Mint 18.3 or 19.1.

I couldn't reproduce the issue here. I looked at the ad https://www.cloudynights.com/classified ... 0mm-es-68/. It show a 9 in both the date and price. At the time of this writing that ad was on the 6th page of classifieds.

The website is using system fonts so it's not a problem caused by the website's web fonts. The system font it uses on my systems (Linux Mint 19.1 Cinnamon and checked also on another distro) are Liberation Sans or Nimbus Sans. You can check what font is used with Firefox' inspector. If you've not used the inspector before, here's summary of how to use it:
- Press Ctrl+Shift+I (letter i) to bring up the inspector panel at the bottom half of your browser window
- On the top left corner of the inspector panel click the "square with a mouse pointer" looking icon to pick an element from the page
- Then click on a piece of text on the page that shows a 9 (or dash in your case) to select that element
- Now on the right side of the inspector panel click on the Fonts tab (it's on the second row from the top)
- This should show you the font used for this element (this piece of text)
- You can close the inspector panel with the X icon in its top right corner.
Flemur wrote:
Thu May 09, 2019 8:04 am
I've had fonts act funny when using a generic name, like "sans", which isn't properly defined, so you might try setting the browser font to some definite named font (e.g. Ubuntu), NOT a generic name like "sans" or "monospace".

If that fixes it, see here for defining the generic font names:
https://jichu4n.com/posts/how-to-set-de ... -on-linux/

Edit: also tell the browser to use your font and not the website's font, at least as a test.

FWIW, I get "Arimo bold" font on the URL xenopeek posted, on the "$95" text.
Oops... I'm on Mint 19; I've updated my signature. It's been such a long time since I've been in here (indicating how smoothly Mint has been running for me), I forgot I needed to watch that. Thanks!

Thanks for the tips. Inspector showed Lucida Grande as the font being used in both of my examples. In Firefox's Preferences/Language and Appearance/Fonts & Colors/Advanced, I cleared the checkbox for "Allow pages to choose their own fonts..." This forces Liberation Sans as the font, and appears to have fixed the issue; at least I am seeing the number 9 now. I'm not sure where in either Firefox or my system preferences Lucida might be selected as a font.

Actually, I would like to allow the page to choose the font. Do I need to do something with Lucida — update, register in system somehow, whatever — to get that font working properly in the browser? It seems to work fine in LO Writer and elsewhere.

Thanks to all for your help!
Sysinfo:
Mint 19.1
HP 250 G2 Notebook
Intel i3-3110M 2.40GHz/4 Gig RAM
Intel 3rd Gen Core processor Graphics Controller
Intel 7 Series/C210 Series Chipset Family High Def Audio Controller
Qualcomm Atheros QCA9565 / AR9565 Wireless Netwk Adapter (rev 01)

User avatar
Flemur
Level 17
Level 17
Posts: 7333
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Browser Font Issue: 9 replaced by dash

Post by Flemur » Fri May 10, 2019 9:47 am

JoeInMN wrote:
Thu May 09, 2019 10:12 pm
Thanks for the tips. Inspector showed Lucida Grande as the font being used in both of my examples. In Firefox's Preferences/Language and Appearance/Fonts & Colors/Advanced, I cleared the checkbox for "Allow pages to choose their own fonts..." This forces Liberation Sans as the font, and appears to have fixed the issue; at least I am seeing the number 9 now. I'm not sure where in either Firefox or my system preferences Lucida might be selected as a font.
That makes me think your generic fonts are not set. (FWIW, if you query a generic font that's not set, it returns a fake value that makes it look like it's set...IOW, don't trust the results of e.g. "fc-match sans")
Actually, I would like to allow the page to choose the font. Do I need to do something with Lucida — update, register in system somehow, whatever — to get that font working properly in the browser? It seems to work fine in LO Writer and elsewhere.
You should probably set up a font configuration file as this guy explains:
https://jichu4n.com/posts/how-to-set-de ... -on-linux/

That site shows me "Arimo" because of my
~/.config/fontconfig/fonts.conf
is setup pretty much as that website suggested:

$ cat .config/fontconfig/fonts.conf

Code: Select all

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

<fontconfig>

	<match target="font">
        <edit mode="assign" name="embeddedbitmap"><bool>false</bool></edit>

		<edit mode="assign" name="antialias">  <bool>true</bool></edit>
		<edit mode="assign" name="autohint">   <bool>false</bool></edit>
		<edit mode="assign" name="hinting">    <bool>true</bool></edit>/home/lemur

		<edit mode="assign" name="hintstyle"><const>hintslight</const></edit>

		<edit mode="assign" name="rgba"><const>rgb</const></edit>

		<edit mode="assign" name="lcdfilter"><const>lcddefault</const></edit>
	</match>

  <!-- Set preferred serif, sans serif, and monospace fonts. -->

  <alias> <family>serif</family>      <prefer><family>Tinos</family></prefer> </alias>
  <alias> <family>sans-serif</family> <prefer><family>Arial</family></prefer> </alias>
  <alias> <family>sans</family>       <prefer><family>Arial</family></prefer> </alias>
  <alias> <family>monospace</family>  <prefer><family>Cousine</family></prefer> </alias>

 <!-- Aliases for commonly used MS fonts. -->

  <match> <test name="family"><string>Comic Sans</string></test>
          <edit name="family" mode="assign" binding="strong"> <string>Cousine</string> </edit> </match>
</fontconfig>
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?

robertknightmba
Level 1
Level 1
Posts: 1
Joined: Sun Jul 28, 2019 7:12 pm

Re: Browser Font Issue: 9 replaced by dash

Post by robertknightmba » Sun Jul 28, 2019 7:14 pm

I solved this problem by modifying the websites css file.

Added "Liberation Sans", in the below line. That changed the fonts to a font that was on the system and the 9 appeared again.

font-family: "Liberation Sans", "Trebuchet MS", Verdana, sans-serif, ;

Post Reply

Return to “Software & Applications”