27658
Comment:
|
27678
|
Deletions are marked like this. | Additions are marked like this. |
Line 223: | Line 223: |
{i} "[http://unifont.org/iuc27/html/ICUPresentation.html The Penguin and Unicode]" is a good overview of modern X Window system. Other documentations at [http://unifont.org/] should provide good information on Unicode fonts, Unicode-enabled software, internationalization, and Unicode usability issues on [http://en.wikipedia.org/wiki/Free_and_open_source_software free/libre/open source (FLOSS)] operating systems. |
|
Line 290: | Line 292: |
{i} Documentations for Unicode fonts, Unicode-enabled software, internationalization, and Unicode usability issues on [http://en.wikipedia.org/wiki/Free_and_open_source_software free/libre/open source (FLOSS)] operating systems is available at [http://unifont.org/]. Good overview of X Window system is provided as "[http://unifont.org/iuc27/html/ICUPresentation.html The Penguin and Unicode]". |
Do not use Edit(GUI) button.
?TableOfContents(4)
Copyright 2007, 2008 Osamu Aoki GPL, (Please agree to GPL, GPL2, and any version of GPL which is compatible with DSFG if you update any part of wiki page)
I welcome your contributions to update the wiki pages. You must follow these rules:
Do not use Edit(GUI) button of MoinMoin.
- You can update anytime for:
- grammar errors
- spelling errors
- moved URL location
- package name transition adjustment (emacs23 etc.)
- clearly broken script.
- Before updating real contents:
Read "[http://wiki.debian.org/DebianReference/Test Guide for contributing to Debian Reference]".
The X window system
The X window system on the Debian system is based on the source from [http://www.x.org/ X.Org]. As of March 2008, they are ?X11R7.1(etch), ?X11R7.3(lenny) and ?X11R7.3(sid) as of September 2008.
Key packages
There are a few (meta)packages provided to ease installation.
List of key (meta)packages for X window. |
1 |
2 |
3 |
(meta)package |
popcon |
size |
description |
xorg |
- |
- |
This metapackage provides the X libraries, an X server, a set of fonts, and a group of basic X clients and utilities. |
xserver-xorg |
- |
- |
This package provides the full suits of the X server and its configuration. |
xbase-clients |
- |
- |
This package provides a miscellaneous assortment of the X clients. |
x11-common |
- |
- |
This package contains the filesystem infrastructure for the X window system. |
xorg-docs |
- |
- |
This package contains miscellaneous documentation for the X.Org software suite. |
xspecs |
- |
- |
This package contains X protocol, extension, and library technical specifications. |
For the basics of X, refer to X(7), [http://www.tldp.org/HOWTO/XWindow-User-HOWTO.html the LDP XWindow-User-HOWTO].
Setting up Desktop environment
You can setup KDE, GNOME, or Xfce environment from the aptitude under the task menu.
See [http://www.xwinman.org Window Managers for X] for the guide of the window managers and the desktop environments for the X window system.
The server/client relationship
The X window system is activated as a combination of the server and client programs. The meaning for the words server and client with respect to the words local and remote requires attention here:
List of server/client terminology. |
|
type |
description |
X server |
a program run on a local host connected to the user's display and input devices. |
X client |
a program run on a remote host that processes data and talks to the X server. |
application server |
a program run on a remote host that processes data and talks to the clients. |
application client |
a program run on a local host connected to the user's display and input devices. |
The X server
See xorg(1) for X server information.
The (re)configuration of the X server
To (re)configure an X server,
# dpkg-reconfigure --priority=low x11-common # dpkg-reconfigure --priority=low xserver-xorg
will generate a new /etc/X11/xorg.conf file using dexconf(1).
If you have manually edited this /etc/X11/xorg.conf file but would like it to be automatically updated again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Please check your X configuration with respect to the specification of your monitor carefully. For the large high resolution CRT monitor, it is a good idea to set the refresh rate as high as your monitor can handle (85 Hz is great, 75 Hz is OK) to reduce flicker. For the LCD monitor, slower standard refresh rate (60Hz) is usually fine due to its slow response.
Be careful not to use too high refresh rate which may cause fatal hardware failure of your monitor system.
The connection methods to the X server
There are several ways of getting the "X server" (display side) to accept connections from an "X client" (application side):
List of connection methods to the X server. |
2 |
3 |
4 |
|
|
|
method |
package |
popcon |
size |
user |
encryption |
pertinent use |
xhost command |
xbase-clients |
25829 |
- |
unchecked |
no |
deprecated |
xauth command |
xbase-clients |
25829 |
- |
checked |
no |
for local connection via pipe |
ssh -X command |
openssh-client |
29037 |
- |
checked |
yes |
for remote network connection |
Gnome display manager |
gdm |
17331 |
- |
checked |
no(XDMCP) |
for local connection via pipe |
KDE display manager |
kdm |
5781 |
- |
checked |
no(XDMCP) |
for local connection via pipe |
X display manager |
xdm |
645 |
- |
checked |
no(XDMCP) |
for local connection via pipe |
?WindowMaker display manager |
wdm |
253 |
- |
checked |
no(XDMCP) |
for local connection via pipe |
Secure display manager |
sdm |
25 |
- |
checked |
yes |
for remote SSH network connection (thin client) |
Linux Terminal Server Project display manager |
ldm |
3 |
- |
checked |
yes |
for remote SSH network connection (thin client) |
Do not use remote TCP/IP connection over unsecured network unless you have very good reason. A remote TCP/IP socket connection without encryption is prone to the eavesdropping attack and is disabled by default on the Debian system. Use ssh -X.
You can dare to enable remote TCP/IP connection by setting DisallowTCP=false in /etc/gdm/gdm.conf and by removing -nolisten from lines found by "find /etc/X11 -type f -print0 | xargs -0 grep nolisten", if you are in the fully secured environment.
Do not use [http://en.wikipedia.org/wiki/X_display_manager XDMCP connection over unsecured network] either. It sends data via UDP without encryption and prone to the eavesdropping attack.
Starting the X window system
The X Window system is usually started as an X session which is the combination of an X server and connecting X clients. For normal desktop system, both of them are executed on the workstation.
To start the X Window system,
startx command started from the command line, or
one of the [http://en.wikipedia.org/wiki/X_display_manager X display manager] daemon programs *dm started from the end of the start up script in /etc/rc?.d/ directory (? corresponding to the runlevel)
are used to start the [http://en.wikipedia.org/wiki/X_session_manager X session]. (The start up script for the display manager daemons checks the content of the /etc/X11/default-display-manager file before actually executing themselves.)
See @{@specificlocaleonlyunderxwindow@}@ for initial environment variables of the X display manager.
Essentially, all these programs execute the /etc/X11/Xsession script. Then the /etc/X11/Xsession script performs run-parts like action to execute scripts in the /etc/X11/Xsession.d/ directory. This is essentially an execution of a program which was first found in the following order with the exec command:
The script specified as the argument of /etc/X11/Xsession by the X display manager, if it is defined.
The ~/.xsession or ~/.Xsession script, if it is defined.
The /usr/bin/x-session-manager command, if it is defined.
The /usr/bin/x-window-manager command, if it is defined.
The /usr/bin/x-terminal-emulator command, if it is defined.
This process is affected by the content of the /etc/X11/Xsession.options file. The exact programs to which these usr/bin/x-* commands point, are determined by the Debian alternative system and changed by update-alternatives --config x-session-manager etc.
Starting X session with gdm
The gdm program lets you select the session type and language (or locale) of the X session from its menu. It keeps the selected default value in ~/.dmrc as, e.g.:
[Desktop] Session=default Language=ja_JP.UTF-8
Customizing the X session (classic method)
On a system where /etc/X11/Xsession.options contains a line allow-user-xsession without preceding # characters, any user who defines ~/.xsession or ~/.Xsession will be able to customize the action of /etc/X11/Xsession by completely overiding the system code. The last command in the ~/.xsession file should use form of exec some-window/session-manager to start your favorite X window/session managers.
Customizing the X session (new method)
Here are new methods to customize the X session without completely overiding the system code as above.
The display manager gdm can select a specific session and set it as the argument of /etc/X11/Xsession.
The ~/.xsessionrc file is executed as a part of start up process. (Desktop independent)
The ~/.gnomerc file is executed as a part of start up process. (Gnome Desktop only)
The GUI program based session management software can use the ~/.gnome2/session file etc..
Connecting a remote X client via SSH
The use of ssh -X enables a secure connection from a local X server to a remote application server.
Set X11Forwarding entries to yes in /etc/ssh/sshd_config of the remote host, if you want to avoid -X command-line option.
- Start the X server on the local host.
Open an xterm in the local host.
Run ssh to establish a connection with the remote site.
localname @ localhost $ ssh -q -X loginname@remotehost.domain Password: .....
Run an X application command, e.g. gimp, on the remote site.
loginname @ remotehost $ gimp &
This method allows the display of the remote X client output as if it were locally connected through a local UNIX domain socket.
Secure X terminal via Internet
Secure X terminal via Internet, which displays remotely run entire X desktop environment, can easily achieved by using specialized package such as sdm and ldm. Your local machine becomes a secure thin client to the remote application server connected via SSH.
If you want to add similar feature to your normal display manager gdm, create executable shell script at /usr/local/bin/ssh-session as:
# Based on gdm-ssh-session in gdm source (GPL) ZENITY=$(type -p zenity) TARGETHOST=$($ZENITY --width=600 \ --title "Host to connect to" --entry \ --text "Enter the name of the host you want to log in to as user@host.dom:") TARGETSESSION=$($ZENITY --width=600 --height=400 \ --title "Remote session name" --list --radiolist --text "Select one" \ --column " " --column "Session" --column "description" --print-column 2 \ TRUE "/etc/X11/Xsession" "Debian" \ FALSE "/etc/X11/xinit/Xclients" "RH variants" \ FALSE "gnome-session" "Gnome session" \ FALSE "xterm" "Safe choice" \ FALSE "rxvt" "Safe choice" \ FALSE "gnome-terminal" "Safe choice") echo "Connecting to "$TARGETHOST" with $TARGETSESSION" /usr/bin/ssh -A -X -T -n "$TARGETHOST" "$TARGETSESSION" #SSH_ASKPASS=/usr/bin/ssh-askpass /usr/bin/ssh -A -X -T -n "$TARGETHOST" "$TARGETSESSION"
Then add followings to /etc/dm/Sessions/ssh.desktop:
[Desktop Entry] Encoding=UTF-8 Name=SSH Comment=This session logs you into a remote host using ssh Exec=/usr/local/bin/ssh-session Type=Application
The fonts in the X window
X window on the Debian system support two font systems:
- server side font system: the original core X11 font system and
client side font system: the new [http://en.wikipedia.org/wiki/Xft Xft] 2 font system.
The core X11 font system is is used by older applications such as Xterm with bitmap fonts. It is supported by installing pertinent font packages which trigger defoma scripts to generate required files such as "fonts.dir".
The Xft2 font system is used by modern applications such as ones from GNOME, KDE, OpenOffice.org. It supports all fonts listed below (@{@basicfonts@}@, @{@additionalfonts@}@, and @{@cjkfonts@}@) with advanced features such as anti-aliasing. It has no configuration mechanism itself, rather it relies upon the fontconfig library to configure and customize fonts as described in fonts.conf(5). Actual rasterization is supported by the ?FreeType 2 font engine.
Table of packages to support X window font systems. |
1 |
2 |
3 |
package |
popcon |
size |
description |
xfonts-utils |
|
|
X Window System font utility programs |
libxft2 |
|
|
Xft: ?FreeType-based font drawing library for X |
libfreetype6 |
|
|
[http://freetype.sourceforge.net/index.html ?FreeType] 2 font engine, shared library files |
fontconfig |
|
|
[http://en.wikipedia.org/wiki/Fontconfig generic font configuration library] - support binaries |
fontconfig-config |
|
|
generic font configuration library - configuration |
defoma |
|
|
Debian Font Manager -- automatic font configuration framework |
x-ttcidfont-conf |
|
|
TrueType configuration for X (for CJK support) |
You can check actual font path for:
core X11 font path with "xset q"
fontconfig font default: "fc-match"
"[http://unifont.org/iuc27/html/ICUPresentation.html The Penguin and Unicode]" is a good overview of modern X Window system. Other documentations at [http://unifont.org/] should provide good information on Unicode fonts, Unicode-enabled software, internationalization, and Unicode usability issues on [http://en.wikipedia.org/wiki/Free_and_open_source_software free/libre/open source (FLOSS)] operating systems.
Basic fonts
There are 2 major types of [http://en.wikipedia.org/wiki/Computer_font computer fonts]:
- bitmap fonts (good for low resolution rasterization)
- outline/stroke fonts (good for high resolution rasterization)
While scaling of bitmap fonts causes jugged image, scaling of outline/stroke fonts produces smooth image.
Bitmap fonts on the Debian system are provided by compressed [http://fontforge.sourceforge.net/pcf-format.html X11 pcf bitmap font files] having their file extension ".pcf.gz".
Outline fonts on the Debian system are provided by:
[http://en.wikipedia.org/wiki/PostScript ?PostScript] Type 1 font files having their file extension ".pfb" (binary font file) and ".afm" (font metrics file).
[http://en.wikipedia.org/wiki/TrueType TrueType] font files having their file extension ".ttf".
Table of corresponding [http://en.wikipedia.org/wiki/PostScript ?PostScript] Type 1 fonts. |
1 |
2 |
3 |
|
|
|
font package |
popcon |
size |
sans-serif font |
serif font |
monospace font |
source of font |
(?PostScript) |
|
|
[http://en.wikipedia.org/wiki/Helvetica Helvetica] |
Adobe |
||
gsfonts |
|
|
Nimbus Sans L |
Nimbus Roman No9 L |
Nimbus Mono L |
[http://en.wikipedia.org/wiki/URW URW] (Adobe compatible size) |
gsfonts-x11 |
|
|
Nimbus Sans L |
Nimbus Roman No9 L |
Nimbus Mono L |
X font support with ?PostScript Type 1 fonts. |
t1-cyrillic |
|
|
Free Helvetian |
Free Times |
Free Courier |
URW extended (Adobe compatible size) |
lmodern |
|
|
LMSans* |
LMRoman* |
LMTypewriter* |
scalable ?PostScript and ?OpenType fonts based on Computer Modern (from TeX) |
Table of corresponding [http://en.wikipedia.org/wiki/TrueType TrueType] fonts. |
1 |
2 |
3 |
|
|
|
font package |
popcon |
size |
sans-serif font |
serif font |
monospace font |
source of font |
ttf-mscorefonts-installer |
|
|
[http://en.wikipedia.org/wiki/Times_Roman Times New Roman] |
[http://en.wikipedia.org/wiki/Courier_(typeface) Courier New] |
Microsoft (Adobe compatible size) |
|
ttf-liberation |
|
|
Liberation Sans |
Liberation Serif |
Liberation Mono |
[http://en.wikipedia.org/wiki/Liberation_fonts Liberation Fonts project] (Microsoft compatible size) |
ttf-freefont |
|
|
?FreeSans |
?FreeSerif |
?FreeMono |
[http://savannah.gnu.org/projects/freefont/ GNU freefont] (Microsoft compatible size) |
ttf-bitstream-vera |
|
|
Bitstream Vera Sans |
Bitstream Vera Serif |
Bitstream Vera Sans Mono |
[http://www.gnome.org/fonts/ Bitstream, Inc.] |
ttf-dejavu |
|
|
?DejaVu Sans |
?DejaVu Serif |
?DejaVu Sans Mono |
[http://dejavu.sourceforge.net/], Bitstream extended code support |
ttf-dejavu-core |
|
|
?DejaVu Sans |
?DejaVu Serif |
?DejaVu Sans Mono |
[http://dejavu.sourceforge.net/] basic font variants |
ttf-dejavu-extra |
|
|
?DejaVu Sans |
?DejaVu Serif |
?DejaVu Sans Mono |
[http://dejavu.sourceforge.net/] extra font vaiants |
ttf-unifont |
|
|
N/A |
N/A |
unifont |
[http://Unifoundry.com], GNU Unifont cover all code |
Additional fonts
The aptitude will help you find additional fonts easily:
by the short package list under "Packages which depend on defoma" under the defoma package list,
by the short package list under "Tasks" -> "Localization",
by the filtered flat package list of font data with regex on debtag: "~Gmade-of::data:font",
by the filtered flat package list of the BDF (bitmap) font packages with regex on package name: "~nxfonts-", or
by the filtered flat package list of the TrueType (outline) font packages with regex on package name: "~nttf-".
Since Free fonts are sometimes limited, installing or sharing some commercial TrueType fonts is an option for a Debian users. In order to make this process easy for the user, some convenience packages have been created:
ttf-mathematica4.1
ttf-mscorefonts-installer
You'll have a really good selection of TrueType fonts at the expense of contaminating your Free system with non-Free fonts.
CJK fonts
Here are some key points focused on CJK issues.
Table of key words used in CJK font names. |
|
|
|
font type |
Japanese font |
Chinese font |
Korean font |
sans-serif |
gothic, ゴチック |
hei, gothic |
dodum, gulim, gothic |
serif |
mincho, 明朝 |
song, ming |
batang |
Font name such as "VL PGothic" with "P" is a proportional font which corresponds to the fixed width "VL Gothic" font.
For example, Shift_JIS code table comprises 7070 characters. They can be grouped into:
- JIS X 0201 single-byte characters (191 characters),
- JIS X 0208 double-byte characters (6879 characters).
Double-byte characters occupy double width on console terminals which uses CJK fixed width fonts. In order to cope with such situation, [http://www.ibiblio.org/pub/packages/ccic/software/info/HBF-1.1/ Hanzi Bitmap Font (HBF) File] with file extension ".hbf" may be deployed for fonts containing single-byte and double-byte characters.
In order to save space for [http://en.wikipedia.org/wiki/TrueType TrueType] font files, [http://en.wikipedia.org/wiki/TrueType TrueType] font collection file with file extension ".ttc" may be used.
I order to cover complicated code space of characters, CID keyed Type 1 [http://en.wikipedia.org/wiki/PostScript ?PostScript] font is used with CMap files starting themselves with "%!PS-Adobe-3.0 Resource-CMap". This is rarely used for normal X display but used for PDF rendering etc.
The X trivia
Keymaps and pointer button mappings in X
The xmodmap(1) program is a utility for modifying keymaps and pointer button mappings in the X window system. To get the keycode, run the xev program in the X and press keys. To get the meaning of keysym, look into the MACRO definition in /usr/include/X11/keysymdef.h file. All #define statements in this file are named as XK_ prepended to keysym names.
The classic X clients
Most traditional X client programs, such as xterm, can be started with a set of standard command line options to specify geometry, font, and display.
They also use the X resource database to configure their appearance. The system-wide defaults of X resources are stored in /etc/X11/Xresources/* and application defaults of them are stored in /etc/X11/app-defaults/*. Use these settings as the starting points.
The file ~/.Xresources is used to store user resource specifications. This file is automatically merged into the default X resources upon login. To make changes to these settings and make them effective immediately, merge them into the database using the command:
$ xrdb -merge ~/.Xresources
See x(7) and xrdb(1).
The X terminal emulator -- xterm
Learn everything about xterm at [http://dickey.his.com/xterm/xterm.faq.html].
Getting root in X
Never attempt to start an X server directly from the root account in order to avoid possible security risks.
The easiest way to run the X client with the root account is to use sudo, e.g. for xterm:
$ sudo xterm &
or
$ sudo -s # xterm &
In order for the X client to connect to the X server, the $HOME/.Xauthority of the old user needs to be readable by the new user.
The gksu package (popcon: @@@pop-gksu@@@) is a specialized GUI package for gaining the root privileges.
Web browsers in X
There are many [http://en.wikipedia.org/wiki/Web_Browsers web browser] packages with graphical display capabilities:
List of web browsers in X. |
1 |
2 |
3 |
package |
popcon |
size |
description |
iceweasel |
17848 |
- |
unbranded Firefox, new |
epiphany-browser |
9841 |
- |
Gnome |
konqueror |
5651 |
- |
KDE |
iceape-browser |
1804 |
- |
unbranded Mozilla, old |
You may use following special URL strings to confirm browser settings.
"about:"
"about:config"
"about:plugins"
Debian offers many free browser plugin packages in the main component which can handle not only [http://en.wikipedia.org/wiki/Java_(software_platform) Java] and [http://en.wikipedia.org/wiki/Adobe_Flash Flash] but also [http://en.wikipedia.org/wiki/MPEG-1 MPEG], [http://en.wikipedia.org/wiki/MPEG-2 MPEG2], [http://en.wikipedia.org/wiki/MPEG-4 MPEG4], [http://en.wikipedia.org/wiki/DivX DivX], [http://en.wikipedia.org/wiki/Windows_Media_Video Windows Media Video (.wmv)], [http://en.wikipedia.org/wiki/QuickTime ?QuickTime (.mov)], [http://en.wikipedia.org/wiki/MP3 MP3 (.mp3)], [http://en.wikipedia.org/wiki/Vorbis Ogg/Vorbis] files, DVDs, VCDs, etc. Debian also offers helper programs to install non-free browser plugin packages as contrib or non-free components.
List of browser plugin packages. |
1 |
2 |
3 |
|
package |
popcon |
size |
component |
description |
icedtea-gcjwebplugin |
- |
- |
main |
Java plugin using Hotspot JIT |
java-gcj-compat-plugin |
- |
- |
main |
Java plugin using the gij runtime |
gcjwebplugin |
- |
- |
main |
Java plugin using Free Java Virtual Machine |
sun-java5-plugin |
- |
- |
non-free |
Java plugin for Sun's Java SE 5.0 (i386 only) |
sun-java6-plugin |
- |
- |
non-free |
Java plugin for Sun's Java SE 6 (i386 only) |
swfdec-mozilla |
- |
- |
main |
Flash plugin based on libswfdec |
mozilla-plugin-gnash |
- |
- |
main |
Flash plugin based on Gnash |
flashplugin-nonfree |
- |
- |
contrib |
Flash plugin helper to install Adobe Flash Player (i386, amd64 only) |
mozilla-bonobo |
- |
- |
main |
Mozilla plugin support for Gnome Bonobo components |
mozilla-plugin-vlc |
- |
- |
main |
Multimedia plugin based on [http://en.wikipedia.org/wiki/VLC_media_player VLC media player] |
totem-mozilla |
- |
- |
main |
Multimedia plugin based on [http://en.wikipedia.org/wiki/Totem_(media_player) Gnome's Totem media player] |
gecko-mediaplayer |
- |
- |
main |
Multimedia plugin based on (GNOME) [http://en.wikipedia.org/wiki/MPlayer MPlayer] |
Although use of above Debian packages are much easier, browser plugins can be still manually enabled by installing "*.so" into plugin directories (e.g., /usr/lib/iceweasel/plugins/) and restarting browsers.
Some web sites refuse to be connected based on the user-agent string of your browser. You can work around this situation by [http://www.mozilla.org/unix/customizing.html#prefs spoofing the user-agent string]. For exaple, you can do this by adding:
user_pref{"general.useragent.override","Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"};
into user configuration files such as ~/.gnome2/epiphany/mozilla/epiphany/user.js or ~/.mozilla/firefox/*.default/user.js. Alternatively, you can add and reset this variable by typing "about:config" into URL and right clicking its display contents.
Spoofed user-agent string may cause [https://bugzilla.mozilla.org/show_bug.cgi?id=83376 bad side effects with Java].