fig2vect

SourceForge.net Logo
Yet another Fig to vector converter

FAQ

PDF manual "fig2vect.pdf" available
german version "f2vde.pdf" available too
General FAQ
What's the purpose of the program?
How does fig2vect compare against other Fig to xxx conversion software?
What about the license conditions?
Installation FAQ
Installation on UNIX
Should I install from source?
Which libraries do I need to install before building fig2vect?
Where can I get the sources?
How do I build and install the software?
Installation on Windows
Should I use the setup executable or install from source?
Configuration file
What is the fig2vect.cfg.sample file?
How do I manage configurations after a fig2vect update?
Usage FAQ
General Usage
How do I start the program?
Can I process compressed files directly?
How do I provide configuration options to the program?
How do I choose a name for a configuration?
How does option inheritance work?
What is the name of the configuration file?
How does fig2vect calculate the image dimensions?
How do I handle text on the outermost left/right/top/bottom position?
How can I add some border space?
What is a background rectangle, how do I use it?
How can I produce bitmap images?
How can I produce a PNG file?
Once I have produced a PNG, how can I compress it?
Driver specific questions
MetaPost driver
What about the pros and cons of this driver?
Which settings are recommended for images to be included in LaTeX documents?
Which settings are recommended to produce standalone images?
PS/EPS driver
What about the pros and cons of this driver?
How do I configure the PS level?
Use DSC comments?
Use showpage operator?
Use setpagedevice operator?
Which options are related to included images?
Which options are related to the PostScript virtual memory?
PDF driver
What about the pros and cons of this driver?
How can I inspect the graphics instructions in the PDF file?
How can I improve the on-screen rendering of fill patterns?
How can I improve the rendering of embedded images?
Should I embed images containing transparency (alpha channel in PNGs)?
How can I get rid of the "At least one alpha channel..." message?
Once I have created a PDF file, how can I optimize it?
TeX driver
What is the purpose of this driver?
Which configuration entries are neded for the TeX driver?
How do I create the EPS- and TeX-files?
SVG driver
What about the pros and cons of this driver?
How do I use SVG images in Office applications on Windows systems?
Why are some SVG images malformed when using Adobe SVG viewer plugin on Linux systems?
How do I configure the SVG level?
Standalone SVG image or embedded fragment?
How can I choose a unit for width and height?
How do I control object styling?
How do I add ECMA-script (JavaScript) code?
How do I attach event handlers and an id to objects?
How do I attach event handlers to the entire drawing?
How can I improve the quality of text rendering?
How do I convert the Ghostscript fonts to SVG fonts?
UTF-8 support FAQ
What is UTF-8?
What problems can occur when using UTF-8 encoding?
What's the problem with Fig files and UTF-8?
On Unix/Linux how will I know whether or not UTF-8 is used?
How does my graphical desktop handle native characters?
Can I simply change the LANG environment variable for one program?
How do Fig drawing applications handle UTF-8 encoding?
How does fig2vect handle UTF-8 encoding?
How are LaTeX encodings found? How do I create my own tables?
I use Fig drawings and want to switch to UTF-8 encoding. What do I have to do?
How do I set a default to enable/disable UTF-8 support in fig2vect?
How do I override the default setting on the command line?
How can I enable/disable UTF-8 support on a per-file base?
Developer FAQ
Should I apply changes to the *.c or the *.ctr files?

General FAQ

What is the purpose of the program?

The fig2vect program converts Fig drawings to MetaPost, EPS, PDF, TeX and SVG files.
It is intended for LaTeX users which want to use their Fig drawings with both LaTeX and pdfLaTeX.

How does fig2vect compare against other Fig to xxx conversion software?

Here is a list of differences between fig2vect and transfig:

What about the license conditions?

The software is licensed to you under the terms of a BSD-style license.

Installation FAQ

Installation on UNIX

Should I install from source?

Yes, you should. There are no binary installation packages out there.

Which libraries do I need to install before building fig2vect?

The following libraries are needed/recommended to install fig2vect:

Where can I get the sources?

The fig2vect project is hosted on SourceForge, you can get the sources from the project's download area via http://sourceforge.net/projects/fig2vect.

How do I build and install the software?

Installation on Windows

Should I use the setup executable or install from source?

For the wide majority of users I recommend to obtain the setup executable from http://sourceforge.net/projects/dklibs.
The dklibs-win32 package contains executable setup to install the dklibs library set and some of the applications using it (fig2vect is one of them). There are two files for each version: The dklibs-win32-*-user.exe installs binaries, libraries, header files and documentation. The dklibs-win32-*-dev.exe installs all that, the sources for the projects and the sources for the libraries needed for the projects. The *dev.exe is significantly larger than the *user.exe.

Installing from source is recommended for experienced programmers only. You need a good working knowledge of your development system, your C compiler and linker's options and makefiles.
You should also read http://dklibs.sourceforge.net/inst_w32.pdf. This document gives some hints about installing the dklibs library set and applications using it from source.

Configuration file

What is the fig2vect.cfg.sample file?

A file ${prefix}/etc/fig2vect/fig2vect.cfg is created when the fig2vect package is installed the first time. Additionally a file fig2vect.cfg.sample is installed.
During update installation the fig2vect.cfg file is not changed as it might be modified. The current version of the fig2vect.cfg file from the distribution is installed as fig2vect.cfg.sample.

How do I manage configurations after a fig2vect update

The configuration file is prepared to have three section:

A system administrator should set up site-specific configurations in section 2 only.
After an update of the fig2vect software the administrator should:

Usage FAQ

General Usage

How do I start the program

Use
  fig2vect options input-file output-file
  fig2vect options directory
to run the program. When using the MetaPost driver you can also use
  fig2vect options input-file
  fig2vect options
If there is no file name for the output file specified output goes to standard input. If the file name for the input file is omitted the program processes standard input.

Can I process compressed files directly?

Yes, it's possible if support for zlib and/or the bzip2 library was enabled during build. Simply specify a file name "*.fig.gz" or "*.fig.bz2" for input files or "*.mp.gz"..."*.eps.bz2" for output files.
To find out whether or not zlib/bzip2 support is enabled run

fig2vect --version
If the output contains the lines
zlib         General compression library
libbz2       Library for compressing/decompressing data in the bzip2 format
in the "Libraries used:" section support for zlib/bzip2 is enabled.

How do I provide configuration options to the program

The fig2vect program uses a configuration file fig2vect.cfg. This file consists of serveral sections, each section describes one configuration. A section consists of a configuration name and several key/value pairs. Keys can consist of multi-part strings. The keys are also referred to as options.

How do I choose a name for a configuration?

The name for a configuration consists of the base driver name ("mp", "eps", "tex" or "svg"), a dot (".") and a unique name of your choice containing numbers, digits, underscore and minus.
In the configuration file the name is surrounded by "[" and "]".

How does option inheritance work?

If a user chooses a configuration "mp.my-conf" by specifying

fig2vect -l mp.my-conf ...
on the command line the program searches for a configuration section "[*]" first and processes this section. The "[mp]" section is processed next, settings in this section overwrite settings from the "[*]" section. The "[mp.my-conf]" section is processed at the end, overwriting all earlier settings.
Note: only the first dot separating the base driver from the remainder of the name is of importance. Naming a section "[mp.users.me.docs]" will result in processing "[*]", "[mp]" and "[mp.users.me.docs]", not "[*]", "[mp]", "[mp.users]", "[mp.users.me]" and "[mp.users.me.docs]".

What is the name of user-specific the configuration file?

By default the configuration file "${prefix}/etc/fig2vect/fig2vect.cfg" is used. If a file "$HOME/.defaults/fig2vect.cfg" is found, this file is used instead of the default configuration file.

How does fig2vect calculate the image dimensions?

The fig2vect program inspects all drawing elements except the texts and calculates the elements dimensions. The element dimensions of all elements are combined to calculate the dimensions for the entire drawing. The output file dimensions are choosen to match the borders of the outermost elements.
Texts are skipped for two reasons:

