| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0537e33 commit 160b201
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,13 @@ | |||
| 1 | + 2011-09-27 Ethan A Merritt <merritt@u.washington.edu> | ||
| 2 | + | ||
| 3 | + * term/emf.trm term/fig.trm term/tgif.trm: Prefer the new syntax | ||
| 4 | + set term ... font "<name>,<size>" in the documentation. This does not | ||
| 5 | + change the terminal input, only the docs and the options string echoed | ||
| 6 | + back by "show term". | ||
| 7 | + | ||
| 8 | + * term/canvas.trm: Implement set term canvas ... font "<name>,<size>". | ||
| 9 | + Currently the name is ignored. | ||
| 10 | + | ||
| 1 | 11 | 2011-09-23 Ethan A Merritt <merritt@u.washington.edu> | |
| 2 | 12 | ||
| 3 | 13 | * docs/gnuplot.doc src/plot2d.c: Defer interpretation of newhistogram | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* Hello, Emacs, this is -*-C-*- | |
| 2 | - * $Id: canvas.trm,v 1.53 2011/09/06 03:17:42 sfeam Exp $ | ||
| 2 | + * $Id: canvas.trm,v 1.54 2011/09/27 23:18:02 sfeam Exp $ | ||
| 3 | 3 | * | |
| 4 | 4 | */ | |
| 5 | 5 | ||
@@ -102,6 +102,7 @@ static double canvas_dashlength_factor = 1.0; | |||
| 102 | 102 | static double CANVAS_ps = 1; /* pointsize multiplier */ | |
| 103 | 103 | static double canvas_font_size = 10; | |
| 104 | 104 | static double canvas_fontscale = 1.0; | |
| 105 | + static char * canvas_font_name = NULL; | ||
| 105 | 106 | static char *canvas_justify = ""; | |
| 106 | 107 | static int canvas_text_angle = 0; | |
| 107 | 108 | static int canvas_in_a_path = FALSE; | |
@@ -136,14 +137,16 @@ static struct { | |||
| 136 | 137 | } canvas_state; | |
| 137 | 138 | ||
| 138 | 139 | enum CANVAS_case { | |
| 139 | - CANVAS_SIZE, CANVAS_FSIZE, CANVAS_NAME, CANVAS_STANDALONE, CANVAS_TITLE, | ||
| 140 | + CANVAS_SIZE, CANVAS_FONT, CANVAS_FSIZE, | ||
| 141 | + CANVAS_NAME, CANVAS_STANDALONE, CANVAS_TITLE, | ||
| 140 | 142 | CANVAS_LINEWIDTH, CANVAS_MOUSING, CANVAS_JSDIR, CANVAS_ENH, CANVAS_NOENH, | |
| 141 | 143 | CANVAS_FONTSCALE, CANVAS_SOLID, CANVAS_DASHED, CANVAS_DASHLENGTH, | |
| 142 | 144 | CANVAS_ROUNDED, CANVAS_BUTT, CANVAS_BACKGROUND, CANVAS_OTHER | |
| 143 | 145 | }; | |
| 144 | 146 | ||
| 145 | 147 | static struct gen_table CANVAS_opts[] = | |
| 146 | 148 | { | |
| 149 | + { "font", CANVAS_FONT }, | ||
| 147 | 150 | { "fsize", CANVAS_FSIZE }, | |
| 148 | 151 | { "name", CANVAS_NAME }, | |
| 149 | 152 | { "size", CANVAS_SIZE }, | |
@@ -194,6 +197,7 @@ TERM_PUBLIC void | |||
| 194 | 197 | CANVAS_options() | |
| 195 | 198 | { | |
| 196 | 199 | int canvas_background = 0; | |
| 200 | + int sep; | ||
| 197 | 201 | ||
| 198 | 202 | /* (c_token == 2) only in the case of 'set termoption' */ | |
| 199 | 203 | /* which is after we have already initialized everything. */ | |
@@ -256,6 +260,27 @@ CANVAS_options() | |||
| 256 | 260 | CANVAS_standalone = TRUE; | |
| 257 | 261 | break; | |
| 258 | 262 | ||
| 263 | + case CANVAS_FONT: | ||
| 264 | + /* FIXME: The HTML5 canvas element did not originally provide any */ | ||
| 265 | + /* support for text output, let alone fonts.There are now text routines */ | ||
| 266 | + /* in the HTML5 draft spec, but they are not yet widely supported. */ | ||
| 267 | + /* So for now we will accept a font request, but ignore it. */ | ||
| 268 | + /* Eventually the text calls will look something like */ | ||
| 269 | + /* ctx.font = "12pt Times"; */ | ||
| 270 | + /* ctx.textAlign = "center"; */ | ||
| 271 | + /* ctx.fillText( "Oh goody, text support.", x, y ); */ | ||
| 272 | + /* */ | ||
| 273 | + free(canvas_font_name); | ||
| 274 | + if (!(canvas_font_name = try_to_get_string())) | ||
| 275 | + int_error(c_token,"font: expecting string"); | ||
| 276 | + sep = strcspn(canvas_font_name,","); | ||
| 277 | + if (canvas_font_name[sep] == ',') { | ||
| 278 | + sscanf(&(canvas_font_name[sep+1]), "%lf", &canvas_font_size); | ||
| 279 | + if (canvas_font_size <= 0) | ||
| 280 | + canvas_font_size = 10; | ||
| 281 | + } | ||
| 282 | + break; | ||
| 283 | + | ||
| 259 | 284 | case CANVAS_FSIZE: | |
| 260 | 285 | canvas_font_size = real_expression(); | |
| 261 | 286 | if (canvas_font_size <= 0) | |
@@ -1407,7 +1432,7 @@ START_HELP(canvas) | |||
| 1407 | 1432 | " HTML5 canvas element.", | |
| 1408 | 1433 | " Syntax:", | |
| 1409 | 1434 | " set terminal canvas {size <xsize>, <ysize>} {background <rgb_color>}", | |
| 1410 | - " {fsize <fontsize>}", | ||
| 1435 | + " {font {<fontname>}{,<fontsize>}} | {fsize <fontsize>}", | ||
| 1411 | 1436 | " {{no}enhanced} {linewidth <lw>}", | |
| 1412 | 1437 | " {rounded | butt}", | |
| 1413 | 1438 | " {solid | dashed {dashlength <dl>}}", | |
@@ -1417,10 +1442,14 @@ START_HELP(canvas) | |||
| 1417 | 1442 | "", | |
| 1418 | 1443 | " where <xsize> and <ysize> set the size of the plot area in pixels.", | |
| 1419 | 1444 | " The default size in standalone mode is 600 by 400 pixels.", | |
| 1420 | - " The default font size is 10. NB: Only one font is available, the ascii", | ||
| 1421 | - " portion of Hershey simplex Roman provided in the file canvastext.js.", | ||
| 1422 | - " You can replace this with the file canvasmath.js, which contains also", | ||
| 1423 | - " UTF-8 encoded Hershey simplex Greek and math symbols.", | ||
| 1445 | + " The default font size is 10.", | ||
| 1446 | + "", | ||
| 1447 | + " NB: Only one font is available, the ascii portion of Hershey simplex Roman", | ||
| 1448 | + " provided in the file canvastext.js. You can replace this with the file", | ||
| 1449 | + " canvasmath.js, which contains also UTF-8 encoded Hershey simplex Greek and", | ||
| 1450 | + " math symbols. For consistency with other terminals, it is also possible to", | ||
| 1451 | + " use `font \"name,size\"`. Currently the font `name` is ignored, but browser", | ||
| 1452 | + " support for named fonts is likely to arrive eventually.", | ||
| 1424 | 1453 | "", | |
| 1425 | 1454 | " The default `standalone` mode creates an html page containing javascript", | |
| 1426 | 1455 | " code that renders the plot using the HTML 5 canvas element. The html page", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* Hey Emacs this is -*- C -*- | |
| 2 | - * $Id: emf.trm,v 1.76 2011/09/01 03:45:32 sfeam Exp $ | ||
| 2 | + * $Id: emf.trm,v 1.77 2011/09/27 23:18:02 sfeam Exp $ | ||
| 3 | 3 | */ | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - emf.trm */ | |
@@ -748,7 +748,7 @@ EMF_options() | |||
| 748 | 748 | ||
| 749 | 749 | emf_colors = emf_monochrome ? 1 : EMF_COLORS; | |
| 750 | 750 | ||
| 751 | - sprintf(term_options, "%s %s %s \"%s\" %g", | ||
| 751 | + sprintf(term_options, "%s %s %s font \"%s,%g\"", | ||
| 752 | 752 | emf_monochrome ? "monochrome" : "color", | |
| 753 | 753 | emf_dashed ? "dashed" : "solid", | |
| 754 | 754 | emf_pentype ? "butt" : "rounded", | |
@@ -1785,8 +1785,7 @@ START_HELP(emf) | |||
| 1785 | 1785 | " {rounded | butt}", | |
| 1786 | 1786 | " {linewidth <LW>} {dashlength <DL>}", | |
| 1787 | 1787 | " {size XX,YY} {background <rgb_color>}", | |
| 1788 | - " {\"<fontname>\"} {<fontsize>} #old syntax", | ||
| 1789 | - " {font \"<fontname>,<fontsize>\"} #new syntax", | ||
| 1788 | + " {font \"<fontname>{,<fontsize>}\"}", | ||
| 1790 | 1789 | " {fontscale <scale>}", | |
| 1791 | 1790 | "", | |
| 1792 | 1791 | " In `monochrome` mode successive line types cycle through dash patterns.", | |
@@ -1809,7 +1808,7 @@ START_HELP(emf) | |||
| 1809 | 1808 | " Selecting `default` sets all options to their default values.", | |
| 1810 | 1809 | "", | |
| 1811 | 1810 | " Examples:", | |
| 1812 | - " set terminal emf 'Times Roman Italic' 12", | ||
| 1811 | + " set terminal emf 'Times Roman Italic, 12'", | ||
| 1813 | 1812 | " set terminal emf color solid # no pesky dashes!" | |
| 1814 | 1813 | END_HELP(emf) | |
| 1815 | 1814 | #endif /* TERM_HELP */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* Hello, Emacs, this is -*-C-*- | |
| 2 | - * $Id: fig.trm,v 1.67 2009/03/26 00:49:20 sfeam Exp $ | ||
| 2 | + * $Id: fig.trm,v 1.68 2011/09/27 23:18:02 sfeam Exp $ | ||
| 3 | 3 | */ | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - fig.trm */ | |
@@ -505,7 +505,7 @@ FIG_options() | |||
| 505 | 505 | ); | |
| 506 | 506 | } | |
| 507 | 507 | ||
| 508 | - sprintf(term_options, "%s %s %s %d %s %s %s%s %s \"%s\" %s %d %s %d %s %d %s %s", | ||
| 508 | + sprintf(term_options, "%s %s %s %d %s %s %s%s %s \"%s,%d\" %s %d %s %d %s %s", | ||
| 509 | 509 | FIG_use_color ? "color" : "monochrome", | |
| 510 | 510 | FIG_is_big ? "big" : "small", | |
| 511 | 511 | "pointsmax", | |
@@ -515,7 +515,7 @@ FIG_options() | |||
| 515 | 515 | FIG_solid ? "solid" : "dashed", | |
| 516 | 516 | text_flags, | |
| 517 | 517 | "font", FIG_fonts[FIG_font_id].key, | |
| 518 | - "fontsize", (FIG_font_s > 0 ? FIG_font_s : | ||
| 518 | + /* fontsize */ (FIG_font_s > 0 ? FIG_font_s : | ||
| 519 | 519 | (FIG_is_big ? BFIG_FONT_S : FIG_FONT_S)), | |
| 520 | 520 | "linewidth", FIG_default_thickness, "depth", FIG_depth, | |
| 521 | 521 | "version", FIG_version ); /* JFS, KB, ULIG */ | |
@@ -1307,7 +1307,7 @@ START_HELP(fig) | |||
| 1307 | 1307 | " {metric | inches}", | |
| 1308 | 1308 | " {pointsmax <max_points>}", | |
| 1309 | 1309 | " {solid | dashed}", | |
| 1310 | - " {font <fontname>} {fontsize <fsize>}", | ||
| 1310 | + " {font \"<fontname>{,<fontsize>}\"}", | ||
| 1311 | 1311 | " {textnormal | {textspecial texthidden textrigid}}", | |
| 1312 | 1312 | " {{thickness|linewidth} <units>}", | |
| 1313 | 1313 | " {depth <layer>}", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* Hello, Emacs, this is -*-C-*- */ | |
| 2 | - /* $Id: tgif.trm,v 1.49 2010/03/24 18:22:37 sfeam Exp $ */ | ||
| 2 | + /* $Id: tgif.trm,v 1.50 2011/09/27 23:18:02 sfeam Exp $ */ | ||
| 3 | 3 | ||
| 4 | 4 | /* GNUPLOT - tgif.trm */ | |
| 5 | 5 | ||
@@ -433,7 +433,7 @@ TGIF_options() | |||
| 433 | 433 | strcat(term_options, TgifUseColor ? " color" : " monochrome"); | |
| 434 | 434 | sprintf(&(term_options[strlen(term_options)]), " linewidth %f", | |
| 435 | 435 | dActThick_default); | |
| 436 | - sprintf(&(term_options[strlen(term_options)]), " %s \"%s\" %u", | ||
| 436 | + sprintf(&(term_options[strlen(term_options)]), " %s font \"%s,%u\"", | ||
| 437 | 437 | TgifSolid ? "solid" : "dashed", | |
| 438 | 438 | sActFont, uActFontSize); | |
| 439 | 439 | } | |
@@ -1733,14 +1733,14 @@ START_HELP(tgif) | |||
| 1733 | 1733 | " {monochrome | color}", | |
| 1734 | 1734 | " {{linewidth | lw} <LW>}", | |
| 1735 | 1735 | " {solid | dashed}", | |
| 1736 | - " {font \"<fontname>\"} {<fontsize>}", | ||
| 1736 | + " {font \"<fontname>{,<fontsize>}\"}", | ||
| 1737 | 1737 | "", | |
| 1738 | 1738 | " where <[x,y]> specifies the number of graphs in the x and y directions on the", | |
| 1739 | 1739 | " page, `color` enables color, `linewidth` scales all linewidths by <LW>,", | |
| 1740 | 1740 | " \"<fontname>\" is the name of a valid PostScript font, and <fontsize>", | |
| 1741 | 1741 | " specifies the size of the PostScript font.", | |
| 1742 | 1742 | " `defaults` sets all options to their defaults: `portrait`, `[1,1]`, `color`,", | |
| 1743 | - " `linwidth 1.0`, `dashed`, `\"Helvetica\"`, and `18`.", | ||
| 1743 | + " `linwidth 1.0`, `dashed`, `\"Helvetica,18\"`.", | ||
| 1744 | 1744 | "", | |
| 1745 | 1745 | " The `solid` option is usually prefered if lines are colored, as they often", | |
| 1746 | 1746 | " are in the editor. Hardcopy will be black-and-white, so `dashed` should be", | |
@@ -1773,7 +1773,7 @@ START_HELP(tgif) | |||
| 1773 | 1773 | "", | |
| 1774 | 1774 | " Examples of single plots (or standard multiplot):", | |
| 1775 | 1775 | " set terminal tgif # defaults", | |
| 1776 | - " set terminal tgif \"Times-Roman\" 24", | ||
| 1776 | + " set terminal tgif \"Times-Roman,24\"", | ||
| 1777 | 1777 | " set terminal tgif landscape", | |
| 1778 | 1778 | " set terminal tgif landscape solid", | |
| 1779 | 1779 | "", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments