Anormal degree sign when importing a pdf file

Bug #1497252 reported by Frédéric Parrenin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Reproduced in inkscape 0.91 on debian jessie
Steps to reproduce:
- import the attached pdf file, page 9
- look at the legend of the map
=> the degree sign in "(en °C)" appears with a bar underneath.
- open the file in evince
=> there is no bar underneath the degree sign

Revision history for this message
Frédéric Parrenin (parrenin-ujf) wrote :
su_v (suv-lp)
tags: added: importing pdf
Revision history for this message
su_v (suv-lp) wrote :

The name of the font in the PDF file is 'Arial MT' - unless you have it installed, the text will be rendered with a fallback font (based on fontconfig/pango) which might render that special character differently than 'Arial MT' (e.g. DejaVu Sans).

Changing the font for the text legend e.g. to 'Arial' (on a system which does have 'Arial' installed, but not a font called 'Arial MT') produces similar output to how it renders e.g. in Evince 3.16.1 (poppler 0.36).

Revision history for this message
Frédéric Parrenin (parrenin-ujf) wrote :

So, why fontconfig/pango does not fallback on arial?
Is this a bug?

Revision history for this message
su_v (suv-lp) wrote :

On 2015-09-18 14:47 (+0200), Frédéric Parrenin wrote:
> So, why fontconfig/pango does not fallback on arial?
> Is this a bug?

Fishing for bugs? ;-)

To the best of my knowledge, this is not a bug (neither in Inkscape nor in your distro's default font backend configuration) - it's a choice made by the distro, likely based on the default configuration files distributed with fontconfig.

I'm somewhat surprised that a Debian user wants to have a non-free font with a proprietary license as default fallback font of the distro's font backend - and even suspects a bug if the font backend falls back to a free, open-licensed and widely-used font (DejaVu Sans, usually). Likely you could customize the font configuration (for the system, or the current user account), though instructions for creating custom font configs on Linux distros are neither Inkscape-specific, nor within the scope of Inkscape's bug tracker.

Revision history for this message
su_v (suv-lp) wrote :

On 2015-09-18 15:55 (+0200), ~suv wrote:
> On 2015-09-18 14:47 (+0200), Frédéric Parrenin wrote:
>> So, why fontconfig/pango does not fallback on arial?
>> Is this a bug?

In case I misunderstood the question:
In the preferences for the text tool ('Edit > Preferences') the user can turn on a 'Font substitution warning' dialog, which - when opening a document - lists all fonts referenced in the document which have not been found on the local system, as well as the fallback font Inkscape uses to render it on-canvas.

AFAICT the fallback font substituted for fonts not found is obtained by querying pango:
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/ui/dialog/font-substitution.cpp#L262
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/libnrtype/FontFactory.cpp#L178

Revision history for this message
Frédéric Parrenin (parrenin-ujf) wrote :

Not exactly fishing for bugs, but when I encounter one I like to report it ;-)

Thanks for the hints.
The 'Font substitution warning' is of great help, and in my opinion it should be activated by default.
Sorry, I did not realize that Arial is a proprietary font. Of course we cannot default on it, but 'DejaVu Sans' is a bad replacement, I hope we will have something better on linux systems in the future.
I am also really surprised that svg fonts are deprecated, so there will be no way to embed a font in a svg file if I understand correctly?

Revision history for this message
su_v (suv-lp) wrote :

A font snipped tested on a system with 'Arial' (as well as 'Liberation Sans') installed, but not 'Arial MT':

 <alias binding="same">
   <family>Arial MT</family>
   <accept>
     <family>Arial</family>
     <family>Liberation Sans</family>
   </accept>
 </alias>

If this is added to the correct user fontconfig file, Inkscape will use 'Arial' (if installed) or else 'Liberation Sans' (which has font metrics matching closer to Arial than DejaVu Sans) as substitutes to render the text which uses 'Arial MT'. If neither is installed, other font matching rules will be used to find a matching substitute.

Revision history for this message
su_v (suv-lp) wrote :

On 2015-09-18 17:53 (+0200), Frédéric Parrenin wrote:
> I am also really surprised that svg fonts are deprecated, so there
> will be no way to embed a font in a svg file if I understand
> correctly?

AFAIK mostly browser vendors are no longer interested in SVG fonts - they can use @font-face CSS rules for custom fonts not installed on the local system (-> webfonts).

Current inkscape does not have support for @font-face rules, nor does it support custom application (or user) fonts yet (fonts as local resources, and not installed in the system or for the user).

Revision history for this message
su_v (suv-lp) wrote :

On 2015-09-18 18:08 (+0200), ~suv wrote:
> A font snipped tested on (...)

Sorry - I mistyped: "A fontconfig snippet tested on (...)".

su_v (suv-lp)
tags: added: fonts
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.