#!/bin/sh # # language/font setting script for Window Maker # # by MANOME Tomonori # (rewriten slightly by judas@hell on Jan 27 2001 # -argument --nodef tries to change only font coding (limited!) # -much easier to add new font codings # -much harder to read code... # -argument --auto gets locale by itself, but does not override if some # coding is also given # -argument --locale=?? takes locale code (ja, sk, ...) # ) # # [Special Thanks To] # Korean fontset info from: # Byeong-Chan, Kim # Chae-yong Chong # Latin2 fontset info from: # Piotr Dembinski # Toni Bilic # Greek fontset info from: # Nikolaos Papagrigoriou # Quote bug fix info from: # Luke Kendall # Bug fix info for Korean font section from: # CHOI Junho # Ukrainian fontset info from: # Bohdan Vlasyuk VERSION="Version 0.6 2002/01/12" WDWRITE="wdwrite" WDREAD="wdread" PROGRAM=`basename $0` help_msg() { cat >/dev/stderr < ----------------------------------------------------------------------- [font_fam] [Fontset] [Font Information] default helvetica latin1 helvetica(iso8859-1) latin2 helvetica(iso8859-2) See *Note1. greek helvetica(iso8859-7) See *Note1. japanese helvetica/-*-fixed(jisx02XX) Included in X11R6/XFree86("fnon" pkg) korean helvetica/-*-kodig(ksc5601) See *Note1. korean2 helvetica/daewoo(ksc5601) Included in X11R6/XFree86("fnon" pkg) russian helvetica(koi8-r) Included in X11R6/XFree86("fcyr" pkg) ukrainian helvetica(koi8-u) See *Note1. turkish unknown See *Note2. ----------------------------------------------------------------------- Latin1 Languages: Danish/Dutch/English/Finnish/French/Galician/German/ Italian/Norwegian/Portuguese/Spanish/Swedish/... Latin2 Languages: Croatian/Czech/Polish/Romanian/Slovenian/... *Note1: Not included in X11R6/XFree86. You can download them from ... Latin2 X fonts packages: http://sizif.mf.uni-lj.si/linux/cee/iso8859-2.html Greek X fonts packages: ftp://argeas.argos.hol.gr/pub/unix/linux/GREEK/fonts/ ftp://ftp.ntua.gr/pub/fonts/X11/ Korean X fonts packages: ftp://linux.sarang.net (Linux RPM) ftp://ftp.kaist.ac.kr/pub/hangul/fonts Ukrainian X fonts packages: http://www.inp.nsk.su/~bolkhov/files/fonts/cyr-rfx/ *Note2: please let me know appropriate font setting for WMGLOBAL/WindowMaker, and the fonts' URL to download. mail-to: manome@itlb.te.noda.sut.ac.jp EOF exit } nodef="" auto="" family="" for i in $*; do case $i in "--nodef") nodef="YES";; "--auto") auto="YES";; --locale=*) new_locale=`echo $i |sed -e "s|--locale=||" -`;; *) if [ -z $family ]; then family=$i else help_msg fi;; esac done if [ -z "$family" ] && [ -z "$new_locale" ] && [ -z "$auto" ]; then help_msg fi ################################################################################ # You should make changes only in this area # (or it is not what I wanted it to be...) # # # For --auto and --locale= switch... # all_codings="latin1 latin2 greek japanese korean2 russian ukrainian" latin1="ca da de gl nl fi fr de is it no pt es sv se" latin2="hr cz cs hu pl ro sk sl" greek="el" japanese="ja" korean2="ko" russian="ru bg" ukrainian="uk" # note that it's really uk, not ua. # # These are lists of all domains and keys we're gonna change... # DomainNames="WMGLOBAL WindowMaker" DomainWMGLOBAL="SystemFont BoldSystemFont MultiByteText" DomainWindowMaker="WindowTitleFont MenuTitleFont MenuTextFont IconTitleFont ClipTitleFont DisplayFont" for i in $DomainNames; do tmp="Domain$i" eval AllKeys="\"$AllKeys \$${tmp}\"" done # # Items that don't need to have coding string appended ( = not fonts). # NotFont="MultiByteText" # # Elements of $NodefUnable will always have fonts set to defaults, while those # of $NonedefAble will have changed only coding part of font name (if --nodef # command line argument is used). # NodefAble="default latin1 latin2 greek russian ukrainian" NodefUnable="japanese korean korean2" Supported="$NodefAble $NodefUnable" defaultCoding="*-*" latin1Coding="iso8859-1" latin2Coding="iso8859-2" greekCoding="iso8859-7" russianCoding="koi8-r" ukrainianCoding="koi8-u" defaultMultiByteText="AUTO" latin1MultiByteText="NO" latin2MultiByteText="YES" greekMultiByteText="YES" russianMultiByteText="YES" ukrainianMultiByteText="YES" # # Default WindowMaker fonts for NodefAble font families (part telling us # the font coding will be added automaticly from *Coding). # DefaultSystemFont="-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-" DefaultBoldSystemFont="-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-" DefaultWindowTitleFont="-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-" DefaultMenuTitleFont="-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-" DefaultMenuTextFont="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-" DefaultIconTitleFont="-*-helvetica-medium-r-normal-*-8-*-*-*-*-*-" DefaultClipTitleFont="-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-" DefaultDisplayFont="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-" DefaultMultiByteText="AUTO" # # NodefUnable have to give full font descriptions... # japaneseSystemFont="-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*" japaneseBoldSystemFont="-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-%d-*,-*-*-medium-r-normal-*-*-*" japaneseWindowTitleFont="-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*" japaneseMenuTitleFont="-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*" japaneseMenuTextFont="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*" japaneseIconTitleFont="-*-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-*-*" japaneseClipTitleFont="-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-12-*,-*-*-medium-r-normal-*-*-*" japaneseDisplayFont="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-14-*,-*-*-medium-r-normal-*-*-*" japaneseMultiByteText="YES" koreanSystemFont="-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--%d-*-*-*-*-*-*-*,*-*-medium-r-normal-*-%d-*-*-*-*-*-*-*,*-*-*-*-*--%d-*-*-*-*-*-*-*,*" koreanBoldSystemFont="-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-kodig-bold-r-normal--%d-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--%d-*-*-*-*-*-*-*,*-*-bold-r-normal-*-%d-*-*-*-*-*-*-*,*-*-*-*-*--%d-*-*-*-*-*-*-*,*" koreanWindowTitleFont="-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--12-*-*-*-*-*-*-*,-*-*-medium-r-normal--12-*-*-*-*-*-*-*,-*-*-medium-r-normal--*-*-*-*-*-*-*-*,-*-*-*-r-normal--*-*-*-*-*-*-*-*,-*-*-*-*-*--*-*-*-*-*-*-*-*,*" koreanMenuTitleFont="-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--14-*-*-*-*-*-*-*,-*-*-medium-r-normal--12-*-*-*-*-*-*-*,*-*-medium-r-normal--*-*-*-*-*-*-*-*,*-*-*-r-normal--*-*-*-*-*-*-*-*,*" koreanMenuTextFont="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--14-*-*-*-*-*-*-*,*-*-medium-r-normal--12-*-*-*-*-*-*-*,*-*-medium-r-normal--*-*-*-*-*-*-*-*,*-*-*-r-normal--*-*-*-*-*-*-*-*,*" koreanIconTitleFont="-*-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--10-*-*-*-*-*-*-*,*-*-medium-r-normal--10-*-*-*-*-*-*-*,*-*-medium-r-normal--*-*-*-*-*-*-*-*,*-*-*-r-normal--*-*-*-*-*-*-*-*,*" koreanClipTitleFont="-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--10-*-*-*-*-*-*-*,*-*-medium-r-normal--10-*-*-*-*-*-*-*,*-*-medium-r-normal--*-*-*-*-*-*-*-*,*-*-*-r-normal--*-*-*-*-*-*-*-*,*" koreanDisplayFont="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*,-*-kodig-medium-r-normal--12-*-*-*-*-*-*-*,*-*-medium-r-normal--12-*-*-*-*-*-*-*,*-*-medium-r-normal--*-*-*-*-*-*-*-*,*-*-*-r-normal--*-*-*-*-*-*-*-*,*" koreanMultiByteText="YES" korean2SystemFont="-*-helvetica-medium-r-normal-*-%d-*-*-*-*-*-*-*,-*-medium-r-normal-*-%d-*,-*-medium-r-normal-*" korean2BoldSystemFont="-*-helvetica-bold-r-normal-*-%d-*-*-*-*-*-*-*,-*-medium-r-normal-*-%d-*,-*-medium-r-normal-*" korean2WindowTitleFont="7x14,-*-gothic-medium-r-normal-*-16-*-*-*-*-*-ksc5601.1987-*" korean2MenuTitleFont="7x14,-*-gothic-medium-r-normal-*-16-*-*-*-*-*-ksc5601.1987-*" korean2MenuTextFont="7x14,-*-gothic-medium-r-normal-*-16-*-*-*-*-*-ksc5601.1987-*" korean2IconTitleFont="-*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*,-*-gothic-medium-r-normal-*-12-*-*-*-*-*-ksc5601.1987-*" korean2ClipTitleFont="-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*,-*-gothic-medium-r-normal-*-12-*-*-*-*-*-ksc5601.1987-*" korean2DisplayFont="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*,-*-gothic-medium-r-normal-*-16-*-*-*-*-*-ksc5601.1987-*" korean2MultiByteText="YES" # # End of area meant to hold everything you could need to modify... ################################################################################ # # Get current locale automaticaly (--auto). # if [ -z "$family" ]; then if [ -n "$new_locale" ]; then locale="$new_locale" else locale=$LANG if [ -z "$locale" ]; then locale=$LC_ALL fi fi if [ -z "$locale" ]; then family="default" else for i in $all_codings; do eval _i="\$$i" for j in ${_i}; do if [ "$j" = "${locale%_*}" ]; then family="$i" break 2 fi done done fi fi # # Do we recognize passed coding? # is_supported="" for i in $Supported; do if test "$family" = "$i"; then is_supported="YES" break fi done if test -z "$is_supported"; then # unknown coding cat >/dev/stderr </dev/stderr <<-EOT Sorry, --nodef argument is not allowed for these font codings: $NodefUnable Run $PROGRAM without --nodef argument to set default fonts for your font coding. EOT exit 1 else is_nodef_unable="YES" break fi fi done # # The real work... # if test -z "$nodef"; then for i in $AllKeys; do if test -n "$is_nodef_unable"; then # japanese,... defaults tmp="$family$i" eval $i="\$${tmp}" else # rest, load defaults not_font="" for j in $NotFont; do if test "$i" = "$j"; then not_font="YES" break fi done if test -n "$not_font"; then # don't append coding (not default!) tmp="${family}$i" eval $i="\$${tmp}" else # append coding tmp="Default$i" tmp1="${family}Coding" eval $i="\$${tmp}\$${tmp1}" fi fi done else cat >/dev/stderr <