Non-ascii, extended ascii, and other special charactersSupport depends on which graphics environment you're rendering in; see below.
Embedded newlinesIn all graphics environments and fonts, ploticus recognizes backslash n (\n) as representation of a newline, in all text that is displayed.
Inline superscripts and subscriptsIn all graphics environments and fonts, ploticus (2.30+) recognizes the following inline constructs for representing superscripts and subscripts in all text that is displayed:
See this example.
Limitations: superscripts and subscripts render correctly only when
using a monospace font such as the default GD fonts, default X11 fonts, or /Courier.
In scripts, to ensure backward compatibility, this capability must be turned on using proc
settings (see the example). Prefabs have this capability turned on by default.
Inline font changes and size changesNot supported. However, each text attribute generally has a "details" attribute where font and size can be specified.
Math formulasNot supported, other than superscript and subscripts.
What fonts are available?
This depends on what output format you are producing, since
Ploticus does not include its own internal fonts.
PNG, GIF, etc.If the default built-in GD code is used, a basic ascii font is available in 5 sizes (you can specify any point size in ploticus; the nearest available size will be used). You can't set the font from ploticus; -font (etc.) will have no effect. Vertical rendering is available. Availability of symbols and nonroman characters is limited to those in ASCII extended range. Note: some characters in the GD extended range don't agree with X11 or PostScript (there were apparently conflicting standards defining extended ascii). The GD character set is defined in gdfontg.c, which may be modified to suit if necessary.
PNG, JPEG, WBMP with FreeType2 supportIf your ploticus build uses GD with FreeType2 support, you can use TrueType fonts. The basic GD ascii font is also available in 5 sizes (font name is ascii), and is the default. You can set the font from ploticus using -font, proc page font attribute, or font in any textdetails attribute.
To select a TrueType font, specify its file name, without the .ttf extension. Ploticus has no provision for mapping "font names" to TrueType file names. Eg. if you have a font file called times.ttf you would select it by saying:
You will need to have some TrueType .ttf font files stored in a directory somewhere. The environment variable GDFONTPATH must be set to contain the pathname of this directory. TrueType font files may be found on win32 machines in c:/winnt/fonts or they may be downloaded on the web. Font file names containing embedded whitespace will likely be problematic.. if so rename (or soft-link) to a name that doesn't have embedded whitespace.
Vertical rendering is available. Availability of symbols and nonroman characters: Constructs such as À may be used, and unicode fonts can be used (see below).
Here is an example rendered using TTF sans serif font.
For more information on building ploticus to use FreeType2, see ./src/FreeType2
PostScript, EPSUses PostScript fonts. The default font is /Helvetica. (Postscript font names must always be written with the initial slash.) You can set the font from ploticus using -font, proc page font attribute, or font in any textdetails attribute, for example:
Usually these fonts are available: /Helvetica /Helvica-Oblique /Helvetica-Bold
/Helvetica-BoldOblique /Times-Roman /Times-Bold; many others are
usually available as well.
Vertical rendering is available.
Availability of symbols and nonroman characters:
As of version 2.01, the ploticus postscript driver supports
ISO-LATIN encoding, so that European characters and symbols in ASCII extended range
may be used.
You can use the troff-like
feature that uses the /Symbols font.
SVGIf you're using SVG , font availablility and naming depends on the environment in effect where the SVG file is being viewed, ie. if you're viewing on MSIE on a win32 system see the list of fonts available in MS Word. SVG viewing environments generally are "intelligent" about font selection and substituting.
Ploticus uses a Helvetica as the default font. I've also used Courier, Times-Roman, Bookman, Stencil, Magneto, etc. You can set the font from ploticus using -font, proc page font attribute, or font in any textdetails attribute, for example:
Font file names containing embedded whitespace may be problematic.. if so rename (or soft-link) to a name that doesn't have embedded whitespace.
Vertical rendering is available.
European characters and symbols in ASCII extended range may be used.
Constructs such as À may be used, and unicode fonts can be used (see below)
with utf-8 encoding.
SWF (flash)The environment variable SWF_FONTS_DIR must be set to the full pathname of a directory containing your .fdb font files. The default will be Helvetica.fdb; you can select a font from the command line like this: -font Times-Roman which would then attempt to load Times-Roman.fdb from your SWF_FONTS_DIR directory. Helvetica.fdb and a few other fonts are available as accessories from the download page. Font file names containing embedded whitespace are problematic with ploticus' SWF driver.. rename (or soft-link) to a name that doesn't have embedded whitespace.
X11Always uses the same fixed width font. You can't set the font from ploticus; -font (etc.) will have no effect. Depending on availablility, this will be either -adobe-courier-bold-r-normal, -misc-fixed-medium-r-normal, or as a last resort, 9x15. Proper vertical rendering is not available. Availability of symbols and nonroman characters is limited to those in ASCII extended range.
UNICODE FONTSUnicode fonts may be used for titles, labels, tags, category names, etc. in the script or in data, if you are rendering in SVG or PNG/JPEG with FreeType2 (versions 2.05+). Unicode is not yet supported within dates.
Your ploticus script or prefab parameters should be utf-8 encoded.
You will need a unicode TTF font such as Bitstream Cyberbit (freely downloadable
on the internet). Set ploticus to use this font.
For SVG, set the XML encoding to utf-8.
Font and XML encoding can be set using
, from the
pl command line
, or in a
PNG/JPEG can be viewed by standard means, since the fonts have already been
rendered and do not need to be available to the viewer application.
SVG must be viewed by an application that can work with your Unicode font(s)
(MSIE browser currently seems to do the best job).
This example shows the ascii and Western European range that is available by default.
This example demonstrates rendering of Chinese using a unicode font.
This example demonstrates superscripts and subscripts.
data display engine
Copyright Steve Grubb
|Ploticus is hosted at http://ploticus.sourceforge.net|