http://www.xfree86.org
http://www.truetype-typography.com/
http://spaces.msn.com/hum998/blog/cns!aa0c007cc0f2dc67!148/
http://www.freetype.org/
2005-08-24 10:00 am
作者:linux宝库 (http://www.linuxmine.com)
来自:linux宝库 (http://www.linuxmine.com)
现存:http://www.linuxmine.com/4157.html
联系:linuxmine#gmail.com
不明白?欢迎到 linux论坛 (http://bbs.linuxmine.com) 参加讨论!
X Window是所谓client-server结构,这里的server管显示(输出)、键盘和
鼠标(输入)部分,而client则是你正在用的程序,比如编辑器。Server收集
键盘和鼠标的输入,送到编辑器这一client,编辑器经过处理后,回过来再让
server去显示一些字到屏幕上,来回折腾。
怎样显示一个字呢?
一个字实际上就是一个小图,如果小图上的点非黑即白,就称为黑白点阵;
如果小图上的点可以有不同的亮度甚至颜色,则称为AA点阵。每个字,也就
是每个小图都有固定的编号,编辑器(client)可以只告诉server某个编号,
server根据该编号去找出对应的小图,这种方案就是所谓的server side
font,如FreeType,X-TrueType等backend就属此类;如果编辑器自己去找小
图,干脆把小图送给server去显示,这种方案就是所谓client side font,
Xft属这一类。
server side font
FreeType backend: 即XF86Config中的freetype模块
X-TrueType backend: 即XF86Config中的xtt模块
client side font
Xft: 设置文件是fonts.conf
还有一类,xfs,跟server side font一样,client把字编码传给server,但
server并不直接从字库中读出对应该编码的小图,而是把编码再传给另外
的所谓font server,由font server去字库找出对应的图,返回给X server
去显示,姑且将这种方式称为font server font:
font server font
xfs: 设置文件是X11/fs/config
不管是哪一类,最终都要去字库文件读出对应编码的小图,至少对TrueType
格式的字库文件而言,xtt也好,freetype也好,Xft也好,几乎都用到了
FreeType这一字库engine,虽然xtt没人继续改进,还是用FreeType 1,别人
都改用FreeType 2了。正因为大家都用FreeType字库engine,使得xtt,
freetype,Xft这些名字容易弄混,让人头大。解决的办法很简单:不要再去
管什么xtt,不要再去管什么freetype,不要再去管什么xfs:
只要弄清Xft就够了。
X字库设置必读: Juliusz Chroboczek的Fonts in XFree86
http://www.xfree86.org/~dawes/4.3.0/fonts.html
1. What is a font server?
The benefit of running a font server is speed, fonts are loaded from xfs memory cache instead of disk when needed. The disadvantage is that font servers uses memory, 5M to xxM depending on the number of fonts.
xfs is the default font server included with xfree 4.2.x/4.3.x.
Facts about fonts
Many applications, specially those based on KDE, loads alot of fonts into memory when they are started. Do keep in mind that the more fonts you have installed, the slower applications will start. Even though this delay will be shorter when using xfs, it still remains a fact that the more fonts you have installed, the slower applications start. Response times when using applications (things like fonts list boxes with font previewing) may also seem slower with more fonts. Basically less is more, a small selection of good and usable fonts are preferrable to a large number of ugly and rare-used bloat.
2. Running a xfs font server
The xfs font server is configured by the file
/etc/X11/fs/config
Add no-listen = tcp if the font server will only serve the box it is running on. When using the box as a font server for a LAN, make sure it's commented # out: #no-listen = tcp
Example for a server:
#no-listen = tcp
client-limit = 25
clone-self = on
clone-self makes xfs start another font server when client-limit is reached.
xfs default -port is 7100.
Make sure you add xfs as a boot (init) service
For more information, read the xfs manpage
On Gentoo Linux, the port is set in
/etc/conf.d/xfs
by the options
XFS_PORT="-1"
SETUP_FONTDIRS="yes"
When using xfs as a stand-alone server on slow boxes SETUP_FONTDIRS="no" is recommended.
Use XFS_PORT="7100" to run xfs as a shared server (and make sure you do not have no-listen = tcp
in /etc/X11/fs/config
)
3. xfs with XFree (xf86config)
In /etc/X11/XF86Config
, add a FontPath to your font server and # comment the FontPath lines that point to local folders. For compatiblity some distributions name the config files XF86Config-4 for XFree 4.x and XF86Config for the old 3.x versions (Mandrake, Redhat).
To use a local xfs server with XFree (no-listen = tcp, XFS_PORT="-1"
), add:
FontPath "unix/:-1"
The format used is:
transport/hostname:port
Example of using a running on your LAN:
FontPath "tcp/192.168.0.1:7100"
XFree configuration
How to configure and tune your XFree server
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> width="468" scrolling="no" height="60" frameborder="0" name="google_ads_frame" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-4146986338620964&dt=1147248160375&lmt=1147244930&format=468x60_as&output=html&url=http%3A%2F%2Flinuxreviews.org%2Fhowtos%2Fxfree%2Findex.html.en&color_bg=EBFFED&color_text=6F6F6F&color_link=0000CC&color_url=008000&color_border=A8DDA0&ad_type=text_image&ref=http%3A%2F%2Flinuxreviews.org%2Fhowtos%2Fxfree%2Fxfs%2F&cc=100&u_h=1024&u_w=1280&u_ah=946&u_aw=1280&u_cd=16&u_tz=480&u_his=2&u_java=true&u_nplug=16&u_nmime=53" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true"> |
- The XFree config file
- ATI Based Graphics Cards
- Starting applications on another screen or computer
- Keyboard shortcuts
1. The XFree config file
XFree is configured by the textfile /etc/X11/XF86Config.
Some distributions (Redhat/Mandrake) use two config files, for those the system is:
/etc/X11/XF86Config | Configuration for XFree 3.x |
/etc/X11/XF86Config-4 | Configuration for XFree 4.x |
The default for XFree is /etc/X11/XF86Config.
2. ATI Based Graphics Cards
Gentoo ATI Radeon FAQ answers most questions about ATI based graphics cards and is also relevant for other distributions.
3. Starting applications on another screen or computer
If you have more than one display connected to your box and these are configured in XF86Config as seperate screens (not a shared desktop like xinerama or Nvidias TwinView does it) then your first display is named 0.0, your second 0.1, your thrid 0.2 and so on. The first number points to the number of the X-server you are using, unless you know you started a second one you only have one, named 0, running.
By using the variable DISPLAY=
you can start applications directly on the screen of your prefernece.
Example:
DISPLAY=localhost:0.1 gqview
Most, but not all applications also supports choosing screen with the option --display=
:
gqview --display=localhost:0.1
If you need to run a program like xmame through a frontend like gxmame and you want to start it on another display, you can make a script and use $*
to pass all command line options on to the program in question. Example /usr/games/bin/xmame.tv
:
DISPLAY=localhost:0.1
xmame.xgl $*
X11 has great support for using remote displays on other boxes. This is done the same way, but first you most use xhost
to tell the X-server where you wil be displaying the program that it is OK for the box where you are running the program to use that display.
Box A is a powerfull server and will be running our programs. It has IP 192.168.0.20.
Box B is a Pentium 75 and will only display programs and read the keyboard and mouse. It has IP 192.168.0.90.
Start X11 on Box B and run the command:
xhost 192.168.0.20
.
Now log into Box A using ssh, set the display to Box B and run your programs as usual:
ssh you@192.168.0.20
DISPLAY=192.168.0.20:0.0
gqview &
Note that Gentoo Linux users most run xhost localhost
as the user who started (or logged into) the X11 server to allow other users (like root) run grapical programs.
4. Keyboard shortcuts
ctrl alt + | smaller resolution |
ctrl alt - | bigger resolution |
shift num-lock | mouse-emulation of/off (arrow keys, + and - are mouse-buttons) |
ctrl alt backspace | Kills and closes the X server (emergency only) |
http://linuxreviews.org/howtos/index.html.en
Window 与 字符集 字体文件 相关内容
National Language Support (.nls) files
National Language Support files contain data on how to support different languages
Code Page
A code page is a translation table that the Windows CE OS uses to enable conversions from ANSI to Unicode
A code page is an ordered set of characters in which a numeric index (also known as a code point value) is associated with each character. The first 128 characters of each code page are functionally the same and include all characters needed to type English text. The upper 128 characters of OEM and ANSI code pages contain characters used in a language or group of languages.
Language Group
The language group controls which system locale, user locales, input locales, and user interface (UI) languages can be selected. For example, Windows installs the Western Europe and United States language group by default. This default cannot be removed. For each localized version, the specified language group is the default and cannot be removed. Thus, if the English version of Windows is installed in a non-English speaking country/region, the user will typically install another language group.
When adding a language group, Windows copies (but does not activate) the necessary keyboard files, Input Method Editors (IMEs), TrueType Font files, bitmap font files, and National Language Support (.nls) files. Adding a language group also adds registry values for font linking and installs scripting engines for complex script languages (Arabic, Hebrew, Indic, and Thai).
In addition to the Western Europe and United States language group there are 16 other language groups:
Arabic | Indic |
Any number and combination of language groups can be installed on any system. For example, a Spanish user would install the Cyrillic language group to work on Russian texts. In this case, the word processing application needs to support the Cyrillic language group also.
Note Adding the appropriate language group will not automatically enable an application to accept text. Testing is recommended. For example, applications that are not completely Unicode-compliant might require the system locale to be changed.
National Language Support in Windows Server 2003, Windows XP, and Windows 2000
National Language Support (NLS) provides a standardized method of supporting multiple international locales, code pages, input methods, sort orders, and number/currency/time/date formats.
The Win32® NLS API provides developers with a way to access system-provided Unicode-to-ANSI and ANSI-to-Unicode conversion services. Microsoft® Windows Server™ 2003, Windows® XP, and Windows 2000 supply EBCDIC-to-Unicode and Unicode-to-EBCDIC translation tables for all of the popular host code pages.
The SNANLS API leverages the existing work done to support the NLS API on Server™ 2003, Windows® XP, and Windows 2000. Microsoft Host Integration Server 2004 takes advantage of these EBCDIC-to-Unicode-to-ANSI and ANSI-to-Unicode-to-EBCDIC code page conversion services.
Currently, the Win32 NLS API only supports SBCS EBCDIC code pages. However, future versions of the NLS API will support DBCS EBCDIC. SNANLS currently uses TrnsDT for DBCS conversions.
附录:
A) |
| Filename (Windows 95/98) | Filename (Windows NT) |
932 | Japanese | cp_932.nls | c_932.nls |
936 | Simplified Chinese | cp_936.nls | c_936.nls |
949 | Unified Hangul | cp_949.nls | c_949.nls |
950 | Traditional Chinese | cp_950.nls | c_950.nls |
1250 | Central / Eastern European | cp_1250.nls | c_1250.nls |
1251 | Cyrillic | cp_1251.nls | c_1251.nls |
1252 | Latin I | cp_1252.nls | c_1252.nls |
1253 | Greek | cp_1253.nls | c_1253.nls |
1254 | Turkish | cp_1254.nls | c_1254.nls |
1255 | Hebrew | cp_1255.nls | c_1255.nls |
1256 | Arabic | cp_1256.nls | c_1256.nls |
1257 | Baltic | cp_1257.nls | c_1257.nls |
B)Locale ID (LCID) Values as Assigned by Microsoft
--比如我们常见的2052就代表简体中文(Chinese - People's Republic of China)
C)The following table shows the code pages supported by Windows CE.
Code page | ANSI, OEM or other standards | Description |
437 | OEM | Microsoft® MS-DOS® United States |
708 | OEM | Arabic (ASMO 708) |
709 | OEM | Arabic (ASMO 449+, BCON V4) |
710 | OEM | Arabic (Transparent Arabic) |
720 | OEM | Arabic (Transparent ASMO) |
737 | OEM | Greek (OEM 437G) |
775 | OEM | Baltic |
850 | OEM | MS-DOS Multilingual (Latin I) |
852 | OEM | MS-DOS (Latin II) |
855 | OEM | IBM Cyrillic (primarily Russian) |
857 | OEM | IBM Turkish |
858 | OEM | MS-DOS Multilingual (Latin I + Euro) |
860 | OEM | MS-DOS Portuguese |
861 | OEM | MS-DOS Icelandic |
862 | OEM | Hebrew |
863 | OEM | MS-DOS Canadian-French |
864 | OEM | Arabic |
865 | OEM | MS-DOS Nordic |
866 | OEM | MS-DOS Russian |
869 | OEM | MS-DOS Modern Greek |
874 | ANSI & OEM | Thai |
932 | ANSI & OEM | Japanese Shift-JIS |
936 | ANSI & OEM | ANSI & OEM Chinese: PRC; Macau SAR, PRC; Singapore (Simplified GBK) |
949 | ANSI & OEM | Korean |
950 | ANSI & OEM | ANSI & OEM Chinese: Taiwan; Hong Kong SAR, PRC (Traditional Big5) |
1200 | ANSI | Unicode (BMP of ISO 10646) |
1250 | ANSI | Microsoft® Windows® 3.1 Central European |
1251 | ANSI | Windows 3.1 Cyrillic |
1252 | ANSI | Windows 3.1 US |
1253 | ANSI | Windows 3.1 Greek |
1254 | ANSI | Windows 3.1 Turkish |
1255 | ANSI | Hebrew |
1256 | ANSI | Arabic |
1257 | ANSI | Baltic |
1258 | ANSI & OEM | Vietnamese |
1361 | ANSI & OEM | Korean (Johab) |
20000 | OTHER | CNS - Taiwan |
20001 | OTHER | TCA - Taiwan |
20002 | OTHER | E-Ten - Taiwan |
20003 | OTHER | IBM5550 - Taiwan |
20004 | OTHER | TeleText - Taiwan |
20005 | OTHER | Wang - Taiwan |
20127 | OTHER | US ASCII |
20261 | OTHER | T.61 |
20269 | ISO | ISO-6937 |
20866 | OTHER | Ukrainian - KOI8-U |
21027 | OTHER | Ext Alpha Lowercase |
21866 | OTHER | Ukranian - KOI8 |
28591 | ISO | ISO 8859-1 Latin I |
28592 | ISO | ISO 8859-2 Eastern Europe |
28593 | ISO | ISO 8859-3 Turkish |
28594 | ISO | ISO 8859-4 Baltic |
28595 | ISO | ISO 8859-5 Cyrillic |
28596 | ISO | ISO 8859-6 Arabic |
28597 | ISO | ISO 8859-7 Greek |
28598 | ISO | ISO 8859-8 Hebrew |
28599 | ISO | ISO 8859-9 Latin Alphabet No.5 |
29001 | OTHER | Europa 3 |
相关资料:
NLS Terminology(a number of terms that are important when discussing national language support)
Multiple Language Resource Files( Installing the National Language Support Files on Windows2000)
ISO Code Page Support Using Host File Transfer(部分codepage 对应转换内容 )
Global Development and Computing Portal at Microsoft(微软国际化网站)
XADM: 如何手动添加混合语言的代码页 (Windows 区域设置 ID )
EBCDIC Code Page Support Using the ODBC Driver for DB2
http://www.freetype.org/freetype2/docs/tutorial/step1.html