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

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



Fabian,

since answers are not as simple as I wish them to be, let me elaborate a bit.

I have tried four different scenarios (with and without local.conf, with and 
without 65-tex-gyre.conf file). My local.conf is pretty simple:
#v+
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
        <dir>/usr/share/texmf/fonts/</dir>
</fontconfig>
#v-

After each change I run "fc-cache -frsv" as root. I also attach results for 
fc-match, as you may find them interesting. Results and my comments follow:

1. without modified local.conf, without 65-tex-gyre.conf
=================================
- no duplicated Tex Gyre entries
- PDF export is not working

$ fc-match -a |grep -i bonum
qbkr.pfb: "TeXGyreBonum" "Regular"
qbkb.pfb: "TeXGyreBonum" "Bold"
qbkri.pfb: "TeXGyreBonum" "Italic"
qbkbi.pfb: "TeXGyreBonum" "BoldItalic"

2. without modified local.conf, with 65-tex-gyre.conf
=================================
- no duplicated Tex Gyre entries
- PDF export is not working

$ fc-match -a |grep -i bonum
qbkr.pfb: "TeX Gyre Bonum" "Regular"
qbkb.pfb: "TeX Gyre Bonum" "Bold"
qbkri.pfb: "TeX Gyre Bonum" "Italic"
qbkbi.pfb: "TeX Gyre Bonum" "BoldItalic"

3. with modified local.conf, without 65-tex-gyre.conf
=================================
- some Tex Gyre entries are duplicated (see below)
- PDF export is working fine

$ fc-match -a |grep -i bonum
texgyrebonum-regular.otf: "TeX Gyre Bonum" "Regular"
qbkr.pfb: "TeXGyreBonum" "Regular"
qbkr.pfb: "TeXGyreBonum" "Regular"
texgyrebonum-bold.otf: "TeX Gyre Bonum" "Bold"
qbkb.pfb: "TeXGyreBonum" "Bold"
qbkb.pfb: "TeXGyreBonum" "Bold"
texgyrebonum-italic.otf: "TeX Gyre Bonum" "Italic"
qbkri.pfb: "TeXGyreBonum" "Italic"
qbkri.pfb: "TeXGyreBonum" "Italic"
texgyrebonum-bolditalic.otf: "TeX Gyre Bonum" "Bold Italic"
qbkbi.pfb: "TeXGyreBonum" "BoldItalic"
qbkbi.pfb: "TeXGyreBonum" "BoldItalic"

4. with modified local.conf, with 65-tex-gyre.conf
=================================
- some Tex Gyre entries are duplicated (see below)
- PDF export is working fine

fc-match -a |grep -i bonum
texgyrebonum-regular.otf: "TeX Gyre Bonum" "Regular"
qbkr.pfb: "TeX Gyre Bonum" "Regular"
qbkr.pfb: "TeX Gyre Bonum" "Regular"
texgyrebonum-bold.otf: "TeX Gyre Bonum" "Bold"
qbkb.pfb: "TeX Gyre Bonum" "Bold"
qbkb.pfb: "TeX Gyre Bonum" "Bold"
texgyrebonum-italic.otf: "TeX Gyre Bonum" "Italic"
qbkri.pfb: "TeX Gyre Bonum" "Italic"
qbkri.pfb: "TeX Gyre Bonum" "Italic"
texgyrebonum-bolditalic.otf: "TeX Gyre Bonum" "Bold Italic"
qbkbi.pfb: "TeX Gyre Bonum" "BoldItalic"
qbkbi.pfb: "TeX Gyre Bonum" "BoldItalic"


These duplicated font entries in scenarios 3 and 4 are:
a) TexGyreHerosCn (PDF export is OK) and TexGyreHerosCondensed (PDF export is 
broken)
b) Tex Gyre Bonum (PDF export is OK) i TexGyreBonum (PDF export is broken)

