Re: [gtk-i18n-list] `.pcf' font not accessible from pango


mpsuzuki hiroshima-u ac jp writes:
> Hi,
> On Mon, 2 Jan 2006 15:26:34 +0100
> pottendo <pottendo utanet at> wrote:
> >I'm trying to migrate an application from GTK 1.x to GTK 2.x (Vice,
> > 
> >This applications uses some handcrafted font which works well within
> >an X11 environment. The source of the font is .bdf which is compiled
> >with bdftopcf into .pcf format.
> I remember, X11 core font support has been removed from
> gtk+-2.4.x & later. Therefore, xlsfonts does not help you
> to identify the font related troubles in gtk+-2.x anymore.
> (the removing means the font management, how to lookup font,
> how to access, etc etc are completely independent with
> traditional X11 applications, like, xlsfonts, gtk+-1.x etc)
> I suppose, your gtk+-2.6.x backend is xft, you should check
> "fc-cache" command to get a list of the font xft library
> recognizes.

With fc-cache I managed to create a file `fonts.cache-1'; but only
after copying the font source file `vice-cbm.bdf' to my fontdir
The content is:
  "vice-cbm.bdf" 0 "VICE CBM:style=Regular:slant=0:weight=80:width=100:pixelsize=12:spacing=100:foundry=FreeType:antialias=False:index=0:outline=False:scalable=False:charset=:lang=:fontversion=0"

Now `VICE CBM' appears in the fontselector widget (vice-cbm.bdf gets
loaded; checked with strace) but choosing the font is not showing my CBM
font but probably default `Sans'.

I suspect that the .bdf font is not well behaving or my system lacks a
sprecial font rendering backend and therefore the font is ignored by
fontconfig & friends.

Are there any additional hints you can give? Of course I can send
`vice-cbm.bdf' if it is helpful to investigate the problem. Let me

> >Also other applications using the fontselector widget don't show my
> >CBM font. I also tried to add the fontpath to my ~/.fonts.config which
> >didn't change anything.
> I'm unfamiliar with ~/.fonts.config - Who told you as it's
> helpful?

What's the best way to supply an application specific font? In my case
the font is special and not be useful for any other application. The
mapping is special (petscii and not ascii) and very specific symbolic
characters are supplied. However for the application it makes sense to
have this font (disk image preview, etc.).

In my GTK1 application the font is enabled from the special
application installation directory by:
    /* set X11 fontpath */
    if (access(PREFIX "/lib/vice/fonts/fonts.dir", R_OK) == 0)
	const char *cmd = "xset fp+ " PREFIX "/lib/vice/fonts";
	if (system(cmd) != 0)
	    fprintf(stderr, _("Can't add fontpath `%s'.\n"), cmd);
	    fprintf(stdout, _("Set fontpath: `%s'.\n"), cmd);
at shutdown time the patch is removed again:
	/* remove fontpath, Don't care about result */
	system("xset fp- " PREFIX "/lib/vice/fonts");

`PREFIX' is the user supplied `--prefix' at configure time.

What would be the equivalent approach for GTK2 applications? 

Any further help is appreciated!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]