From J Wiki
Jump to navigation Jump to search
Plot | Verbs | Class Commands Data Options Outputs Types | Colors Fonts Keys Text YAxes | Function Multi Shape

Plot supports PostScript Type 1 fonts and their Windows equivalents.

Fonts for isigraph drawing may be given in the standard fontspec format, see fontspec.

In addition, fonts may be given as one of the standard PostScript Type 1 fonts. This is a font name and size from the following 14 fonts, arranged in four families:

  • Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique
  • Courier, Courier-Bold, Courier-Oblique, Courier-BoldOblique
  • Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic
  • Symbol, ZapfDingbats

In each case, capitalization is ignored.

The following are equivalent:

pd 'titlefont arial 15 bold italic'
pd 'titlefont helvetica-boldoblique 15'

When drawing to an isigraph window, fonts in either format are accepted.

When drawing to EPS or PDF, fonts are converted if necessary to the PostScript standard. Specifically, Arial maps to Helvetica, Lucida Console to Courier, and Times New Roman to Times-Roman. The default map is to Helvetica.

Other Fonts

Fonts other than the PostScript Type 1 fonts or their Windows equivalents are supported if their font metrics and other required information are available. In the J601 release, this includes two Chinese fonts, MSung-Light (traditional) and STSong-Light (simplified), and these work in isigraph, and output to PDF.

Font Scaling

There is one major difference in the treatment of fonts for output to isigraph, and for other outputs:

  • Font metrics for an isigraph are obtained by using glexent, and represent text size in pixels.
  • Font metrics for other outputs are calculated from font metric tables, and represent text size in points (1/72 inch).

Unfortunately, these two calculations are not the same. Typically, screen resolution is around 96 pixels per inch, so to match a font drawn in an isigraph window, the font needs to be scaled down to 72%96 = 0.75 size when drawn to EPS or PDF.

To enable EPS and PDF plots to match isigraphs, font sizes for these plots are scaled by a factor of FONTSCALE, which is set to 0.75 by default. In this case, plots drawn to isigraph, and to EPS or PDF, appear essentially the same.

This also means that if you specify a font size of say 12 points, then in the EPS or PDF file, the font is actually entered as being 12 * 0.75 = 9 points. To avoid this behaviour, reset plotscale, i.e. use:

pd 'plotscale 1'