The collection of fonts in Vplot is small and goes back to so-called “Hershey fonts” (created originally by Dr. A.V. Hershey at the U. S. National Bureau of Standards).
You can use \F# directives to switch between different fonts.
In general, there are two sorts of escape sequences, those that take an argument and those that do not. Here is a complete list of escape sequences that do not take an argument:
- \> Advance one interletter space
- \< Back up one interletter space
- \\^Raise one half of a capital letter height
- \\_ Lower one half of a capital letter height
- \g Continue processing text, but don’t actually print it (“ghostify it”).
This is useful if you want to leave space to go back and add something by hand. - \G Start printing text again (“deghostify”)
- \n Newline
- \h Backspace (control-h also works) back up over the last character
- \- Does nothing; used to prevent a group of characters from being formed into a ligature.
- \\ Print a backslash
The following escape sequences take an integer argument immediately after, with a required space after the integer to delineate the end. This space is not printed.
- \s# Size change. Change to # percent of the size set in the text vplot. \s100 restores the default height.
- \f# Add # to current fatness. Goes out of effect when text printing is finished.
- \F# Switch to font number #. (-1 restores the default font).
- \k# Move by # space widths to the right (in percent; 100 = one space width). Negative numbers are allowed (moves left).
- \r# Move up # character heights (in percent; 100 = the height of a standard capital letter). Negative numbers are allowed (moves down).
- \v# Print ASCII character number # in the current font, stripping it of any special meaning. This and ligatures are the only way that glyphs numbered greater than 255 are available.
- \c# Switch to color number #. \c-1 restores the current drawing color. Vplot’s current drawing color is not changed by changing the color inside text.
- \m# Save current position in register number #.
- \M# Restore position saved in register number #.
The following example is from rsf/rsf/sfgraph:
The line to create this title is
.
You can find a set of tests for different fonts in pens/tests:
original (designed by Rob Clayton at Stanford)
roman simplex
roman duplex
roman complex
roman triplex
italic complex
italic triplex
script simplex
script complex
greek simplex
greek complex
Cyrillic complex
\
German style gothic triplex
Greek style gothic triplex
Italian style gothic triplex
mathematics
miscellaneous
To display a particular font character by character on the screen, try something like
Thanks to Joe Dellinger for help with this answer! For more information, see his presentation on Vplot and vplotttext.m.
Thank you very much Sergey! Very useful post I must say when one needs math symbols in labels 🙂
Use font= parameter (currently available only in the development version).
See also A journal requires tick labels on my plots to be oriented vertically and aligned on the left. How do I achieve that?How do I change fonts in Vplot graphics?”
Update: If you generate Geophysics manuscripts using rsftex, the font change should happen automatically. Otherwise, use font= parameter (currently available only in the development version).
See also A journal requires tick labels on my plots to
Update: If you generate Geophysics manuscripts using rsftex, the font change should happen automatically. Otherwise, use font= parameter (currently available only in the development version).
See also A journal requires tick labels on my plots to
Hallo Sergey!
Thank you for this posting!
I try to use the “.vplot_font”-files, but I do not understand what is the definition from 2 numbers after “e”-letter like this:
e 10 11 f
I can to use the coordinates and I can to paint with them, but what are the 2 numbers?
I think a one from them is a letter-width, but which from them?
I need the documentation from “.vplot_font”-files. Where can I find it?
———–
Russian:
ÐобÑого вÑемени ÑÑÑок СеÑгей!
СпаÑибо Ñебе за пÑедоÑÑавленнÑÑ Ð·Ð´ÐµÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¸ ÑÑÑлки.
Я пÑобÑÑ ÑазобÑаÑÑÑÑ Ñо ÑÑÑÑкÑÑÑой “.vplot_font”-Ñайлов и не Ð¼Ð¾Ð³Ñ Ð½Ð¸ÐºÐ°Ðº понÑÑÑ
ÑÑо ознаÑаÑÑ Ð´Ð²Ðµ ÑиÑÑÑ Ð¿Ð¾Ñле бÑÐºÐ²Ñ “е” в Ð½Ð¸Ñ , напÑимеÑ:
e 10 11 f
Я Ð¼Ð¾Ð³Ñ Ð¿Ð¾Ð»ÑзоваÑÑÑÑ ÐºÐ¾Ð¾ÑдинаÑами и Ñ Ð¼ÐµÐ½Ñ Ð¿Ð¾Ð»ÑÑаеÑÑÑ ÑиÑоваÑÑ Ð±ÑквÑ, но Ñ Ð½Ðµ Ð·Ð½Ð°Ñ ÑÑо знаÑÐ°Ñ ÑÑи 2 ÑиÑÑÑ.
Я дÑÐ¼Ð°Ñ ÑÑо одна из Ð½Ð¸Ñ Ð¾Ð·Ð½Ð°ÑÐ°ÐµÑ ÑиÑÐ¸Ð½Ñ Ñайла, но ÐºÐ°ÐºÐ°Ñ Ð¸Ð· Ð½Ð¸Ñ ?
Ðб ÑÑом ÑÑиÑÑе Ñ Ñзнал ÑлÑÑайно и полÑÑил ÑолÑко бÑÐºÐ²Ñ Ð»Ð°ÑинÑкого алÑавиÑа.
ÐооÑдинаÑÑ Ð² Ñом ÑÑиÑÑе ÑÑоÑÑ Ð½ÐµÐ¼Ð½Ð¾Ð³Ð¾ вÑÑе Ñем в ÑÑÐ¸Ñ , Ñ Ð¾ÑÑ Ð¾Ð½Ð¸ Ñоже на оÑнове Hershey
и Ñ Ð²Ð¾Ñ Ð´ÑÐ¼Ð°Ñ Ð¼Ð¾Ð¶ÐµÑ Ð·Ð´ÐµÑÑ ÐµÑÑ ÐºÐ°ÐºÐ¸Ðµ-Ñо оÑобенноÑÑи нÑжно ÑÑиÑÑваÑÑ Ð¿Ñи пÑоÑиÑовке?
ÐÑÐµÐ½Ñ Ñ Ð¾ÑеÑÑÑ Ð½Ð°Ð¹Ñи докÑменÑаÑÐ¸Ñ Ðº “.vplot_font”-Ñайлам. Ðде ÐµÑ Ð¼Ð¾Ð¶Ð½Ð¾ найÑи?
ÐаÑанее болÑÑое ÑпаÑибо!
The documentation for vplot_font files is in the comments to makefont.c:
http://rsf.svn.sourceforge.net/viewvc/rsf/trunk/pens/fonts/makefont.c?view=markup
Update: If you generate Geophysics manuscripts using rsftex, the font change should happen automatically. Otherwise, use font= parameter (currently available only in the development version).
See also A journal requires tick labels on my plots to
Update: If you generate Geophysics manuscripts using rsftex, the font change should happen automatically. Otherwise, use font= parameter.
See also A journal requires tick labels on my plots to be oriented vertically and aligned on the left. How do
sfgraph belongs to the family of plotting programs and is used for plotting explicitly defined 2-D curves.
Here are 10 basic facts about this program:
sfgraph shares most of its parameters with some other 2-D plotting programs (sfgrey, sfcontour,
sfgraph belongs to the family of plotting programs and is used for plotting explicitly defined 2-D curves.
Here are 10 basic facts about this program:
sfgraph shares most of its parameters with some other 2-D plotting programs (sfgrey, sfcontour,