Wednesday, October 14, 2015

Finding and Using Fonts in OpenSuse

To find the font directories in use, simply cat the fonts.conf file:

cat /etc/fonts/conf.d


This gives you this sort of results at the top of the output:

<!-- Font directory list -->

    <dir>/usr/share/fonts</dir>
    <dir>/usr/X11R6/lib/X11/fonts</dir>
    <dir>/opt/kde3/share/fonts</dir>
    <dir>/usr/local/share/fonts</dir>
    <dir>~/.fonts</dir>



Note that there are 5 directories in use in this case:

/usr/share/fonts/
/usr/X11R6/lib/X11/fonts/
/opt/kde3/share/fonts/
/usr/local/share/fonts/
~/.fonts/



To find the fonts in use by the system, in the /usr/share/fonts/ folder, use the command:

fc-list


You may want to redirect the output to a text file:

fc-list > fontlist.txt


To install additional fonts system-wide, manually copy the font files to a suitable directory, such as /usr/share/fonts/

Instead of copying the actual fonts, you can also create symbolic links. For example, you may want to do this if you have licensed fonts on a mounted Windows partition and want to use them. Subsequently, run:
SuSEconfig --module fonts


SuSEconfig --module fonts executes the script /usr/sbin/fonts-config, which handles the font configuration. For more information on this script, refer to its manual page (man fonts-config).

The procedure is the same for bitmap fonts, TrueType and OpenType fonts, and Type 1 (PostScript) fonts. All these font types can be installed into any directory known to fonts-config.


However, for many applications and operations, fonts can be called through specific conf files from other folders as well.
One example would be as in xslt/fo operations.

To add fonts in a particular directory to the xslt transformations, register the fonts in the directory by adding the path in fop.xconf:


<fonts>

    <!-- register all the fonts found in a directory -->
        <directory>/home/rnx/workingfonts</directory>

.....

</fonts>

No comments:

Post a Comment