Re: PANGO and Xft



Vikram <upender vsnl com> writes:

> Ok,
>     I got half of the answer myself.I did  export GDK _USE_XFT=1 to get
> Gtk
> use Pango + Xft.But still I don't get how to get Pango to load the Face
> corresponding to my Tamil TTF font.

Unfortunately, there is no fontset mechanism for the Xft backend
currently. I basically want to do font configuration for Xft
completely through the Xft config files, so getting fontsets
to work will require some Xft changes.

This means, that whatever font is specified in your ~/.gtkrc-2.0 will
be used for everything. You can add something like:

============
#include "/home/otaylor/.themes/Premier/gtk/gtkrc"
#include "/usr/share/themes/BrushedMetalClean/gtk/gtkrc"

style "user-font"
{
   font_name="Bitstream Cyberbit 16"
}
widget_class "*" style "user-font"
=========

To change the font that GTK+ will look for. 

Alternatively, you can edit your ~/.xftconfig to change what font
"Sans" (the default GTK+ font) refers to. I have in mine:

====
match	any family == "sans"
	all family != "helvetica"
edit	    family =+ "helvetica";
====

Which says "if the family specified in the pattern, but not 
helvetica, add helvetica".

Right now, Xft / PangoXft only use the _first_ family found
in the pattern, without regard to language, but it probably
should work so if the pattern species the families:

 "sans,helvetica,my_tamil_font"

It can use helvetica for English and my_tamil_font for Tamil.


But without such modifications, you probably will need to 
have both ASCII and the Tamil glyphs in a single font to
have the Xft support be useful.

> So what I did was to remove all other fonts from Xftconfig and keep
> only the tamil font And then I got Tamil alright but obviously the
> other glyphs were missing.Anyway I made some progress and here's a
> screenshot with Pango hacked to load the XFtFont at twice the size
> only for the screenshot to look nice.
 >
> http://vikram1024.tripod.com/aa.png

Neat. You could, of course, just modify testtext to use a
different font for the text to make such a screenshot :-)

Regards,
                                        Owen




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