Something is not right, as only two entries are duplicated, but not any other. 
Also, fc-match shows that 65-tex-gyre.conf fixes issues with different names and 
all tex-gyre fonts names have spaces. But LibreOffice display names without 
spaces anyway; please see screenshot:
<http://minio.xt.pl/obrazy/rozne/lo-fonts.png>

Trying to figure it out, I run some other tests.
1. Another user
===============
Since this issue might be caused by my configuration in ~, I created new system 
user and run LO as him.
Result: still two entries are duplicated.

2. Upstream LibreOffice
=======================
I have downloaded LO 3.5.6 from upstream website, installed it (they provide 
.deb packages) and run:
 /opt/libreoffice3.5/program/soffice -env:UserInstallation=file:///tmp/lo-userprof/
basically, it runs LO on completely new config with all default values.
Result: still two entries are duplicated.

3. Other applications
=====================
I have tested scenarios 3 and 4 (local.conf exists, with and without 65-tex-
gyre.conf) on different applicatons. These were:
- Kolourpain
- GNOME Specimen (font viewer)
- KDE fonts configuration module
- Inkscape
- GIMP
Result: In almost all applications TexGyre fonts were duplicated in scenario 3 
and NOT duplicated in scenario 4. Only exception is GIMP - in scenario 4 bold 
italic variant is still duplicated. Most likely this is something unrelated to 
our discussion here.

4. Other distribution
=====================
I though that maybe this is LO which is broken here. Luckily, I have Arch 
Linux on virtual machine. I have installed their package for texgyre fonts, 
adjust local.conf for fontconfig (in way similar to my file on Debian; it's only 
that Debian put opentype font files in /usr/share/texmf/fonts/, while Arch in 
/usr/share/texmf-dist/fonts/), run fc-cache and run LibreOffice.
Result: no Gyre font is duplicated.

Comment: On Arch, only font shown with spaces in name in LibreOffice is 
TexGyreBonum. Others are shown without spaces in name. But in KDE System 
Settings all are displayed without spaces in names.

Comment#2: You remember how qbkr.pfb entries were duplicated in fc-match 
output in scenario #4 above? In Arch they are not. Also, files in 
/etc/fonts/conf.d differ in Arch and Debian. These are files available only in 
Arch:
20-unhint-small-dejavu-sans.conf 20-unhint-small-dejavu-sans-mono.conf 20-
unhint-small-dejavu-serif.conf 29-replace-bitmap-fonts.conf 57-dejavu-
sans.conf 57-dejavu-sans-mono.conf 57-dejavu-serif.conf

And files available only in (my) Debian:
70-nobitmaps.conf 90-fonts-linux-libertine.conf

If anyone is interested in looking at Arch-specific config files, please download 
their fontconfig package:
http://www.archlinux.org/packages/extra/i686/fontconfig/
I don't see anything related to our issue there...

Comment#3: I have checked patches that are applied on upstream sources of 
LibreOffice by Debian and Arch maintainers. "grep -i font *" does not show that 
anyone have played with a way LO handles fonts.

5. Renaming /usr/share/X11/Type1
================================
Someone said that tex-gyre makes fonts available for X. I though that maybe LO 
is confused by that and renamed /u/s/X11/Type1 directory.
Result: xfontsel can't choose TexGyre fonts. Still two entries are duplicated 
in LO.

6. Removing /etc/X11/fonts/Type1/tex-gyre.scale
=================================
Totally blind shot. I am not sure if this even makes sense ;) .
Result: nothing changed, still two entries are duplicated in LO.


After sharing this all, short answer will be:
Fabian, your fontconfig .conf file seems to play nicely.
But there is something somewhere that causes LibreOffice to not like it anyway. 

I am out of ideas what can be wrong :( . But I strongly believe that this is 
LO fault and we should not provide hacks for this on fontconfig level.
-- 
Best regards
Mirosław Zalewski



Reply to: