GNOME Bugzilla – Bug 102400
libgnomeprint does not contains font aliases
Last modified: 2004-12-22 21:47:04 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.
*** Bug 103262 has been marked as a duplicate of this bug. ***
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)
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)
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.
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.)
Created attachment 13569 [details] [review] patch
Fixed in cvs, but testing would be appreciated.
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
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.
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?
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?
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?
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?
No it doesn't. There is no code inside gedit or libgnomeprint that will make it choose a different font depending on the languaje.
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?
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.
I think I know what the problem might have been see bug 104710. Which is why it wasn't picking up the .font files.