postscript
and pdf
graphics devices.
Type1Font(family, metrics, encoding = "default")
CIDFont(family, cmap, cmapEncoding, pdfresource = "")
postscriptFonts
) you need to change the family name.Type1Font
, the name of an encoding file.
Defaults to "default"
, which maps on Unix-alikes to
"ISOLatin1.enc"
and on Windows to "WinAnsi.enc"
.
Otherwise, a file name in the ‘enc’ directory of the
grDevices package, which is used if the path does not contain a
path separator. An extension ".enc"
can be omitted.pdf
; users should not be expected to
provide this."Type1Font"
or "CIDFont"
.
Type1Fonts
, if four ‘.afm’ files are supplied the
fifth is taken to be "Symbol.afm"
. Relative paths are taken
relative to the directory ‘R_HOME/library/grDevices/afm’.
The fifth (symbol) font must be in AdobeSym
encoding.
However, the glyphs in the first four fonts are referenced by name
and any encoding given within the ‘.afm’ files is not used.The ‘.afm’ files may be compressed with (or without) final extension ‘.gz’: the files which ship with R are installed as compressed files with this extension.
Glyphs in CID-keyed fonts are accessed by ID (number) and not by name.
The CMap file maps encoded strings (usually in a MBCS) to IDs, so
cmap
and cmapEncoding
specifications must match. There
are no real bold or italic versions of CID fonts (bold/italic were
very rarely used in traditional East Asian topography), and for the
pdf
device all four font faces will be identical.
However, for the postscript
device, bold and italic (and
bold italic) are emulated.
CID-keyed fonts are intended only for use for the glyphs of East Asian
languages, which are all monospaced and are all treated as filling the
same bounding box. (Thus plotmath
will work with such
characters, but the spacing will be less carefully controlled than
with Western glyphs.) The CID-keyed fonts do contain other
characters, including a Latin alphabet: non-East-Asian glyphs are
regarded as monospaced with half the width of East Asian glyphs. This
is often the case, but sometimes Latin glyphs designed for
proportional spacing are used (and may look odd). We strongly
recommend that CID-keyed fonts are only used for East Asian
glyphs.
postscript
, pdf
,
postscriptFonts
, and pdfFonts
.
## This duplicates "ComputerModernItalic".
CMitalic <- Type1Font("ComputerModern2",
c("CM_regular_10.afm", "CM_boldx_10.afm",
"cmti10.afm", "cmbxti10.afm",
"CM_symbol_10.afm"),
encoding = "TeXtext.enc")
## Not run:
# ## This could be used by
# postscript(family = CMitalic)
# ## or
# postscriptFonts(CMitalic = CMitalic) # once in a session
# postscript(family = "CMitalic", encoding = "TeXtext.enc")
# ## End(Not run)
Run the code above in your browser using DataLab