fontconfig alias for ZapfDingbats font

Bug #130687 reported by Carlos Garcia Campos
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fontconfig
Fix Released
Medium
fontconfig (Debian)
Fix Released
Unknown
fontconfig (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: fontconfig-config

fontconfig returns the wrong font for ZapfDingbats.

$ fc-match ZapfDingbats
DejaVuSans.ttf: "DejaVu Sans" "Book"

however it works when looking for Dingbats instead

$ fc-match Dingbats
d050000l.pfb: "Dingbats" "Regular"

Actually I'm not sure whether it should be fixed in every distro or in fontconfig. I already commented it to upstreamer without response:

https://bugs.freedesktop.org/show_bug.cgi?id=6478#c12

poppler and consequently evince are affected by this issue, since this font is used in pdf files that contains interactive forms.

Revision history for this message
TerryG (tgalati4) wrote :

Thanks for your bug submission.

I get the same response under gutsy:

tgalati4@minty5:~/Projects$ fc-match ZapfDingbats
DejaVu-Sans.ttf: "DejaVu Sans" "Book"

Marking as Confirmed. Bugzilla 6478 is marked as "FIXED". Evince correctly renders test document that reporter links to. Yet mapping is incorrect in Gutsy. Not sure why there is an incorrect match using fc-match yet evince is working correctly with (presumably) ZapfDingbats font.

This seems like a simple-enough fix.

Changed in fontconfig:
status: New → Confirmed
Revision history for this message
In , Freedesktop (freedesktop) wrote :

Add:

        <alias binding="same">
          <family>ZapfDingbats</family>
          <accept><family>Dingbats</family></accept>
        </alias>

This fixes bugs with viewing some PDF files that do not include the font...
See:
https://bugzilla.redhat.com/show_bug.cgi?id=468565
http://bugzilla.gnome.org/show_bug.cgi?id=502664

Revision history for this message
In , James H. Cloos Jr. (cloos-jhcloos) wrote :

This is an example of the more general issue that <alias>s are matched
to patterns' <fontname>s literally, but actual fonts' names are matched
with whitespace ignored.

Ie, if the font is installed, these:

 :; fc-match DejaVuSansMono
 :; fc-match 'DejaVu Sans Mono'

give the same result. But to use aliases you need to have all
possibilities accounted for in the conf.

It is also related to the issue that libs like poppler pass PS names to
fontconfig whereas fontconfig caches the full names. (For Type1 fc
caches the /FullName, poppler passes the /FontName; for sfnts poppler
passes the TT_NAME_ID_PS_NAME, which fc explicitly ignores:

 #if 0
                 case TT_NAME_ID_PS_NAME:
                 case TT_NAME_ID_UNIQUE_ID:
 #endif

)

Revision history for this message
In , Freedesktop (freedesktop) wrote :

Ah I see. Good point.

Revision history for this message
In , Freedesktop (freedesktop) wrote :

We prolly need a new comparison operator for the config file that compares ignoring case and blanks. Then we can update all the config files to use that.

Revision history for this message
In , Bugs-freedesktop (bugs-freedesktop) wrote :

(In reply to comment #3)
> We prolly need a new comparison operator for the config file that compares
> ignoring case and blanks. Then we can update all the config files to use that.

That may be one issue, but isn't necessary going to help with PS-names.
e.g. NimbusSansL-Regu is never going to match a full name or family name.
PS-names and family names are really quite different.

Revision history for this message
In , Freedesktop (freedesktop) wrote :

(In reply to comment #4)
> (In reply to comment #3)
> > We prolly need a new comparison operator for the config file that compares
> > ignoring case and blanks. Then we can update all the config files to use that.
>
> That may be one issue, but isn't necessary going to help with PS-names.
> e.g. NimbusSansL-Regu is never going to match a full name or family name.
> PS-names and family names are really quite different.

Right. PS-names are a different issue and that's bug 18095. Retitling again.

Revision history for this message
In , Freedesktop (freedesktop) wrote :

Note that fc-list also doesn't ignore whitespace when matching.

Revision history for this message
In , Freedesktop (freedesktop) wrote :

*** Bug 23152 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Eric (eric225125-5) wrote :

The problem with the ZapfDingbats alias is still present in fontconfig-2.8.

Revision history for this message
In , Dirtyepic (dirtyepic) wrote :

If the larger issue of whitespace isn't going to be addressed soon can we add the ZapfDingbats bit in the meantime?

Revision history for this message
In , James H. Cloos Jr. (cloos-jhcloos) wrote :

Does anyone have any comments on the proposed patch I posted to the mailing list a couple of weeks ago (<email address hidden> and its followup)?

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

This is still an issue in 10.10. I'm setting the status to triaged/low.

Changed in fontconfig (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Revision history for this message
Dennis Bernardy (denn1s) wrote :

You noticed, thats it's not important, what are you typing in front of Dingbats?

You can type lolDingbats or roflDingbats. You're always getting another font.

Revision history for this message
In , Akiro (akiro) wrote :

(In reply to comment #10)
> Does anyone have any comments on the proposed patch I posted to the mailing
> list a couple of weeks ago (<email address hidden> and its
> followup)?

I've decided to include a workaround patch for this issue so far because I want to give priority releasing new version since there hasn't seen for awhile. I'll have a look at your patch once new release is out.

Revision history for this message
In , Akiro (akiro) wrote :

(In reply to comment #10)
> Does anyone have any comments on the proposed patch I posted to the mailing
> list a couple of weeks ago (<email address hidden> and its
> followup)?

Well, that might be good start to work on Bug#18095 though, I'm not sure how it helps for this since this is to handle the white spaces in the family name on alias.

(In reply to comment #3)
> We prolly need a new comparison operator for the config file that compares
> ignoring case and blanks. Then we can update all the config files to use that.

I'd vote this idea. we could force using FcStrCmpIgnoreBlanksAndCase() for family but is there any cases one strictly needs to check the white spaces in the string? otherwise can we simply use it for string too?

Revision history for this message
In , Akiro (akiro) wrote :

the proposed fixes for this:
http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz19128

I guess there may be the better operator name though. please test it. hope I'm not missing anything else. thanks.

Revision history for this message
In , Akiro (akiro) wrote :

FcStrCmpIgnoreBlanksAndCase() ignores the blanks in any places anyway. so that will says "Co urier" and "C o u r i e r" is same. should we just skips the blanks when the next character is only capitalized?

Revision history for this message
In , Freedesktop (freedesktop) wrote :

Not really sure. Lets go for less complexity.

Revision history for this message
In , Akiro (akiro) wrote :

Okay. we can fix it later as needed.

Revision history for this message
In , Akiro (akiro) wrote :

I still wonder if "eq_case_blanks" is really better name for operator. there are another idea when I thought of. it is to make the case-sensitivity and ignoring blanks optional.

  <test name="family" compare="eq" case-sensitivity="false" ignore-blanks="true">
    ...
  </test>

the concern is, it's only effective for string. but that may be ok since fontconfig implicitly adjusts the behavior against the operator in even current implementation. e.g. FcOpContains and FcOpListing is equal to FcOpEqual for integer and float.

Revision history for this message
In , Akiro (akiro) wrote :

and it would be capable to add another rule for skip blanks like:
  <test name="family" ignore-blanks="only_when_capitalized">

not sure if we really want to do that in the future, but maybe good to have scalability in its syntax.

another advantage on this idea would be compatibility with the older release. it behaves differently but still can share them.

Revision history for this message
In , Akiro (akiro) wrote :

another try:
http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz19128-2

That looks better now. any volunteers for testing are welcome.

Revision history for this message
In , Akiro (akiro) wrote :

Merged into master.

Revision history for this message
Ryan Tandy (rtandy) wrote :

This is fixed upstream in fontconfig 2.9.0, so Fix Released in Quantal and later.

Precise is still affected. The workaround is to install the package "cups-filters", which contains a fontconfig file with an appropriate alias.

Changed in fontconfig (Ubuntu):
status: Triaged → Fix Released
Changed in debian:
status: Unknown → New
Changed in fontconfig:
importance: Unknown → Medium
status: Unknown → Fix Released
Ryan Tandy (rtandy)
affects: debian → fontconfig (Debian)
Changed in fontconfig (Debian):
status: New → Fix Released
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.