Re: [cle-devel] Re: New pcf fonts
From:
http://www.linuxforum.net/cgi-
bin/perl/wwwthreads.pl?action=list&Board=chinese
Ê× Ò³
ÎÄÕÂÜöÝÍ| ²Ø¾¸ó| Ìر𱨵¼| Óʵݱí| Linux×ÊÔ´| Èí¼þ²Ö¿â|
ÂÛ̳Ë÷Òý | ÐÂÓû§×¢²á | »áÔ±µÇ¼ | ÂÛ̳¼ìË÷ | ÂÛ̳ FAQ |
Subject
Re: X ϵÄ×ÖÌåµ½µ×ÊÇÔõô»ØÊÂ?
Posted by
shuyong Posted on
1/1/00 10:34 PM
ÕâÊÇÈ¥ÄêдµÄÎÄÕµÄÒ»²¿·Ý.¿´¶®Á˸ø¸ö»ØÒô.
ÁîÈË·³ÄÕµÄ×ÖÌå
×ÖÌåÊôÓÚ×îÖ±¹ÛµÄ¶«Î÷¡õÖ±½ÓÓ°Ïì×îÖÕµÄÏÔʾºÍ´òÓ¡½á¹û¡õËùÒÔ±¶ÊܹØ×¢¡£
Ò»¡õX Âß¼×ÖÌåÃèÊö(X Logical Font Description)
ÔÚX WindowÏÂ×ÖÌåµÄÃüÃû·½Ê½ÊÇÒÔX Âß¼×ÖÌåÃèÊö(X Logical Font Description)
Ï°¹ßÃüÃûµÄ:
// font fields
// -fndry-fmly-wght-slant-sWdth-adstyl-pxlsz-ptSz-resx-resy-spc-avgWdth-
rgstry-encdng
// fndry -> foundy
// fmly -> family, font style
// wght -> weight
// slant
// sWdth -> ? width
// adstyl -> addtion style
// pxlsz -> pixel size
// ptSz -> point size
// resx -> resolution x
// resy -> resolution y
// spc -> space
// avgWdth -> average width
// rgstry -> register
// encdng -> encoding
example:
-cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-gb2312.1980-0
ÆäÖÐ:
cclib : ÖÆÔìÉÌ
song : ×ÖÌå×å, ËÎÌå
medium: ÏßȨÖØ(ÖеÈ), »¹ÓÐbold(´ÖÌå)Ñ¡Ïî
r : Çãб, r(Roman), i(Italic), o(Oblique)
normal: ×Ö·û¼¯¿í¶È, ´ËÍ⻹ÓÐ condensed, narrow, double
jiantizi: ¸½¼Ó˵Ã÷(¼òÌå×Ö)
16: ÒÔÏñËغâÁ¿µÄ¿í¶È.
160: µãÊý*10
75(1): ˮƽ·Ö±æÂÊ(dpi)
75(2): ´¹Ö±·Ö±æÂÊ(dpi)
c: ¼ä¾à, (?), m: fixed width, p: variable width
160: ƽ¾ù¿í¶È(10*pixels)
gb2312.1980: ×¢²á×Ö·û¼¯,±ê×¼Ãû
0: µÚ0Ì×,»ù±¾¼¯
¶þ¡õ×ÖÌåÃèÊöÎļþ
ÔÚ×ÖÌåͬһĿ¼Ï¡õÓÐÁ½¸öÎļþÖ¸µ¼X
windowÈçºÎ°²×°Ê¹ÓÃ×ÖÌå¡õfonts.dir/fonts.alias¡£
ËäÈ»fonts.dir¿ÉÓÉʵÓóÌÐòmkfontdirÉú³É¡õµ«Éú³ÉµÄÎļþÖÐ×ÖÌåµÄ´ÎÐò²»Ò»¶¨ºÏÊʽóMËù
ÒÔÓÐʱÐèÒªÈ˹¤µ÷Õû¡£ÒòΪ²»Á˽âTTF×ÖÌåµÄʹÓùæÔò¡õËùÒÔÕâÀïÖ»¸ø³öpcf×ÖÌåµÄÃè½çzÎÄ
¼þ¸ñʽ¡£
fonts.dir ¸ñʽ:
µÚÒ»ÐÐ:×ÖÌåÎļþµÄÊýÄ¿
ºóÃæ:×ÖÌåÎļþ X Âß¼×ÖÌåÃèÊö(×ÖÌåÕæÃû)
......
fonts.dir example:
21
ccs16.pcf.gz -cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-
gb2312.1980-0
ccs24.pcf.gz -cclib-song-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-0
ccs16_1.pcf.gz -cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-
gb2312.1980-1
ccs24_1.pcf.gz -cclib-song-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-1
ccs16f.pcf.gz -cclibf-song-medium-r-normal-fantizi-16-160-75-75-c-160-
gb12345.1990-0
ccs24f.pcf.gz -cclibf-song-medium-r-normal-fantizi-24-240-75-75-c-240-
gb12345.1990-0
ccs16f_1.pcf.gz -cclibf-song-medium-r-normal-fantizi-16-160-75-75-c-160-
gb12345.1990-1
ccs24f_1.pcf.gz -cclibf-song-medium-r-normal-fantizi-24-240-75-75-c-240-
gb12345.1990-1
hts14.pcf.gz -tlc-song-medium-r-normal--14-140-75-75-c-140-gb2312.1980-0
hts14_1.pcf.gz -tlc-song-medium-r-normal--14-140-75-75-c-140-gb2312.1980-1
cck24.pcf.gz -cclib-kai-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-0
cck24_1.pcf.gz -cclib-kai-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-1
cch24.pcf.gz -cclib-hei-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-0
cch24_1.pcf.gz -cclib-hei-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-1
ccfs24.pcf.gz -cclib-fangsong-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-0
ccfs24_1.pcf.gz -cclib-fangsong-medium-r-normal-jiantizi-24-240-75-75-c-
240-gb2312.1980-1
taipei16.pcf.gz -eten-fixed-medium-r-normal--16-150-75-75-c-160-big5.et-0
taipei24.pcf.gz -eten-fixed-medium-r-normal--24-230-75-75-c-240-big5.et-0
cns1hku16.pcf.gz -hku-fixed-medium-r-normal--16-160-72-72-c-160-
cns11643.1992.1-0
cns2hku16.pcf.gz -hku-fixed-medium-r-normal--16-160-72-72-c-160-
cns11643.1992.2-0
unifont.pcf.gz -gnu-unifont-medium-r-normal--16-160-75-75-c-80-iso10646-1
fonts.alias ¸ñʽ:
×ÖÌå±ðÃû X Âß¼×ÖÌåÃèÊö(×ÖÌåÕæÃû)
......
fonts.alias example:
ccs16 -cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-gb2312.1980-0
cclib16 -cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-
gb2312.1980-0
ccs24 -cclib-song-medium-r-normal-jiantizi-24-240-75-75-c-240-gb2312.1980-0
ccs16_1 -cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-
gb2312.1980-1
cclib16_1 -cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-
gb2312.1980-1
ccs24_1 -cclib-song-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-1
ccfs24 -cclib-fangsong-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-0
ccfs24_1 -cclib-fangsong-medium-r-normal-jiantizi-24-240-75-75-c-240-
gb2312.1980-1
cck24 -cclib-kai-medium-r-normal-jiantizi-24-240-75-75-c-240-gb2312.1980-0
cch24 -cclib-hei-medium-r-normal-jiantizi-24-240-75-75-c-240-gb2312.1980-0
cck24_1 -cclib-kai-medium-r-normal-jiantizi-24-240-75-75-c-240-gb2312.1980-
1
cch24_1 -cclib-hei-medium-r-normal-jiantizi-24-240-75-75-c-240-gb2312.1980-
1
ccs16f -cclibf-song-medium-r-normal-fantizi-16-160-75-75-c-160-
gb12345.1990-0
ccs24f -cclibf-song-medium-r-normal-fantizi-24-240-75-75-c-240-
gb12345.1990-0
ccs16f_1 -cclibf-song-medium-r-normal-fantizi-16-160-75-75-c-160-
gb12345.1990-1
ccs24f_1 -cclibf-song-medium-r-normal-fantizi-24-240-75-75-c-240-
gb12345.1990-1
hts14 -tlc-song-medium-r-normal--14-140-75-75-c-140-gb2312.1980-0
hts14_1 -tlc-song-medium-r-normal--14-140-75-75-c-140-gb2312.1980-1
taipei16 -eten-fixed-medium-r-normal--16-150-75-75-c-160-big5.et-0
taipei24 -eten-fixed-medium-r-normal--24-230-75-75-c-240-big5.et-0
ÕâÑùÔÚʹÓùý³ÌÖСõ³ÌÐò¼È¿ÉÒÔʹÓÃ×ÖÌåÕæÃû¡õÒ²¿ÉÒÔʹÓÃ×ÖÌå±ðÃû×°ÔØX×ÖÌå¡£
Èý¡õX×ÖÌåµÄʹÓÃ
Ó¦ÓóÌÐòµ÷ÓÃXLoad(Query)Fontº¯Êý×°ÔØ×ÖÌå¡£X window»á¾¡Á¿½âÊͺÍ×°ÔØ×ÖÌå¡õ
ÆäÖаüÀ¨²ÎÊýÀïʹÓÃ"*","?"ͨÅä·û¡õ»¹ÓÐËõ·Å×ÖÌå¡£ÆäÖÐX Âß¼×ÖÌåÃèÊö×ֶζÔ×ÖÌå
Ëõ·ÅÓÐÖ±½ÓÓ°ÏìµÄÊÇpixel size/point size, average width×ֶΡ£ÆäÖÐpixel
sizeµÄ
ÓÅÏȼ¶´óÓÚpoint size¡£Ò²¾ÍÊÇ¡õÈç¹û´«¸øXLoadFontµÄ×ÖÌå²»´æÔÚ¡õX window»á¸ù¾Ý
ÏÖÓеÄÒ»¸öÃû×ÖÆ¥Åä¡õ´óС(pixel size/point size, average
width)²»Í¬µÄ×ÖÌå¡õÔÚ
ÄÚ´æÀïÉú³ÉÒ»¸öÐÂ×ÖÌå¡£ÒòΪX
windowϵÄÖÐÎÄ×ÖÌåºÜÉÙ¡õÒ»°ãÖ»Ìṩ16ºÍ24µãÕóÁ½ÖÖ
´óС¡£ËùÒÔ×ÖÌåËõ·Å»úÖƾÍÏԵúÜÖØÒª¡£ÕâÖÖ»úÖƵĺô¦ÊÇÖ»ÐëÌṩÉÙÁ¿µÄ×ÖÌå¡õ¾ÍÉýi
ÒÔÓ¦¸¶´ó¶àÊýÇé¿ö¡£È±µãÒ²ÊÇÓеġõ¾ÍÊÇÉú³É×ÖÌåµÄËٶȺÜÂý¡õÑÓ³ÙÊÇÒÔÃë¼ÇµÄ¡£ÈçâùG
ÊÇGB2312×ÖÌ廹ºÃ¡õ²»µ½7000¸ö×Ö¡£¶øUnicode»òGBK×ÖÌå¡õºº×Ö¾ÍÓÐ20902¶à¸ö¡õÒ»¸ö
¸ö
½øÐÐËõ·Å¡õÑÓ³Ù¿ÉÏë¶øÖª¡£µ«Òª×¢ÒâµÄÊÇ¡õX
windowÖ»ÊÇÔÚ×°ÔØÉú³É×ÖÌåʱÓÐÑÓ³Ù¡õ×Ö
ÌåÉú³Éºó¡õXDraw*º¯ÊýÏÔʾËٶȲ¢Ã»ÓÐÑÓ³Ù¡£
ÏÂÃæ¾ÙÀý˵Ã÷¡£Èç¹ûÓÐ×ÖÌå¡õ
ccs16.pcf.gz -cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-
gb2312.1980-0
ÏëÓÃ×ÖÌå¡õ
"-*-song-medium-r-normal-jiantizi-12-120-75-75-c-100-gb2312.1980-0"
³ÌÐòÀïÖ»ÐëÖ±½Óµ÷Óü´¿É¡õ
......
char *font_name = "-*-song-medium-r-normal-jiantizi-12-120-75-75-c-100-
gb2312.1980-0";
XFontStruct *zh_font;
......
zh_font = XLoadFont(display, font_name);
if (zh_font == NULL) {
printf("not find this font: %s\n", font_name);
exit(1);
}
......
ҪעÒâµÄÊÇ¡õÈç¹ûÕâôд
ÔÚfonts.dirÖÐÓÐ
ccs16_1.pcf.gz ccs16_1
ÔÚfonts.aliasÖÐÓÐ
-cclib-song-medium-r-normal-jiantizi-16-160-75-75-c-160-gb2312.1980-1
ccs16_1
X windowÒ²ÈÏ¿É¡õµ«ÊǾͲ»ÄÜËõ·Å×ÖÌå¡£
ÕâÀïÒªÌÖÂÛ×ÖÌåËõ·Å»úÖÆ¡õÊÇΪÁ˽â¾öXÍâ¹ÒʽÖÐÎÄƽ̨µÄ×Ö·û´®¶¨Î»ÎÊÌâ¡£Èç¹û¹â
±êÒª¶¨ÔÚÁ½¸ö×Ö·ûÖ®¼ä¡õ¾ÍÒªÖªµÀÕâµãµÄλÖá£XÓ¦ÓóÌÐòÒ»°ãÊǵ÷Óú¯ÊýXTextWidth
(16)¡õ
XTextExtents(16)¡õXQueryTextExtents(16)ÒÔÈ·¶¨×Ö·û´®µÄ¿í¶È¡£ËùÒÔXÍâ¹ÒʽÖÐÎÄÉýÏãO
Òª½ØÈ¡ÕâЩº¯ÊýÒÔ±ã¶ÔÖÐÓ¢ÎÄ»ìÅŵÄ×Ö·û´®½øÐÐ׼ȷ¶¨Î»¡£µ«ÓÐЩ³ÌÐòΪÁËËٶȡõÊDZ©¡õܧGetFontProperty
º¯Êý»òÖ±½ÓÔÚXFontStruct½á¹¹ÀïÈ¡µÃµ¥¸ö×Ö·ûµÄ¿í¶È¡õ³ËÉÏ×Ö·û¸öÊýµÃµ½×Ö·û´®µÄ¿í
¶È¡£
Èç¹ûASCII×ÖÌåÓбê×¼¸ß¿í±È¡õÒ²ÊÇûÓÐÎÊÌâ¡£Ëùν±ê×¼¸ß¿í±È¾ÍÊÇASCII×ÖÌåµÄ¿í:¸ß
Ϊ1/2¡õ
ÏàÓ¦µÄÖÐÎÄ×ÖÌå¾ÍÊÇ1:1¡£Èç¹û²»ÊÇÕâÑù¡õ¹â±ê¶¨Î»¾ÍÓÐÎÊÌâ¡£ÔÙÓоÍÊÇ×Ö·û¸ß¶È¡õÒ»
°ã
ÊÇÖÐÎÄ×ÖÌåÂÔ¸ßÓÚASCII×ÖÌå¾ÍÃÀ¹ÛÁË¡£µ«¾ßÌåÊýÖµÒª¿ØÖƺáõ·ñÔòÌ«°«²»ºÃ¿´¡õÌ«¸ß
ÓÖ
»á±»Ï÷ȥͷ²¿¡£ËùÒÔ×Ö¼ä¾àºÍÐмä¾àÄ¿Ç°ÊǺܷ³ÄÕµÄÎÊÌâ¡£½â¾öµÄ·½·¨¿ÉÄÜÓÐһЩ¡õ
1¡õ½Ø»ñ¸ü¶àµÄº¯Êý¡õ»òÐÞ¸ÄASCII×ÖÌåµÄ¸ß¶ÈºÍ¿í¶È¡£ÕâÒªÇó¶ÔX windowÓкÜÉîµÄ
Á˽⡣ÕâÒ²ÊÇÒ»¸ö³ÔÁ¦²»Ìֺõķ½°¸¡õÒòΪ×ÜÓÐÊè©¡õX
windowµÄº¯ÊýÒ²»á·¢Õ¹ºÍ±ä»¯¡õ
ÄÇô¾Í»áÓÐÒź¶¡£cleex for Linux
1.0ÔÚËٶȺͶ¨Î»ÉϽϺõؽâ¾öÁËÕâ¸öÎÊÌâ¡õ¿ÉÄÜÊÇ
ʹÓÃÁËÕâ¸ö·½°¸¡£
2¡õʹÓÃ×ÖÌåËõ·Å»úÖÆ¡õʹºº×Ö´óСºÍASCII×ÖÌåÏàÆ¥Åä¡£Õâ¸ö·½°¸µÄÎÊÌâÊÇ×°ÔØ×ÖÌå
µÄËٶȺͺķѵÄ×ÊÔ´¡£ÎÒʵÑéÁËÕâ¸ö·½°¸¡õʹÓÃNetScapeä¯ÀÀÍøÒ³¡õ·¢Ïֺܶàʱ¼ä»¨ÓñbÁË
×°ÔØ×ÖÌåÉÏ¡£¶øÇÒ¡õÈçºÎ¹ÜÀíÕâЩ×ÖÌåÒ²ÊÇÒ»¸öÎÊÌ⡣ʹÓÃTTF×ÖÌå¿ÉÄÜ¿ÉÒÔÍêÃÀµØ½â
¾ö
Õâ¸öÎÊÌâ¡£ÎÒʹÓÃTLC4.0µÄZhWinPro2.0¡õ·¢ÏÖÒÔÇ°¶¨Î»²»×¼µÄÈí¼þ¶¼Ã»ÓÐÎÊÌâÁË¡£¿´
À´
ʹÓÃTTF×ÖÌåÊǽñºóµÄ·½Ïò¡£
ʹÓÃTTF×ÖÌåʼÖÕÊÇÓÕÈ˵Ļ°Ìâ¡£µ«ÏÖÔÚÁ˽ⲻ¶à¡õÖ»Äܼòµ¥Ì¸Ì¸´ÓTTF×ÖÌåÉú³Ébdf/p
cf
×ÖÌåµÄÎÊÌâ¡£ÒòΪÏÖÔÚÖÐÎÄpcf×ÖÌåºÜÉÙ¡õÖ»ÓÐËÎÌå¡õ·ÂËΡõºÚÌå¡õ¿¬ÌåËÄÖÖ¡£ÒªÏëÓÐ
¸ü
¶àµÄ×ÖÌå¡õÓиöÈ¡Çɵķ½·¨¾ÍÊÇʹÓÃfreetype¿â¡£ÓÃttftobdf³ÌÐòÉú³Ébdf×ÖÌå¡õÔÙÓÃ
bdftopcf
³ÌÐòÉú³Épcf×ÖÌå¡£µ«ÕâÖÖ·½·¨Éú³ÉµÄ×ÖÌåËõ·Åºó±È½ÏÄÑ¿´¡õ¶øÇÒ²»ÒË¿ØÖÆ¡£Õâ¿ÉÄÜÊÇ
ttf-
>bdfµÄת»»¹ý³Ì¶ªÊ§ÁËÐÅÏ¢¡õ¸ß¿í±ÈÒ²ºÍ±ê×¼µÄ²»Ò»Ñù¡£»úÆ÷Éú³ÉµÄ¶«Î÷¾ÍÊÇ»úе¡õ
ÊDz»ÄܺÍÊÖ»æµÄ×ÖÌåÏà±ÈµÄ¡£Í¬Ê±¡õÒòΪTTF¼¼ÊõÒѳÉÊì¡õËùÒÔҲûÓбØÒª¼ÌÐø¿ª·¢¸ü
¶àµÄpcf×ÖÌå¡£X
window½«½ÓÊܺʹóÁ¿Ê¹ÓÃTTF×ÖÌå¡£¶øpcf×ÖÌå½ñºóÖ÷ÒªÓÃÔÚ±ê×¼×ÖÐÍ£¨
ÈçËÎÌ壩¡õСµãÕó¡õÍøÉÏ¿ìËÙÏÂÔØ´«Êä·½Ãæ¡£
ÕâÀï˳±ã¾ÀÕýÒ»¸ö¸ÅÄîÉϵÄС´íÎó¡£ÔÚTLC4.0µÄfonts.aliasÖÐÓÐ
-tlc-song-medium-r-normal--14-140-75-75-c-140-gb2312.1980-1 hts14_1
-tlc-song-medium-r-normal--14-140-75-75-c-140-gb13000.1993-1 hts14_1
hts14_1ÊÇGBK±ê×¼µÄ×ÖÌå¡£µÚ¶þÐаÑGBK×ÖÌå½Ð×öGB13000×ÖÌå¡õÕâÊDz»¶ÔµÄ¡£³ÂÏòÑô±©sд
µÄ³ÌÐògbpcfÒ²ÓÐÀàËƵÄÇé¿ö¡õGBKºÍGB13000ÊÇÁ½ÖÖ²»Í¬µÄ±àÂëÌåϵ¡£¾ßÌå¼ûϽڵÄÌÖ
ÂÛ¡£
Entire Thread
Subject
Posted by
Posted On
X ϵÄ×ÖÌåµ½µ×ÊÇÔõô»ØÊÂ?
ameng
1/1/00 8:24 PM
Re: X ϵÄ×ÖÌåµ½µ×ÊÇÔõô»ØÊÂ?
c_liang
1/2/00 10:56 AM
Re: X ϵÄ×ÖÌåµ½µ×ÊÇÔõô»ØÊÂ?
shuyong
1/1/00 10:34 PM
Go to¡õ
Powered by China Linux Forum
--
[ This mail was originally sent to debian-chinese@lists.debian.org ]
[ and was forwarded to this list automatically. Big5 characters are ]
[ also converted to GB at the same time, Please note that there may ]
[ be errors during the conversion as this is not done by a human! ]
Reply to: