# dklibs 1.27.0

- Overview
- Download
- Download / Installation
- Installation from source on Windows systems
- Usage
- FAQ
- Change log
- Other projects
- Tutorial
- Developer docu
- stc
- tracecc and trana
- tracecc GUI
- tracecc PDF man.
- API: sort and search
- API: Generic I/O
- Preferences
- File search
- Font configuration
- LaTeX encodings
- Security
- DK libraries for Java

## Font configuration

- Overview
- Font configuration file syntax
- Example

### Overview

In environments where PostScript and/or LaTeX/pdfLaTeX is used applications may need to know how to handle texts in PostScript fonts.
One example for such an application is fig2vect. In Fig files (created by XFig, jFig or WinFig) texts may have an information attached, which PostScript font has to be used to show the text.
When converting to other file formats the application needs to know details about the font and how to convert the font specification into similar information for the target file format.
The dkfont module may be used to retrieve this information from configuration files.

### Font configuration file syntax

A font configuration file consists of up to 35 section, one section for each of the 35 PS fonts.

Eeach section is started by the PS font name in square brackets, the list of possible replacement fonts follows. Each replacement font is started by a line ``name = name''. The remaining lines in the replacement description are key/value pairs, key and value are separated by ``=''.

The following keys are allowed:

source type
  Information, where to search for font files:
  - system
    Use a system font.
  - download
    Retrieve the font file as a download.
family
  The font family name.
features
  A font category (``roman'', ``sans-serif'' or ``typewriter''), optionally the keyword ``bold'' and/or ``italic'', separated by whitespaces.
driver list
  A list of output drivers which can use this replacement. Use an asterisk (``*'') for ``all drivers''.
  If a font replacement does not contain a driver list explicitly, the font replacement can be used for all output drivers.
directory
  Specifies the directory where to find the font file for ``source type = download'' font replacements.
file name
  Specifies the file name (without the directory) where to find the font file for ``source type = download'' font replacements.
font type
  Specifies the font file format (either ``svg'' or ``pfb'') for ``source type = download'' font replacements.
tex name
  The TeX/LaTeX name of the font.
pfb name
  Specifies the file name (without leading directory) of a PFB font file.
pfb base
  Specifies the directory or base URL (http://...) where to find the PFB font file.
ttf name
  Specifies the file name (without leading directory) of a TTF font file.
ttf base
  Specifies the directory or base URL (http://...) where to find the TTF font file.

### Example

The following example is an excerpt from ``combfont.cfg''. We should first attempt to use a system font. If this font is not available SVG viewers can attempt to use the SVG variant of the GhostScript font. The SVG font must be placed in a directory ``./urw-svg'' relative to the image file referencing the font.

    [Times-Roman]
    name    =       Times New Roman
            source type     =       system
            features        =       roman
            family          =       Times New Roman
            driver          =       *
    name    =       NimbusRomanNo9L-Regu
            source type     =       download
            directory       =       ./urw-svg
            file name       =       n021003l.svg
            features        =       roman
            family          =       Nimbus Roman No9 L
            driver          =       svg
            font type       =       svg
            pfb name        =       n021003l.pfb
            pfb base        =       http://my-server.my-domain.com/gs-fonts