Re: Using Pango without FontConfig?



Hi Dave,

The easiest way to use Pango / pango-view for a font website is to use custom
fontconfig config to make only the desired font available.  Then you don't
even have to specify a font anymore!

This is actually easier than I had expected.  Here it goes:

Create a directory, put your font in there, and put the following fonts.conf
file in there:

$ cat fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
	<dir>.</dir>
	<cachedir>.</cachedir>
	<config></config>
</fontconfig>


Now chdir into that directory and run:

$ FONTCONFIG_PATH=. pango-view --text test

Voila!

behdad

On 05/14/2010 04:35 PM, Dave Crossland wrote:
> Hi!
> 
> I'm working on the Open Font Library with Pierre Marchand, and the
> Pango-based PNG-generating font preview system we have -
> https://svn.openfontlibrary.org/public/openfontlibrary/gcfp/typesetter/PangoCairoFontPlayground.c
> - is not working for font families with unusual family naming schemas
> - because it depends on FontConfig.
> 
> I believe that the relevant feature request is already in the tracker
> for a long time: https://bugzilla.gnome.org/show_bug.cgi?id=95043
> 
> And I guess that we ought to drop PangoCairoFontPlayground.c as today
> it is essentially a simple version of pango-view.
> 
> To be clear about what I would like, pango-view currently works like this:
> 
> $ pango-view --output=a.png --text="123 Handshoveling spam? OH
> nononono" --font="Junction" --height=500 --dpi=200
> 
> What I would like is to run it like this:
> 
> $ pango-view --output=a.png --text="123 Handshoveling spam? OH
> nononono" --font-file="Junction.ttf" --height=500 --dpi=200
> 
> For that to work, Pango would need a patch to use a font directly,
> without going via FontConfig.
> 
> (I also wonder if https://bugzilla.gnome.org/show_bug.cgi?id=347237 is
> related, the so-called "web fonts bug," and since webfonts are now
> working well, I wonder how easy it will be to fix bug #95043 too :-)
> 
> Cheers
> Dave


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