Author
Christopher Marshall (christopherlmarshall@yahoo.com)
Raw Notes on X
# documentation
# /usr/X11R6/lib/X11/doc is full of good stuff
# I this the whole xlib is documented there
# some documents
/usr/X11R6/lib/X11/doc/README.fonts
# character encodings
# utf stands for unicode transfer format
# utf8 is a way of having 0-127 ascii characters remain unmolested
# while full unicode characters are expanded into escape sequences.
# utf16 is straight unicode, where each character takes two bytes.
# xmodmap is the command that maps keyboard scan codes into symbols
# print the current modifier map to stdout
xmodmap -pm
# print the keymap table
xmodmap -pk
# print the keymap table as a set of expressions that can be read
# by xmodmap (which is how I got the a and b switching commands
# below)
xmodmap -pke
# switch a and b
xmodmap -e "keycode 38 = b B"
xmodmap -e "keycode 56 = a A"
# switch them back
xmodmap -e "keycode 38 = a A"
xmodmap -e "keycode 56 = b B"
# Xft vs Core X11 fonts
Core X11 fonts : the original, monochrome bitmapped font system which has
grown to support scalable and rotated fonts
Xft : redesign of the font system that supports scalable fonts efficiently,
and anti-aliasing and sub-pixel rasterization
# font related utilities / and commands
xfontsel #
xlsfonts #
xset fp rehash #
bdftopcf
mkfontdir #
xfd -fn <font name> # displays the glyphs in a font
fc-cache # force fontconfig system to run on the usual directories
fc-cache <directory> # run fontconfig system on named directory
# font file types
.pcf
.snf
.bdf
.ttf
# mapping files in font directories
fonts.alias
fonts.dir
fonts.scale
fonts.cache-1
encodings.dir
# X font directories
# these are searched by the fontconfig system upon starting X, or when fc-cache is run
/usr/X11R6/lib/X11/fonts/100dpi,75dpi,CID,Speedo,TTF,Type1,cyrillic,encodings,local,misc,util
~/.fonts # in the user's home directory
# font naming convention
# installing fonts in Xft
# copy a font definition file into one of the system font directories, like this:
cp lucbr.ttf ~/.fonts/
# then fun fc-cache
fc-cache
# character encodings
8859-6 -> arabic with one byte encodings
iso10646 -> a utf16 encoding of unicode characters sets?
www.unicode.org
www.langbox.com
iso8859-6 is the character set for arabic that maps the 128-255 range of 8 bit
unsigned integers to the unicode characters for arabic.
langbox.com has some information about it.
linux unicode FAQ
http://www.cl.cam.ac.uk/~mgk25/unicode.html
# I found true type fonts in /usr/X11R6/lib/fonts/TTF, and there were mapping files
# like fonts.dir, fonts.scale, and fonts.cache-1 there and I could use xfd -fn <name> to display
# the fonts in the directory, but I am not sure what utility created those files.
# The usual suspect, mkfontdir, doesn't seem to handle ttf fonts. Perhaps I could ask this
# quesiton on slackware?
# basic questions
# for X and ghostscript:
# 1. Which files store font definitions
# 2. Which files map font names to font definition files
# 3. How can you display glyph X from font Y
# 4. How can you display a unicode character?
#
# Ghostscript
1.
package is gnu-gs-fonts-6.0
/usr/share/ghostscript/fonts/ is the directory
font definitions are in files .pfb, .pfa, .gsf in the above directory
there are a bunch of .afm files in there also. I don't know what they are.
The Fontmap file
usr/share/ghostscript/7.05/lib/Fontmap
usr/share/ghostscript/7.05/lib/Fontmap.GS
the first file is a postscript program to load the second file
the second file contains postscript assignment of fontnames to filenames
the file gs_fonts.ps is run then gs starts up to load font map information
the file prfont.ps contains code to print a sample page of a font
to use it from an interactive gs session, do this:
(prfont.ps) run
/<font-name> DoFont
# example of adding fonts to ~/.fonts
# mkfontdir doesn't recognize scalable fonts unless you run mkfontscale first
# I was finally able to list the cyberbit fonts using xlsfonts after I added
# ~/.fonts to the font path using xset +fp.
cd ~
mkdir .fonts
ln -sf /usr/X11R6/lib/fonts/TTF/Cyberbit.ttf ./fonts
mkfontscale .fonts # this creates .fonts/fonts.scale
mkfontdir .fonts # this creates .fonts/fonts.dir
fc-cache -v # -v means to be verbose and let you see what's happening
# it creates .fonts/fonts.cache-1
xset +fp /mnt/drive2/chris/.fonts
xlsfonts | grep -i cyberbit
# the above command produces this list
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-adobe-standard
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-gb2312.1980-0
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-ibm-cp437
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso10646-1
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-1
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-10
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-11
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-13
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-15
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-2
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-3
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-4
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-5
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-8
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-iso8859-9
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-jisx0201.1976-0
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-jisx0208.1983-0
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-koi8-e
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-koi8-r
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-koi8-u
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-ksc5601.1987-0
-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252
# the below command displays one of those fonts
xfd -fn "-misc-bitstream cyberbit-medium-r-normal--0-0-0-0-p-0-adobe-standard"
# query the font path, and other information as well
xset q
xset +fp <path> # add path to the front of the font path
xset fp+ <path> # add path the the end of the font path
xset -fp # remove the first entry in the font path
xset fp- # remove the last entry in the font path
xset fp default # reset the path to its default
# yudit
# files and directories
/usr/local/share/yudit/ config/,data/,doc/,fonts/,locale/,src/
/usr/local/share/yudit/config/yudit.properties
~/.yudit/ data/,fonts/,yudit.properties
# Wheb yudit is loaded, it loads configuration info from the system wide file first
# (/usr/local/share/yudit/config/yudit.properties), then also loads from the user
# specific configuration file at ~/.yudit/yudit.properties. Duplicate variables
# are overriden by the definition in the user specific file.
# On exit from yudit, certain variables values are written back into
# ~/.yudit/yudit.properties file, like the current value of the font selector.
# The transient variables are:
yudit.editor.font # set by the font selector control (14 below).
yudit.editor.fontsize # set by control 12 and 13 controls below.
yudit.editor.input # set by control 15 below
yudit.filetypes # I am not sure where this is set
/usr/local/share/yudit/config
/usr/local/share/yudit/config
# menu/buttons running across the top
1 open
2 save
3 print
4 print preview
5 find go-to
6 undo
7 redo
8 document text embedding
9 direction override
10 embedding override
11 yield embedding
12 bigger
13 smaller
14 font selector
15 input selector
16 line break (unix or dos)
# installing a true type font
stick the ttf file in /usr/local/share/yudit/fonts/
edit
# the yudit.editor.fonts variable defines the font names that can be selected in
# control 14 above, for use in typing text in the editor.
# Unless you modify things, it will be defined in the system-wide yudit.properties file
# and not in the user specific one. Here is how it is defined in my setup (unmodified):
yudit.editor.fonts=default,TrueType,Misc,JP2000X,JP2000T,Box,Full,Indic-F,Indic-M
# the yudit.fonts variable defines font names that are available in other areas of the editor,
# as in labelling buttons, I am guessing.
yudit.fonts=default,TrueType,Bitmap,Japanese,Courier,Times,Helvetica,Lucida,Misc
# for each name defined in the yudit.editor.fonts variable, you need to assign to the
# variable yudit.font.<name> a list of places to look for the font.
# That can be either the name of a ttf file in yudit's font path, or an X11 font name
# pattern, like "*-iso10646-1"
# Here is how my yudit.font.TrueType variable was defined in the system wide yudit.properties file:
yudit.font.TrueType=arial.ttf,kochi-gothic.ttf,gulim.ttf,ogulim.ttf:mslvt,raghu.ttf,
tsckanna.ttf:tscii,dc-font.ttf:mlym,MalOtf.ttf:mlym,code2000.ttf,code2001.ttf:unicode:RL,
cyberbit.ttf,yudit.ttf
# and here is how it was defined in my user specific one:
yudit.font.TrueType=Cyberbit.ttf,arial.ttf,kochi-gothic.ttf,gulim.ttf,ogulim.ttf:mslvt,raghu.ttf,
tsckanna.ttf:tscii,dc-font.ttf:mlym,MalOtf.ttf:mlym,code2000.ttf,code2001.ttf:unicode:RL,yudit.ttf
# Originally, in my yudit.properties, cyberbit was listed toward the end and the first letter was not
# capitalized. While I could type farsi characters, they would not display. I am pretty sure that was
# because the filename at which I placed the file was /usr/local/share/yudit/fonts/Cyberbit.ttf, and
# therefore, the case sensitivity of the unix filesystem prevented yudit from finding it.
# I'll also bet that the yudit was setup that way by default because on windows systems
# unzipping the cyberbit distribution would create a file in all lower case.
#
# The other possibility is that by moving the Cyberbit.ttf filename from the end of the list
# to the beginning, I enabled yudit to find it.
# control 15, the input selector
clicking on the input selector brings up a dialog with three columns
1. Available KMaps
2. F-Key | current KMaps
3. Key Input | Output
There is also a button with a ">" symbol in it between columns 1 and 2.
Columns 2 and 3 are themselves 2 column tables (maps). 2 maps from the function keys (f1-f12)
and column 3 maps from keyboard symbols to glyphs for the selected input method.
To assign farsi to f4, for example, you click on farsi in column 1, click on f4 in column 2, then click the ">" button. Then column 3 will display the key/glyph mapping for farsi.
# uniprint
# here is how you use uniprint to print a utf-8 encoded text file to postscript
# notice how, in specifying a font, you can use tell uniprint the ttf filename (as long as that file
# is in the yudit font path.
uniprint -in Farsi.kmap -out print.ps -font cyberbit.ttf -size 20
# web pages
http://www.yudit.org
http://eyegene.ophthy.med.umich.edu/unicode
#X11
# it took me a while to figure this out. Vesa works like a charm
# you just need the stanza below to refer to it.
# Also, you need to edit lilo.conf to enable the vesa mode.
# I was in a bind because XFree 86 didn't support this video card.
# Device configured by xf86config:
Section "Device"
Identifier "vcarddef"
Driver "vesa"
# unsupported card
VideoRam 2048
# video card notes:
# 2005-12-08
# intel 85265G integrated graphics
# this uses the i810 device in xorg.conf
# before this would work on melody's dell 3000 computer, I had to go into
# the bios and change the AGP aperature from 1M to 8M
# I don't know the whole story as to what that means, but it certainly
# worked
# radeon
# got an external monitor working with my sony vaio (radeon)
# the key is adding a line like this to the device section:
Option "MonitorLayout" "LVDS,CRT"
# or this one
Option "MonitorLayout" "CRT"
# the monitor types are:
# NONE
# CRT
# TMDS
# LVDS
#
# the idea is that you are telling X which monitor types to assume are in the
# primary and secondary positions (for a dual head setup).
# In my case, the first line cloned the display between the LCD and external VGA
# and the second one turned off the LCD and only used the external VGA.
#
# I was not able to get xine or mplayer to display a video on the external
# VGA connnector. I think that is because they are using the X Video extension
# to play a video and the I need to figure out how to get the radeon driver
# to apply xvideo to the external monitor.
