Re: [Indic-computing-users] Raghu, ttmkfdir and Code2000
Status: Alpha
Brought to you by:
jkoshy
From: Guntupalli K. <kar...@fr...> - 2002-10-12 08:30:04
|
On Sat, 12 Oct 2002 00:57:58 -0700 (PDT) Keyur Shroff <key...@ya...> wrote: > > --- Guntupalli Karunakar <kar...@fr...> wrote: > > > > > > Unfortunately, ttmkfdir can't generate proper XLFD name for > > > Unicode encoded fonts that fall under Indic range. New programs > > > are being written which will eventually replace ttmkfdir. > > > Meanwhile you can put the following XLFD name for Raghu in your > > > fonts.scale file: > > > > > > raghu.ttf > > > -NCST-Raghindi-medium-r-normal--0-0-0-0-p-0-iso10646-1 > > > > > But mangal & other XP fonts work with ttmkfdir from X 4.2 , There > > is > > probably some bug in it. There was a report on gtk-i18n list on > > raghu having a 0 lenth kern table ( I donno if that affects > > ttmkfdir ). > > Having a 0 length kern table should not be considered a bug in the > font. I saw those messages on gtk-i18n list. ttmkfdir uses FreeType > and there is an assumption in FreeType that 0 length table is > invalid. They planned to correct it and I recall that someone > suggested patch in FreeType. I don't know whether they have applied > the patch or not. > > > > > > > # This is sample gtkrc file for hi_IN locale > > > > > > style "gtk-default-hi_IN" { > > > fontset = > > > "raghu, \ > > > -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8 > > > 859- 1" > > > } > > > class "GtkWidget" style "gtk-default-hi_IN" > > > > > > # end of file > > > > > This was with 8 bit fonts, with gtk2 we dont need to do all this > > stuff, or putting it properly one should not do this stuff, as > > this sets the font for all widgets, if your application is to be > > used for many languages at same time, setting font explicitly is > > not good, unless ur font caters to all languages expected to be > > used. > > If ur app is still pre gtk2 then certainly this is the proper way > > to > > set font. > > This can also be used with 16-bit fonts (as you can see name of > Raghu there). And you can even use different styles with different > widgets. Certainly, in this example, it will set the fontset for all > widgets; but you can specify different styles and bind them with > different widget classes. However I have not closely looked at new > font settings in Gtk2. Can you tell us how to set fonts in Gtk2? Is > it in xft/ft2 related directory? > Below is procedure for using the font with fontconfig & Xft. It will work even without doing all this stuff if the font is available in the paths speficied in <dir> options, If font selected by font face name or has been speficied instead of a generic alias like sans, mono then that font is used, if its not available default fallback mechanism ( sans, mono etc) will be used . If there are two fonts catering to same script, the one in fonts.conf will be prefered, If there are two or more in fonts.conf for same script then the first one would be used, You need to install the font & do settings in /etc/fonts/fonts.conf (for Xft2) or in /etc/X11/XftConfig ( for Xft1 ), Add the dir in these config files. In fonts.conf we need to add our font typeface to the aliases First install the font ( the usual copy, ttmkfdir, mkfontdir etc ) . Then add the directory in list below or make sure its under the ones already below <!-- Font directory list configured on Sat Aug 31 20:37:33 IST 2002 --> <dir>/usr/X11R6/lib/X11/fonts</dir> <dir>/usr/share/fonts</dir> <dir>~/.fonts</dir> Add font face name in aliases <!-- Serif faces --> <alias> <family>Times</family> <family>Times New Roman</family> <family>Nimbus Roman No9 L</family> <family>Luxi Serif</family> <family>Kochi Mincho</family> <family>AR PL SungtiL GB</family> <family>AR PL Mingti2L Big5</family> <family>Baekmuk Batang</family> <family>Subodh1</family> <-- I added this line <default><family>serif</family></default> </alias> There are more options which I have not explored. A similar approach is taken with XftConfig ( not used with Xft2 ) In each dir where scalable fonts are found, a fonts.cache-1 is created containing font parameters & what script it caters to. eg: "mangal.ttf" 0 "Mangal:style=Regular:slant=0:weight=100:index=0:outline=True:sca lable=True:charset= |>^0oyf*?yMW<gJ !!!!#!2b&R!2b&R!!!B.|>^0nxJnss{~aQ.!!71# !!#0G!~T~}!!!!j !!#6I!!K?& !!#AL !!!W5 :lang=bh|bho|hi|kok|ks|m r|ne|sa" To make Gnome use antialiasing & xft modules ( for ttf & opentype fonts ) of pango ( instead of x modules - bdf fonts ) set export GDK_USE_XFT=1 unset export GDK_USE_XFT=0 I think I should put this in a howto/tutorial. I have already mailed this info several times :) Regards, Karunakar |