After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 149858 - gnome-print unable to handle ttf fonts with missing style information in 'name' table
gnome-print unable to handle ttf fonts with missing style information in 'nam...
Status: RESOLVED FIXED
Product: gnome-print
Classification: Deprecated
Component: fonts
unspecified
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2004-08-10 23:58 UTC by suresh
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libgnomeprint/gnome-fontmap.c patch (2.39 KB, patch)
2004-08-11 01:36 UTC, suresh
none Details | Review
-do- (2.40 KB, patch)
2004-08-11 01:41 UTC, suresh
accepted-commit_now Details | Review
patch (3.79 KB, patch)
2004-08-18 21:56 UTC, suresh
accepted-commit_now Details | Review

Description suresh 2004-08-10 23:58:46 UTC
There are some ttf fonts out there which don't have the right entries for the
members of the ttf 'name' table such as font family, sub family (style), PS
name. Out of this font-config mandates the family name and gnome-print can live
without a PS name (it substitutes Helvetica for that). But with the missing sub
family (style) entry the font is not included in the print output.

This is wrong as eventhough ttf specs mandates that the name table should be
present for each ttf, it does not mandate the any of the entries to be present
and it is the resposibility of the library/app to make up for this and work even
though this piece of information is absent.

Due to this issue, we have problem printing in Korean locales.
Comment 1 suresh 2004-08-11 01:36:55 UTC
Created attachment 30420 [details] [review]
libgnomeprint/gnome-fontmap.c  patch
Comment 2 suresh 2004-08-11 01:41:17 UTC
Created attachment 30421 [details] [review]
-do-
Comment 3 suresh 2004-08-11 01:41:45 UTC
oops bad day, had to create a second one.
Comment 4 Jody Goldberg 2004-08-11 16:50:49 UTC
Comment on attachment 30421 [details] [review]
-do-

Seems reasonable please commit to head.
Comment 5 suresh 2004-08-11 17:37:56 UTC
committed
Comment 6 suresh 2004-08-18 21:54:01 UTC
Hi Jody,
     Sorry for reworking the patch a bit. Seems like the font-config functions
used for adding the patterns etc. are working not consistently when I tested
this fix in multiple versions of fontconfig. Indeed that's an issue with
fontconfig. Looking more to it I found we can remove the fontconfig dependency
and the resultant patch works in places where they have this fontconfig issue
present.

Pl. check the attached patch (which should be applied after the original as head
is already patched) A coupole of simple warnings are also fixed inthat.
Comment 7 suresh 2004-08-18 21:56:01 UTC
Created attachment 30724 [details] [review]
patch
Comment 8 Jody Goldberg 2004-09-09 02:58:35 UTC
Suresh : can you be more specific about the problem the new patch solves ?
Comment 9 suresh 2004-09-09 17:36:44 UTC
The whole purpose of this function (fcpattern_to_gp_font_entry) seems like to
fill in the GPFontEntry struct, FcpatternAddString/FcPatternGetStrin,functions
(which was introduced in the original patch) does not seem to do it's job of
setting the required FC_STYLE attrib which we created from slant/weight and
retrieving it later. Looking at the rest of the code I found that this exercise
is not necessary we can get the values and directly fill in the
FcPatternGetString once we make it out of the slant/weight, doing like tbat,
removing the font-config dependency seems to be the better approach.
Comment 10 suresh 2004-09-09 17:38:07 UTC
Oops a typo, read like

I found that this exercise
is not necessary we can get the values and directly fill in the
 GPFontEntry once we make it out of the slant/weight.
Comment 11 Jody Goldberg 2004-09-10 14:35:58 UTC
The intent of the patch is pretty clear, but I am still unclear on why you think
it is necessary.  Your mail mentions problems with some versions of font-config ?
Which versions ?
How does pango work when these routines are broken ?
Comment 12 Owen Taylor 2004-09-10 16:12:20 UTC
Well, I certainly like the new patch *much* more than the earlier
version. Calling FcConfigGetFonts() and then modifying the returned 
patterns is a very bad idea, since you are modifying the fonts for 
*all* users of fontconfig.

It does seem to me that the current code will "work" with current 
versions of fontconfig, but I wouldn't consider it legal code.

(A patch was sent to the fontconfig mailing list by a KDE
developer that put the global font database into shared memory
between processes. It wasn't accepted, but something similar
will likely be done in the future.)

Comment 13 suresh 2004-09-10 16:40:12 UTC
In the first place, having fonts without these values are cery bad and
approximation from slant/weight and putting it globally may not be that bad. But
since in the new patch that issue is not there as Owen said thsi is better.

Sorry I did not remember the fontconfig versions which caused the issue. If this
patch is approved, Jody could you pl. apply it, I'm off to a month vacation and
won't be able to do much during this.
Comment 14 Jody Goldberg 2004-09-10 18:43:43 UTC
Comment on attachment 30724 [details] [review]
patch

Sounds reasonable.