[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-fonts-devel] Fonts from package misbehave in exported PDF

Hi Fabian

On 11/09/2012 at 14:40, Fabian Greffrath <fabian@greffrath.com> wrote:

> The only tex-gyre package that I could find for Arch linux is the
> following:
> http://aur.archlinux.org/packages.php?ID=40619
> which obviously only contains the Opentype flavours. No wonder that
> the fonts do not show up duplicated. ;)

They provide OpenType and Type1 font files for Tex-gyre in texlive-core 
package. Along with 270 megs of other data ;) .
This is the one that I have installed. Sorry I forgot to mention that.
> I am not sure about this. Things seem to be wrong in the fonts
> themselves as well. All the fonts I have checked have different
> strings for Font Family and Fullname and in addition these differ
> between Mac and Windows strings, e.g.:
> $ fontlint
> [...]
> No wonder that applications like LO or KDE get confused about this and
> show the fonts randomly with or without spaces.

Well, KDE (and other apps) just use anything that fontconfig provides them. See 
test #3 in my previous message. Other applications showed duplicated entries 
until I put your 65-tex-gyre.conf file, which - as far as I understand it - 
just supersedes family names without spaces with family names with spaces.

Anyway, your message inspired me to do some new tests. Results are below.

1. Change name in font files
I took texgyrebonum-regular.otf file, using FontForge changed names (in TTF 
Data) to "TeX Gyre Bonum" and put it back into 
/u/s/texmf/fonts/opentype/public/tex-gyre/. I have also removed other bonum 
OTF files there to not confuse LO with one family with different family names in 
bold and italic variants.
Result: Still duplicated entries.

2. Remove /u/s/texmf/fonts/type1/public/tex-gyre/ directory
In next step I had removed all tex-gyre type1 fonts.
Result: No duplicated entries in LibreOffice, finally.
$ fc-match -a |grep -i 'gyre.*regular'
texgyrechorus-mediumitalic.otf: "TeX Gyre Chorus" "Regular"
texgyreschola-regular.otf: "TeX Gyre Schola" "Regular"
texgyrebonum-regular.otf: "TeX Gyre Bonum" "Regular"
texgyrecursor-regular.otf: "TeX Gyre Cursor" "Regular"
texgyreheros-regular.otf: "TeX Gyre Heros" "Regular"
texgyrepagella-regular.otf: "TeX Gyre Pagella" "Regular"
texgyretermes-regular.otf: "TeX Gyre Termes" "Regular"
texgyreadventor-regular.otf: "TeX Gyre Adventor" "Regular"
texgyreheroscn-regular.otf: "TeX Gyre Heros Cn" "Regular"

BUT LibreOffice still show font names without spaces (for all but TeXGyreBonum - 
this is because of 1 above).

3. Change a way fonts are displayed in clearly visible way
Then I created /etc/fonts/conf.d/65-zz-myownchanges.conf file with content:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
  <match target="scan">
    <test name="family">
      <string>TeX Gyre Adventor</string>
    <edit name="family">
      <string>YOU CANT MISS THAT</string>
    <edit name="fullname">
      <string>YOU CANT MISS THAT</string>
TeX Gyre Adventor font should be missing, but "YOU CANT MISS THAT" font should 
appear, right?
Exactly this happens in Kolourpaint, gnome-specimen, GIMP, Inkscape and 
possibly any other decent enough app with GUI you can imagine.

But in LibreOffice, Tex Gyre Adventor is still available and you can't choose 
"YOU CANT MISS THAT" font. On both Debian package and upstream one.

My hypotesis:
LibreOffice is using fontconfig only to get paths to registered font files. Then 
it reads font properties on it's own.
This at least explain why changes made on /etc/fonts/conf.d/ level are not 
present in LO, but you still can drop font files to ~/.fonts/ and use them in 
LO. But it does not explain why only subset of Tex Gyre fonts were duplicated 
in LO when both OpenType and Type1 fonts were available...

I wanted to verify it by changing font properties and opening LO and gnome-
specimen without refreshing fontconfig cache. If my hipotesis was true, gnome-
specimen should display previous name (because it relies on fontconfig, which 
has outdated info in cache), while LO should display changed name (because it 
read font properties on startup). But no matter how I try, fontconfig cache 
seem to update before I open both LO and gnome-specimen. I tried disabling 
<rescan> in /etc/fonts/fonts.conf and changing it to high number (3000 
seconds), but without luck.
Best regards
Mirosław Zalewski

Reply to: