{"id":159,"date":"2007-10-27T07:30:35","date_gmt":"2007-10-27T07:30:35","guid":{"rendered":"http:\/\/ahay.org\/blog\/?p=159"},"modified":"2015-08-04T23:51:43","modified_gmt":"2015-08-04T23:51:43","slug":"how-do-i-change-fonts-in-vplot-graphics","status":"publish","type":"post","link":"https:\/\/ahay.org\/blog\/2007\/10\/27\/how-do-i-change-fonts-in-vplot-graphics\/","title":{"rendered":"How do I change fonts in vplot graphics?"},"content":{"rendered":"<p>The collection of fonts in Vplot is small and goes back to so-called &#8220;Hershey fonts&#8221; (created originally by Dr. A.V. Hershey at the U. S. National Bureau of Standards).<br \/>\nYou can use <strong>\\F# <\/strong> directives to switch between different fonts.<br \/>\nIn 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:<\/p>\n<ul>\n<li><strong>\\><\/strong>\tAdvance one interletter space<\/li>\n<li><strong>\\<<\/strong>\tBack up one interletter space<\/li>\n<li><strong>\\\\^<\/strong>Raise one half of a capital letter height<\/li>\n<li><strong>\\\\_<\/strong> Lower one half of a capital letter height<\/li>\n<li><strong>\\g\t<\/strong> Continue processing text, but don&#8217;t actually print it (&#8220;ghostify it&#8221;).<br \/>\nThis is useful if you want to leave space to go back and add something by hand.<\/li>\n<li><strong>\\G<\/strong> Start printing text again (&#8220;deghostify&#8221;)<\/li>\n<li><strong>\\n<\/strong> Newline<\/li>\n<li><strong>\\h<\/strong>\tBackspace (control-h also works) back up over the last character<\/li>\n<li><strong>\\-<\/strong> Does nothing; used to prevent a group of characters from being formed into a ligature.<\/li>\n<li><strong>\\\\<\/strong>\tPrint a backslash<\/li>\n<\/ul>\n<p>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.<\/p>\n<ul>\n<li><strong>\\s#<\/strong> Size change.  Change to # percent of the size set in the text vplot. <strong>\\s100<\/strong>  restores the default height.<\/li>\n<li><strong>\\f#<\/strong>\tAdd # to current fatness.  Goes out of effect when text printing is finished.<\/li>\n<li><strong>\\F#<\/strong>\tSwitch to font number #.  (-1 restores the default font).<\/li>\n<li><strong>\\k#<\/strong>\tMove by # space widths to the right (in percent; 100 = one space width). Negative numbers are allowed (moves left).<\/li>\n<li><strong>\\r#<\/strong>\tMove up # character heights (in percent; 100 = the height of a standard capital letter). Negative numbers are allowed (moves down).<\/li>\n<li><strong>\\v#<\/strong> 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.<\/li>\n<li><strong>\\c#<\/strong>\tSwitch to color number #.  <strong>\\c-1<\/strong> restores the current drawing color. Vplot&#8217;s current drawing color is not changed by changing the color inside text.<\/li>\n<li><strong>\\m#<\/strong>\tSave current position in register number #.<\/li>\n<li><strong>\\M#<\/strong> Restore position saved in register number #.<\/li>\n<\/ul>\n<p>The following example is from <a href=\"\/RSF\/book\/rsf\/rsf\/sfgraph.html\">rsf\/rsf\/sfgraph<\/a>:<br \/>\n<img decoding=\"async\" src=\"\/RSF\/book\/rsf\/rsf\/sfgraph\/Fig\/t10.png\" alt=\"\" \/><br \/>\nThe line to create this title is <\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >title=\"\\s100 \\F11 Polinom CHebysheva + \\F3 T\\\\_\\s75 n\\\\^\\s100 (cos \\F10 q) = \\F3 cos n\\F10 q\"<\/pre><\/div>\n<p>.<br \/>\nYou can find a set of tests for different fonts in <a href=\"\/RSF\/pens\/tests.html\">pens\/tests<\/a>:<br \/>\n<center><br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font0.png\" alt=\"Font 0\" \/><br \/>original (designed by Rob Clayton at Stanford)<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font1.png\" alt=\"Font 1\" \/> <br \/>roman simplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font2.png\" alt=\"Font 2\" \/> <br \/>roman duplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font3.png\" alt=\"Font 3\" \/> <br \/>roman complex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font4.png\" alt=\"Font 4\" \/> <br \/>roman triplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font5.png\" alt=\"Font 5\" \/><br \/> italic complex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font6.png\" alt=\"Font 6\" \/><br \/> italic triplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font7.png\" alt=\"Font 7\" \/><br \/> script simplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font8.png\" alt=\"Font 8\" \/><br \/> script complex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font9.png\" alt=\"Font 9\" \/><br \/> greek simplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font10.png\" alt=\"Font 10\" \/><br \/> greek complex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font11.png\" alt=\"Font 11\" \/><br \/> Cyrillic complex<br \/>\n\\<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font12.png\" alt=\"Font 12\" \/><br \/> German style gothic triplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font13.png\" alt=\"Font 13\" \/><br \/> Greek style gothic triplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font14.png\" alt=\"Font 14\" \/><br \/> Italian style gothic triplex<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font15.png\" alt=\"Font 15\" \/><br \/> mathematics<br \/>\n<img decoding=\"async\" src=\"\/RSF\/pens\/tests\/Fig\/font16.png\" alt=\"Font 16\" \/><br \/> miscellaneous<br \/>\n<\/center><br \/>\nTo display a particular font character by character on the screen, try something like<\/p>\n<div class=\"code-box\"><div class=\"code-title\"><i class=\"fa fa-code\"><\/i> <div class=\"pull-right\"><a href=\"#\" class=\"btn btn-default btn-xs toggle-code\" data-toggle=\"tooltip\" title=\"Toggle code\"><i class=\"fa fa-toggle-up\"><\/i><\/a><\/div><\/div><pre >\nsfplas < RSFSRC\/pens\/fonts\/cyrilc.vplot_font | \\\nxtpen xcenter=0 ycenter=0 scale=50 pause=1\n<\/pre><\/div>\n<p>Thanks to Joe Dellinger for help with this answer! For more information, see <a href=\"https:\/\/reproducibility.org\/wikilocal\/docs\/vancouver06\/dellinger_vplot.ppt\">his presentation<\/a> on Vplot and <a href=\"http:\/\/rsf.svn.sourceforge.net\/viewvc\/rsf\/trunk\/pens\/docs\/vplottext.mn?view=markup\">vplotttext.m<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The collection of fonts in Vplot is small and goes back to so-called &#8220;Hershey fonts&#8221; (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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-159","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":1,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/159\/revisions"}],"predecessor-version":[{"id":757,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/posts\/159\/revisions\/757"}],"wp:attachment":[{"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/media?parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/categories?post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahay.org\/blog\/wp-json\/wp\/v2\/tags?post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}