| getLatexCharMetrics {tikzDevice} | R Documentation |
Obtain LaTeX Font Metrics for Characters This function is used to retrieve the ascent, decent and width of a character glyph as it would appear in output typeset by LaTeX.
getLatexCharMetrics(charCode, cex=1, face=1, engine=getOption("tikzDefaultEngine"))
charCode |
an integer that corresponds to a symbol in the ASCII
character table under the Type 1 font encoding. All numeric values are
coerced using |
cex |
a real number that specifies a scaling factor that is to be applied to device output. |
face |
an integer in the range [1-5] that specifies the font face to use. See par for details. |
engine |
a string specifying which TeX engine to use. Possible values are 'pdftex' and 'xetex'. See the Unicode section of tikzDevice for details. |
getLatexCharMetrics first checks to see if metrics have allready been
calculated for the given character using the given values of cex and
face. If so, cached values are returned. If no cached values exists,
the LaTeX compiler specified by options( tikzLatex ) is invoked in
order to calculate them.
metrics |
A numeric vector holding ascent, descent, width character metrics. Values should all be nonnegative. |
tikzDevice tries very hard when it is loaded to find a
working latex or pdflatex command. If it is
successful the command is set in options('tikzLatex'), otherwise
this function will fail.
Charlie Sharpsteen source@sharpsteen.net
PGF Manual
# Calculate ascent, descent and width for "A" getLatexCharMetrics(65)