1

I believe this to be a duplicate of this question, but the accepted answer is 8+ years old and didn't work for me.

Here is a website, which wants to use the Palatino font. On my system, this falls back to Tex Gyre Pagella, also called P052-Roman. Here is what it looks like, it's immediate that the different letters don't have the same height.

Ugly font

The answer to the question linked above claims the problem is with hinting, but applying the fix did not work. I also tried to change the font names URW Palladio L etc to P052-Roman and Tex Gyre Paella.

Any help would be appreciated!

red_trumpet
  • 1,849
  • https://linuxconfig.org/how-to-improve-firefox-font-rendering-on-linux maybe see if some of the tweaks here change anything for you – Esther Apr 14 '22 at 21:32
  • The only custom fonts I dabble with a barcode fonts so I know nothing about what you are using. But there is a Firefox Add-on that deals with your font family: https://addons.mozilla.org/en-CA/firefox/addon/texgyrepagella-math/ – WinEunuuchs2Unix Apr 15 '22 at 18:22

3 Answers3

1

Here is what I did in the end: By trial and error I removed all P052-fonts Firefox used. They were located in the folders

/usr/share/fonts/opentype/urw-base35
/usr/share/fonts/type1/urw-base35
/usr/share/fonts/type1/gsfonts

Now my Firefox correctly loads the TeX Gyre Pagella font, which looks better:

red_trumpet
  • 1,849
0

I happen to have the (four) Palatino Linotype font (i.e. .ttf) files installed and the web page that you cited looked pretty normal to me on Firefox, so maybe you can solve this issue by just downloading the Palatino Linotype .zip package from a fonts distribution site such as e.g. Fonts 100, extracting those four Palatino font files (i.e. pala.ttf, palab.ttf, palabi.ttf and palai.ttf) to any folder that you want (e.g. ~/Fonts/), and then installing these files through a font installer such as gnome-font-viewer or fontmatrix.

The long command below creates a Fonts folder in your home profile directory (e.g. /home/red_trumpet/), downloads the aforementioned .zip file to it, extracts the four .ttf files from such .zip file and then deletes the .zip file:

if [ ! -d ~/Fonts ] ; then mkdir -p ~/Fonts ; fi ; cd ~/Fonts ; wget https://fonts100.com/76219%2Fpalatino-linotype.zip -O ./pl.zip ; if [ ! -x /bin/unzip ] && [ ! -x /usr/bin/unzip ] ; then sudo apt install unzip -y ; fi ; for i in pala.ttf palab.ttf palabi.ttf palai.ttf ; do unzip -j "pl.zip" "$i" ; done ; rm ./pl.zip

If you decide to use fontmatrix, install it by running this command on the terminal:

sudo apt install fontmatrix -y

...and then start fontmatrix by running this command:

fontmatrix & exit

Then, at the fontmatrix window, click on File, then Import Files..., then select those 4 .ttf files (pala.ttf, palab.ttf, palabi.ttf and palai.ttf) at the folder/directory where you extracted them to (e.g. ~/Fonts) and then click Open. Next, scroll down to Palatino Linoype and double-click on it, then click on Activation, click on Activate All, then exit fontmatrix, restart Firefox and access that web page again.

Explaining the four .ttf file names:

  • pala.ttf is the standard ("normal") Palatino Linotype font file.
  • palab.ttf is the bold Palatino Linotype font file.
  • palai.ttf is the italic Palatino Linotype font file.
  • palabi.ttf is the bold italic Palatino Linotype font file.

You may also use fontmatrix to disable the Tex Gyre Pagella font: just select this font at fontmatrix and the click on Activation and then Deactivate All.

As a last resource (extreme case), you can always use Firefox to access the about:config URL, then look for the browser.display.use_document_fonts feature and switch its value from 1 to 0.

-1

If your final goal is to show the page in clear font, you have the option to override the page fonts as described in details in this Mozilla support page: Application Menu > Settings > Fonts and Colors > Advanced then uncheck "Allow pages to choose their own fonts, instead of your selections above".
This way, the page will appear with the font you choose.

On the other hand, if your final goal is to show the page using Tex Gyre font. My suggestion is to install the texgyre font (as in the following code) to make sure nothing broken in the font's files.

sudo apt update  
sudo apt install fonts-texgyre

I did that in my system (ubuntu-22.04-beta) and the page mentioned looks ok.

Pablo Bianchi
  • 15,657