Font Configuration in Amaya
How Amaya selects fonts
Amaya works with a Font Configuration file. By default that Font
configuration file is located in the directory Amaya/config/:
- The file
"fonts.gl.mac" is used by Mac OSX versions of Amaya - The file
"fonts.gl"is used by Linux versions of Amaya - The file
"fonts.gl.win"is used by Windows versions of Amaya
As default requested font files may not be found out, there are also secondary Font configuration files defined for each platform.
Format of Font Configuration files
Criteria used to select a font are:
- the script:
0for unicode ( for japanese),1-17for ISO-8859-1 to ISO-8859-17,20for Symbol ,21for Stix fonts. - the font family:
1for serif,2for sans-serif,3for monspace - the font face:
1for normal,2for bold,3for italic,4bold italic
The principle is to attach the path of of the font file (for example : "/share/fonts/type1/gsfonts/a010013l.pfb") to each set of criteria in Font Configuration files.
The syntax of these files is:
- One line that declares the script + a comment
<script>,#<a comment> - Followed by several lines that declare the connection between a font
family and a font face with a font selector. For optimization purpose, it's
possible to declare several font faces in the same line. In this case only
the first font face identifier (1 for example) is declare. The second font
selector is connected to the first font face identifier incremented to 1,
etc.
<font-family>;<font-face>=<font descriptor>;<font descriptor>;....
Amaya applies its standard strategy to select a font (as if no Font Configuration file exists).
Windows example ($OSDIR points to the OS location)
1;#Latin1 (US and Western Europe)
1;1=$OSDIR\fonts\times.ttf;2=$OSDIR\fonts\timesbd.ttf;3=$OSDIR\fonts\timesi.ttf;4=$OSDIR\fonts\timesbi.ttf;
2;1=$OSDIR\fonts\arial.ttf;2=$OSDIR\fonts\arialbd.ttf;3=$OSDIR\fonts\ariali.ttf;4=$OSDIR\fonts\arialbi.ttf;
3;1=$OSDIR\fonts\cour.ttf;2=$OSDIR\fonts\courbd.ttf;3=$OSDIR\fonts\couri.ttf;4=$OSDIR\fonts\courbi.ttf;
Linux example ($THOTDIR points to the Amaya root)
1;#Latin1 (US and Western Europe)
1;1=$THOTDIR/fonts/FreeSerif.ttf;2=$THOTDIR/fonts/FreeSerifBold.ttf;3=$THOTDIR/fonts/FreeSerifItalic.ttf;4=$THOTDIR/fonts/FreeSerifBoldItalic.ttf;
2;1=$THOTDIR/fonts/FreeSans.ttf;2=$THOTDIR/fonts/FreeSansBold.ttf;3=$THOTDIR/fonts/FreeSansOblique.ttf;4=$THOTDIR/fonts/FreeSansBoldOblique.ttf;
3;1=$THOTDIR/fonts/FreeMono.ttf;2=$THOTDIR/fonts/FreeMonoBold.ttf;3=$THOTDIR/fonts/FreeMonoOblique.ttf;4=$THOTDIR/fonts/FreeMonoBoldOblique.ttf;
How to select other fonts
In order to let you choose your fonts, you have to define your Font configuration file in your AmayaHome:
~/Library/Application Support/amayafor Mac OSX$HOME/.amayafor Linux$HOMEDRIVE:\$HOMEPATH\amayafor Windows
You have to coy the appropriated default Font configuration file located in
the directory Amaya/config/:
- The file
"fonts.gl.mac" is used by Mac OSX versions of Amaya - The file
"fonts.gl"is used by Linux versions of Amaya - The file
"fonts.gl.win"is used by Windows versions of Amaya
And change each entry you want to point to your selected font files