Results 1 to 6 of 6

Thread: Wrong font substitutions in Okular and Evince

  1. #1
    Join Date
    Mar 2008

    Wrong font substitutions in Okular and Evince

    Ubuntu ver: 9.10, x86_64

    I noticed the fonts were "bunched up" in a PDF I was viewing, so I checked the fonts tab in Okular's file-info window. This revealed that Okular was substituting DejaVu-Sans for NewCenturySchlbk-Roman -- i.e. swapping a sans-serif font in for a serif font (a better substitution would be e.g. DejaVu Serif).

    I've installed the TTF version of NewCenturySchlbk ("New Century Schoolbook") in my ~/.fonts directory, and re-run mkfontdir and fc-cache over it. Even after this, Okular is doing the same thing -- bunched up fonts, wrong substitution.

    Can someone please tell me what I'm doing wrong here? Even fontconfig seems to be confused --
    $ fc-match "NewCenturySchlbk-Roman"
    DejaVuSans.ttf: "DejaVu Sans" "Book"
    Last edited by philpem; December 24th, 2009 at 08:36 PM.

  2. #2
    Join Date
    Feb 2008
    Ubuntu 9.10 Karmic Koala

    Re: Wrong font substitutions in Okular and Evince

    I have the same problem with a PDF file which reports to use MTimesNewRoman which is substituted in both evince and Okular with Dejavu Sans.. In fact it should use a serif (or as I have it on the system use Times New Roman)
    XPdf displays the file correctly.
    Ubuntu versin is 9.10.


  3. #3
    Join Date
    Mar 2012

    Re: Wrong font substitutions in Okular and Evince

    I'm on openSUSE and I had the same problem; I solved it like this:

    I added this to my ~/.fonts.conf (just before the closing </fontconfig> tag):
     <match target="pattern">
       <test qual="any" name="family"><string>NewCenturySchlbk</string></test>
       <edit name="family" mode="assign" binding="same"><string>Century Schoolbook L</string></edit>
    Then I did
    and now
    fc-match NewCenturySchlbk
    c059013l.pfb: "Century Schoolbook L" "Roman"

    Evince and Okular both display a proper font (don't know the difference between NewCenturySchlbk and Century Schoolbook L, but it looks quite good).

    On openSUSE, Century Schoolbook L is contained in the package ghostscript-fonts-std, by the way.

  4. #4
    Join Date
    May 2012

    Re: Wrong font substitutions in Okular and Evince

    I can confirm the same problem in okular 0.15.5 in kubuntu 12.10 and it is quite bad (document unreadable in okular rendered perfectly in acroread).

    The fix given by lineinthesand above works perfectly (only I just added the line and restarted okular, the fc-cache stuff I didn't need).

  5. #5
    Join Date
    May 2012

    Re: Wrong font substitutions in Okular and Evince

    Ok - qualifier to the previous post - with this fix (in .config/fontconfig/fonts.conf okular renders the document perfectly on screen but doesn't print or produce a print preview - it will print a document that doesn't contain the offending fonts. It produces no errors that I can find.

    However this appears to be this bug:

    and the rerendering through gs (gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf ex1.pdf) works ok on screen and in print for okular

    I should add that the file in question renders perfectly onscreen for acroread but has incorrect kerning in print for acroread.

  6. #6
    Join Date
    Jan 2010
    Kolkata India

    Re: Wrong font substitutions in Okular and Evince

    Closed old thread.

    As per the Ubuntu Forums Code of Conduct, please do not post in threads more than one year old. Feel free to start a fresh thread.

    “Progress is made by lazy men looking for easier ways to do things”
    — Robert A. Heinlein


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts