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 102400 - libgnomeprint does not contains font aliases
libgnomeprint does not contains font aliases
Status: RESOLVED NOTABUG
Product: gnome-print
Classification: Deprecated
Component: general
CVS
Other Linux
: Normal normal
: ---
Assigned To: Chema Celorio
Chema Celorio
: 103262 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-01-03 05:52 UTC by Leon Ho
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.09 KB, patch)
2003-01-15 03:40 UTC, Chema Celorio
none Details | Review

Description Leon Ho 2003-01-03 05:52:21 UTC
font selection in gnomeprintui does not contains any font aliases (ie. 
monospace, sans, serif). Hence any application rely to it (ie. gedit's preference 
printer font will fail to select the default font) which usually uses those three 
default aliases fails.
Comment 1 Havoc Pennington 2003-01-13 02:20:45 UTC
*** Bug 103262 has been marked as a duplicate of this bug. ***
Comment 2 Chema Celorio 2003-01-14 04:07:48 UTC
gedit and libgnomeprint are doing the right thing for me.

Gedit tries gettting:

GPM_DEFAULT_PRINT_FONT_BODY     (const gchar*) "Monospace Regular 9"
GPM_DEFAULT_PRINT_FONT_HEADER   (const gchar*) "Sans Regular 11"
GPM_DEFAULT_PRINT_FONT_NUMBERS  (const gchar*) "Sans Regular 8"

From libgnomeprint, which matches the internal aliases and on my
system returns:
-Luxi Mono 9
-Luxi Sans 11
-Luxi Sans 8

which seems to do what we want. I don't think having this fonts show
in the dialog is what we want, since they are just aliases they user
does not have it installed. 

I fail to see what the issue is, maybe it was an issue with the GNOME
2.0 version?

(will NEEDINFO the bug)
Comment 3 Leon Ho 2003-01-14 04:46:56 UTC
Look like it have returned the right font. What other packages that may 
related?  
 
For me when 'LANG=ja_JP gedit' and I go to Preference -> Printing -> 
Font. It returns the following errors even though the schemas uses 
Monospace and Sans. And the first font of the list has select when it is in 
the currently select font. Can you reproduce with the same error? 
 
-- 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Bold because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Bold because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Bold because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Bold because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Bold because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Bold because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Bold because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Regular because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Regular because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Regular because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Regular because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Regular because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Regular because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
LucidaTypewriter-Regular because the extension could not be recognized 
(.pcf) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Mincho-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Baekmuk Headline-Regular because the extension could not be 
recognized (font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Baekmuk Dotum-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for AR 
PL SungtiL GB-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for AR 
PL SungtiL GB-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for AR 
PL Mingti2L Big5-Reguler because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for AR 
PL Mingti2L Big5-Reguler because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Mincho-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Mincho-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Mincho-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Mincho-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
 
(gedit:6309): GnomePrint-WARNING **: Can't create GPFontEntry for 
Kochi Gothic-Regular because the extension could not be recognized 
(font) 
 
Comment 4 Chema Celorio 2003-01-15 03:12:31 UTC
I know what is happening, but i don't know how we can fix it.

GnomePrint does not know how to deal with .font or .pcf fonts. When we
call Fontconfig to get the default fonts to create the aliases, it
returns .fonts and .pcf so the aliases are not set. 
Comment 5 Owen Taylor 2003-01-15 03:21:56 UTC
The problem here are the links

 /usr/share/fonts/ko/default.font
 /usr/share/fonts/ko/default-bold.font

fontconfig sees them before it sees the real files, 
so you see the symlink filename instead of the actual
filename.

I don't think you'll get any non TTF's with the .font
extension, so it's probably safe just to accept it.

(I don't know if we know what these files are for
any more ...they were added to Red Hat at some time
in the past for one reason or another.)
Comment 6 Chema Celorio 2003-01-15 03:40:39 UTC
Created attachment 13569 [details] [review]
patch
Comment 7 Chema Celorio 2003-01-15 03:42:00 UTC
Fixed in cvs, but testing would be appreciated.
Comment 8 Chema Celorio 2003-01-15 03:49:13 UTC
I've uploaded a snapshot from tonight's CVS, in case it might help
testing.

http://www.gnome.org/~chema/libgnomeprint-2.1.9.20030114.tar.gz
Comment 9 Leon Ho 2003-01-16 04:09:44 UTC
Okay. I have retested with libgnomeprint, and seems that error message  
is a seperate bug overall. If I did not specfic any font for printing yet,  
running in any locales will still default the font as the first one available  
on the list. 	 
Comment 10 Chema Celorio 2003-01-16 16:06:59 UTC
If this is with gedit, gedit is saving the font used last time. So it
saved the broken font and is loading it. What happens if you hit the
"restore defaults" button?
Comment 11 Leon Ho 2003-01-16 23:45:21 UTC
I have tried to delete the whole .gconf/apps/gedit-2 and 
also tried to reset defaults. It is still showing the first font 
on the list.  Can you see the correct font for different 
languages? 
Comment 12 Chema Celorio 2003-01-17 00:29:58 UTC
What if the first font on the list is the RIGHT font that matches?
Gedit has 3 fonts, different sizes what fonts do you get after hitting
the "Restore default fonts" button? Also, when you say "first font in
the list" what list are you refering to? 

Comment 13 Leon Ho 2003-01-17 00:36:51 UTC
I have tried like LANG=en_US, ja_JP, zh_TW, zh_CN, ko_KR, they all 
refer to the same font - which is AR PL KaitiM Big5. The list I am 
referring to is list in "Pick a Font dialog" after you pressed gedit -> Edit 
-> Preferences -> Print -> Fonts. 
 
Does it default the correct font for you if you try on different languages? 
Comment 14 Chema Celorio 2003-01-17 00:47:21 UTC
No it doesn't. There is no code inside gedit or libgnomeprint that
will make it choose a different font depending on the languaje.
Comment 15 Leon Ho 2003-01-17 01:06:20 UTC
I see what you meant. Is it a correct behaviour (To return the first listed 
font) even if we pointed to Monospace alias? or With default settings, 
when you run print preview, does it uses Luxi Mono for you? 
Comment 16 Chema Celorio 2003-01-19 04:28:58 UTC
Get libgnomeprint _from_cvs_ or the soon to be released 2.1.9. Run
"./fonts --catalog" inside libgnomeprint/tests and examine the
catalog.ps file with gv. Look for the "Monospace Regular" font, that
is the alias you've got set up and that is what you should be getting
in gedit when you hit the restore defaults button.

If the Monospace Alias is not correct, please file a bug for
fontconfig or have someone take a look at your /etc/fonts/font.conf
file (if you've modified it), if gedit does not give you the same
alias as ./fonts --catalog gives you for "Monospace Regular", I would
guess that gedit is not picking up the libgnomeprint which you used to
create the font catalog. Also make sure you've got the latest released
version of gedit.

Oh, and about trying with different LANG. I wasn't aware of it but
fontconfig does have different aliases for different LANG values so
you might see a difference depending on the LANG value.

The code I am using to get the Monospace alias from fontconfig is
equivalent to:

p = FcPatternBuild (NULL,
		FC_FAMILY, FcTypeString,  "monospace",
		FC_SLANT,  FcTypeInteger, FC_SLANT_ITALIC,
		FC_WEIGHT, FcTypeInteger, FC_WEIGHT_NORMAL,
		NULL);
FcConfigSubstitute (NULL, match_pattern, FcMatchPattern);
FcDefaultSubstitute (match_pattern);

Reopen the bug if you still belive there to be a bug, but please check
your setup and follow the instructions above to debug it.
Comment 17 Chema Celorio 2003-02-01 04:18:13 UTC
I think I know what the problem might have been see bug 104710. Which
is why it wasn't picking up the .font files.