If you use drivers writing graphics dimensions to the output (EPS, PDF or SVG) texts must not be the outermost left, right, top or bottom elements.
For the MetaPost driver this is not a problem as there is no bounding box information in the *.mp file.

How do I handle a text on the outermost left/right/top/bottom position?

If your Fig file contains text on the outermost left/right/top/bottom position you can use either

below all other graphics elements. A white filled rectangle can only be used on white page background. The rectangle must include the drawing elements, especially the texts.

How can I add some border space

Use either

below all other graphics elements. A white filled rectangle can only be used on white page background. The rectangle must include the drawing elements and the border space you want to add.

What is a background rectangle, how do I use it?

A background rectangle is an additional rectangle you add to the Fig file. This rectangle is not drawn to the output file, it is only used to calculate the output file dimensions. A background rectangle must have the following features assigned:

The configuration option
remove background rectangle = yes
must be used to prevent drawing of the background rectangle.

How can I produce bitmap images?

Produce a PNG image first (see below) and convert the PNG image to the bitmap type you need, i.e. using NetPBM, ImageMagick, Xnview (the nconvert program) or Gimp.

How can I produce a PNG image?

There are four choices:

Once I have produced a PNG, how can I compress it?

Use the optipng program, this program can be found on SourceForge at http://sourceforge.net/projects/optipng.
For normal compression run:

optipng image.png

 
To suppress the messages add the -q option:
optipng -q image.png

 
To create an image for use on web servers, use -i1 to make the image interlaced:
optipng -i1 image.png

 
For better compression use -o7:
optipng -o7 image.png

 
To attempt a large amount of combinations for compression options (this will not necessarily result in smaller files but will result in larger computation time) use:
optipng -zc1-9 -zm1-9 -zs0-3 -f0-5 image.png

 
The options -i1, -q and the compression options can be combined.

Driver specific FAQ

MetaPost driver
What about the pros and cons of this driver?

The MetaPost program can handle LaTeX special text, so you can use special text in your Fig files when using this driver. The output created by MetaPost can be used with both LaTeX and pdfLateX. As I nearly always use the MetaPost driver, this driver is better tested than the other drivers.
The MetaPost language does not provide a possibility to include any images, so you can not use included images when using this driver.

Which settings are recommended for images to be included in LaTeX documents?

Which settings are recommended to produce standalone images?

EPS driver
What about the pros and cons of this driver?

When using this driver you can use included images (PNG, JPEG, NetPBM and EPS) in the Fig file.
You can not use LaTeX special text in conjunction with this driver. In theory we could do the same things as MetaPost: write special text to a LaTeX file, process the file using LaTeX, read the DVI file and convert to EPS. Practically this is a lot of work, requiring a good knowledge of DVI file structure, PS font encodings, font metrics... and a team of volunteers contributing code.

How do I configure the PS level?

Use

ps level = 1
to produce PostScript level 1 output. Alternatively use "2" or "3".

Use DSC comments

Use

dsc comments = yes
to write DSC comments or
dsc comments = no
to suppress writing of DSC comments. Alternatively you can use "1", "2" or "3" to get DSC comments matching a certain PS level.

Use showpage operator?

This operator is only allowed in PS files, not in EPS files. PS images included into documents should not contain the showpage operator, use

ps showpage = no
for these images.
Standalone image to be viewed using i.e. GhostView should contain this operator, use
ps showpage = yes
to use the operator.

Use setpagedevice operator?

This operator is only allowed in PS files, not in EPS files. It can be used to restrict media size to match the graphics size. Turn it of for EPS files and for those PS files embedded into documents using

ps setpagedevice = no
If you produce PS files you want to convert into other graphics formats using GhostScript you can enable use of the setpagedevice operator using
ps setpagedevice = yes

Which options are related to included images?

Which options are related to the PostScript virtual memory?

PDF driver
What about the pros and cons of this driver?

This driver produces PDF images which can be included in a LaTeX source processed with pdflatex.
If there are alpha channels in embedded PNG images, the alpha channel is converted into PDF transparency data. This allows to place partially transparent images over other content.
The PDF driver has only minimal text processing capabilities (only non-special left-aligned text, all fonts are converted into the 14 PDF base fonts). It is recommended to use the PDF driver in conjunction with the TeX driver, the TeX driver should be used for both special and non-special text.

How can I inspect the graphics instructions in the PDF file?

Use the configuration entry

plain text streams = yes
or the command line option
-o plain.text.streams=yes
to produce uncompressed plain text streams, you can open the resulting PDF file in a text editor.

How can I improve the on-screen rendering of fill patterns?

Use the configuration entry

large pattern cell = yes
or the command line option
-o large.pattern.cell=yes
to make pattern cells as large as the entire PDF image. This avoids irritations on pattern cell borders.

How can I improve the rendering of embedded images?

Use the configuration entry

interpolate images = yes
or the command line option
-o interpolate.images=yes
to activate image interpolation.

Should I embed images containing transparency (alpha channel in PNGs)?

Yes, you can. But if you use PDFs containing alpha channels with pdfLaTeX you need a special line

\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>}
in the document preamble (suggested by J. Quirk in the pdftex mailing list).
The purpose of this line is to prevent PDF viewers from using CMYK as color space for temporary calculations.

How can I get rid of the "At least one alpha channel..." message?

The message

At least one alpha channel was converted to PDF.
  When referencing PDFs containing alpha data from your *.tex sources, you should use
  \ifpdf\pdfpageattr{/Group <</S /Transparency /I true /CS /DeviceRGB>>}\fi
  in the preamble.
or the german version
Ein Alpha-Kanal wurde in eine PDF-Ausgabe übertragen.
  Um PDFs mit Alpha-Kanal mit pdfLaTeX zu verwenden, sollten Sie
  \ifpdf\pdfpageattr{/Group <>}\fi
  in der Präambel der LaTeX-Quelle verwenden.
is printed when converting *.fig files referencing PNG or TIFF files containing alpha channels to PDF.
To suppress this message, use the -A option.
Use
bmeps -c -A
to configure it as a permanent option.

Alternatively you can create preferences file (Unix/Linux) or registry (Windows) entries manually:

Once I have created a PDF file, how can I optimize it?

TeX driver
What is the purpose of this driver?

This driver supports other drivers which can not handle special text theirselves (i.e. the EPS or PDF driver).

Which configuration entries are needed for the TeX driver?

It depends how you want to handle normal (non-special) text. There are two choices:

How do I create the EPS- and TeX-files?

Run

fig2vect -leps.tex myfile.fig myfile.eps
fig2vect -ltex myfile.fig myfile.tex
In the LaTeX source include
\begin{figure}
{\centering
\input{myfile.tex}
\caption{My image caption}
\label{fig:my-image-label}
}
\end{figure}
The document LaTeX source imports the figure LaTeX source which in turn imports the figure EPS file and write the special texts on top of it.

SVG driver
What about the pros and cons of this driver?

When using this driver you can use included images of any type in the Fig file as the driver does not need to convert included images, it simply writes a reference. But you must make sure your SVG viewer can render the included image.
Special comments can be used to insert ECMA-Script code into the SVG output and to attach event handlers and links to objects.
Using the Adobe SVG viewer you can embed SVG images into other applications (i.e. Office applications) on Windows systems.
Special text can not be used with this driver.

How do I use SVG images in Office applications on Windows systems?

Why are some SVG images malformed when using Adobe SVG viewer plugin on Linux systems?

You should try to set the environment variable LC_NUMERIC like this

LC_NUMERIC=C
export LC_NUMERIC
before starting the web browser.
The locale definition (LANG environment variable) might indicate the use of "," instead of "." as decimal point in floating point numbers. The SVG file format always uses "." and does not care about your language.
I think the plugin should take care of this and use localization-independent functions to read floating point numbers. Unfortunately version 3.01 doesn't.

How do I configure the SVG level?

Use the

svg version = 1.0
configuration option, you can either specify "1.0", "1.1" or "1.2" here.

Standalone SVG image or embedded fragment?

The driver can produce both standalone SVG images and SVG fragments for embedding in XML documents.
To produce standalone images use

embedded svg fragment = no
to produce an embedded fragment switch to "yes". When embedding an SVG fragment in an XML document the surrounding XML document must be prepared to use the XML namespaces "svg" and "xlink".

How can I choose a unit for width and height?

The SVG tag contains width/height information and a viewport specification. The width and height attributes specify the physical size of the image, the viewport attribute specifies the logical coordinates assigned to that area.
The

wh specification = inches
configuration setting allows to choose whether to produce with attributes measured in inches, without units ("points") or in px ("pixels").

How do I control object styling?

There are three ways to specify an SVG object's style:

  1. Multiple simple object property attributes.
    Each style property is defined via a separated XML attribute, i.e.:
    <rect fill="yellow" stroke="black" stroke-width="0.9" .../>
    
  2. A single style attribute.
    A style attribute is used:
    <rect style="fill: yellow; stroke: black; stroke-width: 0.9;" .../>
    
  3. A class attribute.
    The class attribute in an object definition refers to a style in the CSS style section.
    <style type="text/css"><![CDATA[
    .c1 {
      fill: yellow;
      stroke: black;
      stroke-width: 0.9;
    }
    ]]></style>
    <rect class="c1" .../>
    
Both style and class attribute have higher priority than the multiple simple property attributes. This is important if you plan to use animation or event handlers to change simple properties.
If an objects style is defined via style or class attribute, changes made on simple properties have no visible impact.
The multiple property attributes are used by fig2vect automatically if If none of these conditions is fullfilled the
use css = yes
setting enables the use of class attributes, "no" uses style attributes instead.

How do I add ECMA-script (JavaScript) code?

To add ECMA-script code into a <script> tag, write it into a file, i.e. "mycode.js". Use either the configuration setting

js library = mycode.js
or add a special comment
## svg: js library = mycode.js
on the document level.
Document level comments must be inserted between line 8 (transparent color) and 9 (resolution, coord-system), i.e.
#FIG 3.2
Portrait
Center
Metric
A6      
100.00
Single
-2
1200 2
is changed to
#FIG 3.2
Portrait
Center
Metric
A6      
100.00
Single
-2
## svg: js library = mycode.js
1200 2

When fig2vect writes SVG output, the contents of the file mycode.js is transferred into the <script> section.
How do I attach event handlers and an id to objects?

Comments (and special comments) related to an object must be placed immediately before the line starting the object. Event handlers can be defined in special comments, i.e. by changing

#FIG 3.2
Portrait
Center
Metric
A6      
100.00
Single
-2
## svg: js library = mycode.js
1200 2
1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 990 900 450 180 990 900 1440 720
to
#FIG 3.2
Portrait
Center
Metric
A6      
100.00
Single
-2
## svg: js library = mycode.js
1200 2
## svg: onmouseover = fill_yellow(evt)
## svg: onmouseout = fill_white(evt)
## svg: id = e1
1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 990 900 450 180 990 900 1440 720
This changes
<ellipse transform="translate(49.2 22.1)"
rx="27" ry="10.8"
fill="none" stroke="#000000" stroke-width="0.9"
/>
to
<ellipse transform="translate(49.2 22.1)"
rx="27" ry="10.8"
fill="none" stroke="#000000" stroke-width="0.9"
id="e1"
onmouseover="fill_yellow(evt)"
onmouseout="fill_white(evt)"
/>

How do I attach event handlers to the entire drawing?

Event handlers for the entire drawing can be specified in special comments in the document level, i.e. change

#FIG 3.2
Portrait
Center
Metric
A6      
100.00
Single
-2
## svg: js library = mycode.js
1200 2
to
#FIG 3.2
Portrait
Center
Metric
A6      
100.00
Single
-2
## svg: js library = mycode.js
## svg: onload = handler_onload(evt)
1200 2
This changes
<svg width="255px" height="298px" viewBox="0 0 255 298"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
to
<svg width="255px" height="298px" viewBox="0 0 255 298"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
onload="handler_onload(evt)"
>

How can I improve the quality of text rendering?

Obtain the Ghostscript fonts. Convert them to SVG fonts using the FontForge software (see below). Use the

gs svg-font directory = ...url...
configuration setting to tell fig2vect which location to reference in SVG output.

How do I convert the Ghostscript fonts to SVG fonts?

Obtain the Ghostscript fonts and the sources for these fonts. Unpack both archives into one temporary directory. You should have 35 *.pfb files and 33 *.sfd files there.
Open each of the *.pfb files in FontForge. Save the font using the same name but suffix ".svg".
Optionally: Open each of the *.sfd files in FontForge. Save the fonts as *.svg:

NimbusRomanNo9L-Regu.sfd       n021003l.svg
NimbusRomNo9L-ReguItal.sfd     n021023l.svg
NimbusRomNo9L-Medi.sfd         n021004l.svg
NimbusRomNo9L-MediItal.sfd     n021024l.svg
URWGothicL-Book.sfd            a010013l.svg
URWGothicL-BookObli.sfd        a010033l.svg
URWGothicL-Demi.sfd            a010015l.svg
URWGothicL-DemiObli.sfd        a010035l.svg
URWBookmanL-Ligh.sfd           b018012l.svg
URWBookmanL-LighItal.sfd       b018032l.svg
URWBookmanL-DemiBold.sfd       b018015l.svg
URWBookmanL-DemiBoldItal.sfd   b018035l.svg
NimbusMonL-Regu.sfd            n022003l.svg
NimbusMonL-ReguObli.sfd        n022023l.svg
NimbusMonL-Bold.sfd            n022004l.svg
NimbusMonL-BoldObli.sfd        n022024l.svg
NimbusSansL-Regu.sfd           n019003l.svg
NimbusSanL-ReguItal.sfd        n019023l.svg
NimbusSansL-Bold.sfd           n019004l.svg
NimbusSanL-BoldItal.sfd        n019024l.svg
NimbusSanL-ReguCond.sfd        n019043l.svg
NimbusSanL-ReguCondItal.sfd    n019063l.svg
NimbusSanL-BoldCond.sfd        n019044l.svg
NimbusSanL-BoldCondItal.sfd    n019064l.svg
CenturySchL-Roma.sfd           c059013l.svg
CenturySchL-Ital.sfd           c059033l.svg
CenturySchL-Bold.sfd           c059016l.svg
CenturySchL-BoldItal.sfd       c059036l.svg
URWPalladioL-Roma.sfd          p052003l.svg
URWPalladioL-Ital.sfd          p052023l.svg
URWPalladioL-Bold.sfd          p052004l.svg
URWPalladioL-BoldItal.sfd      p052024l.svg
s050000l.pfb                   s050000l.svg
URWChanceryL-MediItal.sfd      z003034l.svg
d050000l.pfb                   d050000l.svg
Experienced users might use scripting.
Place the *.svg files in a separated directory, i.e. /usr/local/share/gs-fonts/svg.
In a separated configuration section use the configuration setting
[svg.gs]
gs svg-font directory = file:///usr/local/share/gs-fonts/svg
to point to that directory. When preparing SVG files for use on web sites create an additional configuration section, i.e.
[svg.gs-web]
gs svg-font directory = http://www.my-org.com/gs-fonts/svg
So you can use the svg.gs configuration as long as you are still editing the Fig files to produce SVG files for local (and offline) viewing. Before uploading the SVG files to the web server produce the final versions using the svg.gs-web configuration.

Note: The Ghostscript fonts are licensed under the terms of the GNU General Public License. Please read the file COPYING from the Ghostscript fonts distribution for details.
If you make GPL-licensed software (i.e. the *.svg font files) accessable to other users - i.e. by placing them in a shared directory in a LAN or on a multi-user computer system or on web/ftp servers - you are responsible for making all the sources for that software available too. Access to the sources should not be more complicated than access to the software.
To fullfill the requirements of the GPL I suggest to place the archives containing Ghostscript fonts and the Ghostscript fonts sources used to build the *.svg font files in the same directories as the *.svg font files.

UTF-8 support FAQ

What is UTF-8

UNICODE is a character set using 32 bits. Documents using this character set can use characters/glyphs from different languages.
UTF-8 is an encoding for UNICODE characters using 1 byte for the glyphs used most often and up to 6 bytes (48 bits) for the not-so-popular glyphs.

What problems can occur when using UTF-8 encoding?

The same glyph is encoded differently when using UTF-8 and traditional encodings. An application showing text must know whether or not the text is UTF-8 encoded or not.

What's the problem with Fig files and UTF-8

The Fig file format does not allow to provide information whether or not UTF-8 is used.
So there are two ways to tell applications processing Fig files which encoding is used:

On Unix/Linux how will I know whether or not UTF-8 is used?

Check the LANG environment variable. If it ends on ``.UTF-8'' (not case-sensitive) -- like ``de_DE.UTF-8'' your system uses UTF-8 encoding.
If it does not end on ``.UTF-8'' -- i.e. ``de_DE'' -- your system does not use UTF-8 encoding.

How does my graphical desktop handle native characters?

Handling of native characters (i.e. german umlauts) depends on the systems LANG setting.

Can I simply change the LANG environment variable for one program?

No! All desktop applications must use the same UTF-8 setting. You may change LANG from ``de_DE'' to ``en_US'' or from ``de_DE.UTF-8'' to ``en_US.UTF-8'', but not from ``de_DE'' to ``de_DE.UTF-8''.
If you want to change the UTF-8 usage, log in as root (or Administrator), change the setting globally -- i.e. in /etc/sysconfig/i18n -- and reboot the system.
If the desktop delivers not-UTF-8 encoded data and an application expects UTF-8 encoded data (or vice versa) there is a wide variety of results: unknown keyboard bindings, application crashes...

How do Fig drawing applications handle UTF-8 encoding?

How does fig2vect handle UTF-8 encoding?

Fig2vect cares about UTF-8 encoded text in non-special text only.
In special text you can use LaTeX code directly to produce the glyphs you need.
Handling UTF-8 encoded strings depends on the driver:

How are the LaTeX encodings found? How do create my own tables?

The dklibs library set used by fig2vect uses a preference to find a shared directory (shared between all dklibs-based applications). This directory is /usr/local/share on Unix/Linux and c:\programme\krause\share on Windows by default. The ``c:\programme'' part can differ, it depends on your Windows version and language.
This directory contains a sub-directory ``uc2lat-t'' providing tables for translation from UNICODE to LaTeX. There is a nested directory structure containing multiple files. Files are loaded on demand.
The encoding for UNICODE 0x01234567 is found by searching the file 01/23/45.dat file for an 0x67 entry.
There are three types of entries in the file:

Example (from 00/00/00.dat):
# Raute
*	0x23	\#

# Asterisk
t	0x2A	\textasteriskcentered{}
m	0x2A	*

# Smaller-than
t	0x3C	\textless{}
m	0x3C	<

I use Fig drawings and want to switch to UTF-8 encoding. What do I have to do?

It depends on your drawing application.

How do I set a default to enable/disable UTF-8 support in fig2vect?

There are different ways to change the default setting:

How do I override the default setting on the command line?

Specify the command line options

-o utf-8=yes
or
-o utf-8=no
when running fig2vect.

How can I enable/disable UTF-8 support on a per-file base?

To process Fig files created by another user or on another computer, open the Fig file in a text editor.
In the document comment section -- between line 8 (transparent color) and line 9 (resolution and coordinates origin) -- place a special comment

## *: utf-8 = yes
to enable UTF-8 support or
## *: utf-8 = no
to disable UTF-8 support.

This all sounds complicated. Is there an example?

Developer FAQ

Should I apply changes to the *.c or the *.ctr files?

Apply changes to the *.ctr files only.
The *.c files are generated from the *.ctr files automatically by running the tracecc preprocessor. See http://dklibs.sourceforge.net for details, there is a manual tracecc.pdf available.


1 $sysconfdir is the system configuration directory, typically /etc or /usr/local/etc.