old-www/HOWTO/Hebrew-HOWTO-4.html

315 lines
8.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>The Hebrew HOWTO: X Windows setup - XFree86 3.1</TITLE>
<LINK HREF="Hebrew-HOWTO-5.html" REL=next>
<LINK HREF="Hebrew-HOWTO-3.html" REL=previous>
<LINK HREF="Hebrew-HOWTO.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="Hebrew-HOWTO-5.html">Next</A>
<A HREF="Hebrew-HOWTO-3.html">Previous</A>
<A HREF="Hebrew-HOWTO.html#toc4">Contents</A>
<HR>
<H2><A NAME="s4">4. X Windows setup - XFree86 3.1</A></H2>
<H2><A NAME="ss4.1">4.1 Hebrew fonts.</A>
</H2>
<P>XFree86 3.1 comes with two Hebrew fonts: heb6x13, heb8x13. Additional
Hebrew fonts can be found on the Net:
<UL>
<LI>
<A NAME="heb-fonts"></A> The web Type1 fonts (Helvetica/David style
(proportional) and Courier/Shalom Stick style (fixed space) ) from the
snunit-project archive at
<A HREF="ftp://snunit.huji.ac.il/pub/fonts/">ftp://snunit.huji.ac.il/pub/fonts/</A>, it's good for netscape Hebrew
pages.</LI>
<LI>Avner Lottem, (
<A HREF="mailto:lottem@techUnix.technion.ac.il">lottem@techUnix.technion.ac.il</A>) put some Hebrew-ISO 8859-8 fonts
on archive at
<A HREF="ftp://sunsite.unc.edu/pub/Linux/X11/fonts/">ftp://sunsite.unc.edu/pub/Linux/X11/fonts/hebxfonts-0.1.tgz</A>,
it has a font that's good for dosemu under X-Windows (read his README file).</LI>
</UL>
<P>
<H2><A NAME="install-fonts"></A> <A NAME="ss4.2">4.2 Installing fonts</A>
</H2>
<P>
<UL>
<LI>
<A NAME="X11-Fonts"></A> Fonts exaptable: pcf (Portable Compiled Format),
bdf (Bitmap Distribution Format), pfb (Type1 fonts).
</LI>
<LI>Move the fonts to some existing directory (/usr/lib/X11/fonts/misc) or
create a new one (/usr/lib/X11/fonts/Hebrew). <CODE>compress</CODE> (to *.Z) the fonts
to save space (NOT GZIP!!!).
</LI>
<LI>Run the <CODE>mkfontdir</CODE> to create/re-create the <CODE>fonts.dir</CODE> and edit
<CODE>fonts.alias</CODE> (optional) to define new aliases.
</LI>
<LI>For Type1 fonts, <CODE>mkfontdir</CODE> does nothing. You have to add these
fonts to <CODE>fonts.dir</CODE> manually.
</LI>
<LI>Make sure that the directory is in the X server path. Edit the
XF86Config and add the appropriate path -- FontPath
"/usr/X11R6/lib/X11/fonts/...". </LI>
</UL>
<P>
<H2><A NAME="ss4.3">4.3 Making an X application to use Hebrew fonts.</A>
</H2>
<P>In short you need to set the appropriate resource.
<P>
<H3>Xterm</H3>
<P>Put the following line in the $HOME/.Xresources:
<P><CODE>xterm*font: heb8x13</CODE>
<A NAME="xterm-font"></A> <P>or simply start xterm with <CODE>xterm -fn heb8x13</CODE>
The above font is way too small, so search for a better one ...
See the comments/examples on starting X11.
<H3>Netscape</H3>
<P>Usaly you can use the hebrew fonts from
<A HREF="#heb-fonts">snunit - webfonts</A>, Install it
<A HREF="#install-fonts">as described</A>, and then put the next defaults in your local
<CODE>.Xdefaults</CODE> or in the app-defaults/Netscape.
<BLOCKQUOTE><CODE>
<PRE>
----
*documentFonts.latin1.variable.italic*slant: r
*documentFonts.latin1.variable.boldItalic*slant: r
*documentFonts.latin1.variable*family: web
*documentFonts.latin1.fixed*family: webmono
*documentFonts.latin1*registry: iso8859
*documentFonts.latin1*encoding: 8
----
</PRE>
</CODE></BLOCKQUOTE>
In general you can put any fonts insted of the webfonts files as long as
its supported by X11
<A HREF="#X11-Fonts">as described</A>.
<H2><A NAME="ss4.4">4.4 Mapping the keyboard.</A>
</H2>
<P>For some reason the X server doesn't inherit the keymap from the previous
paragraph, and anyway I would like to define ALT Left and ALT Right and Scroll
Lock. When pressing ALT together with some key it will generate a Hebrew
character, Scroll Lock will lock in Hebrew mode.
<P>To do that we need to use <CODE>xmodmap</CODE>. Following is a Xmodmap which also
corrects the bugs with the "Num Lock":
<BLOCKQUOTE><CODE>
<PRE>
-----
! Hebrew key mapping for XFree86 (for US/Hebrew keyboards).
! By Vlad Moseanu
!
keysym Alt_L = Mode_switch
keysym Alt_R = Mode_switch
!clear Mod1
clear Mod2
!add Mod1 = Alt_L
add Mod2 = Mode_switch
!
! Set the mapping for each key
!
keycode 8 =
keycode 9 = Escape
keycode 10 = 1 exclam
keycode 11 = 2 at
keycode 12 = 3 numbersign
keycode 13 = 4 dollar
keycode 14 = 5 percent
keycode 15 = 6 asciicircum
keycode 16 = 7 ampersand
keycode 17 = 8 asterisk
keycode 18 = 9 parenleft
keycode 19 = 0 parenright
keycode 20 = minus underscore
keycode 21 = equal plus
keycode 22 = Delete
keycode 23 = Tab
keycode 24 = q Q slash Q
keycode 25 = w W apostrophe W
keycode 26 = e E 0x00f7 E
keycode 27 = r R 0x00f8 R
keycode 28 = t T 0x00e0 T
keycode 29 = y Y 0x00e8 Y
keycode 30 = u U 0x00e5 U
keycode 31 = i I 0x00ef I
keycode 32 = o O 0x00ed O
keycode 33 = p P 0x00f4 P
keycode 34 = bracketleft braceleft
keycode 35 = bracketright braceright
keycode 36 = Return
keycode 37 = Control_L
keycode 38 = a A 0x00f9 A
keycode 39 = s S 0x00e3 S
keycode 40 = d D 0x00e2 D
keycode 41 = f F 0x00eb F
keycode 42 = g G 0x00f2 G
keycode 43 = h H 0x00e9 H
keycode 44 = j J 0x00e7 J
keycode 45 = k K 0x00ec K
keycode 46 = l L 0x00ea L
keycode 47 = semicolon colon 0x00f3 colon
keycode 48 = apostrophe quotedbl comma quotedbl
keycode 49 = grave asciitilde semicolon asciitilde
keycode 50 = Shift_L
keycode 51 = backslash bar
keycode 52 = z Z 0x00e6 Z
keycode 53 = x X 0x00f1 X
keycode 54 = c C 0x00e1 C
keycode 55 = v V 0x00e4 V
keycode 56 = b B 0x00f0 B
keycode 57 = n N 0x00ee N
keycode 58 = m M 0x00f6 M
keycode 59 = comma less 0x00fa less
keycode 60 = period greater 0x00f5 greater
keycode 61 = slash question period question
keycode 62 = Shift_R
keycode 63 = KP_Multiply
!keycode 64 = Alt_L Meta_L
keycode 65 = space
keycode 66 = Caps_Lock
keycode 67 = F1
keycode 68 = F2
keycode 69 = F3
keycode 70 = F4
keycode 71 = F5
keycode 72 = F6
keycode 73 = F7
keycode 74 = F8
keycode 75 = Escape
keycode 76 = F10
keycode 77 = Num_Lock
keycode 78 = Scroll_Lock
keycode 79 = KP_7
keycode 80 = KP_8
keycode 81 = KP_9
keycode 82 = KP_Subtract
keycode 83 = KP_4
keycode 84 = KP_5
keycode 85 = KP_6
keycode 86 = KP_Add
keycode 87 = KP_1
keycode 88 = KP_2
keycode 89 = KP_3
keycode 90 = KP_0
keycode 91 = KP_Decimal
keycode 92 = Sys_Req
keycode 93 =
keycode 94 =
keycode 95 = F11
keycode 96 = F12
keycode 97 = Home
keycode 98 = Up
keycode 99 = Prior
keycode 100 = Left
keycode 101 = Begin
keycode 102 = Right
keycode 103 = End
keycode 104 = Down
keycode 105 = Next
keycode 106 = Insert
keycode 107 = Delete
keycode 108 = KP_Enter
keycode 109 = Control_R
keycode 110 = Pause
keycode 111 = Print
keycode 112 = KP_Divide
!keycode 113 = Alt_R Meta_R
keycode 114 = Break
!
! This xmodmap file can be use to set the correct numerical keypad mapping
! when "ServerNumLock" is set in the XF86Config file. In this case the
! Xserver takes care of the Num Lock processing.
!
!
keycode 136 = KP_7
keycode 137 = KP_8
keycode 138 = KP_9
keycode 139 = KP_4
keycode 140 = KP_5
keycode 141 = KP_6
keycode 142 = KP_1
keycode 143 = KP_2
keycode 144 = KP_3
keycode 145 = KP_0
keycode 146 = KP_Decimal
keycode 147 = Home
keycode 148 = Up
keycode 149 = Prior
keycode 150 = Left
keycode 151 = Begin
keycode 152 = Right
keycode 153 = End
keycode 154 = Down
keycode 155 = Next
keycode 156 = Insert
keycode 157 = Delete
-----
</PRE>
</CODE></BLOCKQUOTE>
<P>To use the Xmodmap above define "Scroll-Lock Mode-Lock" in the XF86Config.
<P>
<H2><A NAME="ss4.5">4.5 Integrating all the above, examples.</A>
</H2>
<P>If you are using xdm a $HOME/.xsession should look like the following:
<BLOCKQUOTE><CODE>
<PRE>
-----
#!/bin/sh
# $XConsortium: Xsession,v 1.9 92/08/29 16:24:57 gildea Exp $
#
# General defs
#
export OPENWINHOME=/usr/openwin
export MANPATH=/usr/local/man:/usr/man/preformat:/usr/man:/usr/X11R6/man
#export HOSTNAME="`cat /etc/HOSTNAME`"
export PATH="/bin: /usr/bin: /usr/X11/bin: /usr/X386/bin: /usr/TeX/bini: /usr/local/bin: /usr/games:."
LESS=-MM
if [ -z $XAPPLRESDIR ]; then
XAPPLRESDIR=/usr/lib/X11/app-defaults:/usr/local/lib/X11/app-defaults
else
XAPPLRESDIR=$XAPPLRESDIR:/usr/lib/X11/app-defaults
fi
export XAPPLRESDIR
#
sysresources=/usr/lib/X11/Xresources
sysmodmap=/usr/lib/X11/Xmodmap
resources=$HOME/.Xresources
xmodmap=$HOME/.Xmodmap
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi
if [ -f $resources ]; then
xrdb -merge $resources
fi
if [ -f $xmodmap ]; then
xmodmap $xmodmap
fi
#
# Start applications
#
# xterm -ls -sb &amp;
xhost + # look out !!!
exec fvwm
-----
</PRE>
</CODE></BLOCKQUOTE>
<P>If you prefer <CODE>startx</CODE> use the above as an example for <CODE>.xinitrc</CODE>.
<P>
<HR>
<A HREF="Hebrew-HOWTO-5.html">Next</A>
<A HREF="Hebrew-HOWTO-3.html">Previous</A>
<A HREF="Hebrew-HOWTO.html#toc4">Contents</A>
</BODY>
</HTML>