Menu

#363 inconsistent font attribute handling between terminals

None
closed-accepted
nobody
None
5
2014-03-19
2013-04-23
No

Adding font attributes is inconsistent across terminals (and is not very well documented). Also error messages from the font handling libraries are not passed on the console, which i think would be desireable. (only the non-graphic gnuplot.exe windows version does, in some cases)

I´d advocate feeding the string with the font specification to a terminal-independant function, that then returns the separated informations to the terminal driver.

I guess the standard way should be to separate font, attribute(s) and size by comma, as commas do not (one hopes) appear in font names (as opposed to hyphens and spaces). Everything case-insensitive.

For backward compatibility, the size should be first removed from the back of the font string, then "Bold",bold,"Italic","italic" (from the back, including
"-" and "," before them), and the rest be fed to pango et al. This should take care that no font name gets damaged, and catch all parameters.
Also there would be no need to escape hyphens in font names, then, as was recently proposed on c.g.a.gnuplot.
And fonts can end on a number, so removing the size needs to check if there is a space or comma before it.

Karl

i found out this for current terminals:


X11 must use comma, but accepts lowercase attribute.

wxt(cairo), windows and pdf enforces space, and first letter must be uppercase.

windows expects a font size after a comma, and then switches to font size 1 if no number follows

wxt accepts "Bold-Italic", windows ignores the -Italic.

postscript allows hyphen both between font name and attribute and two attributes, also accepts spaces


gp was 463 official windows build, x11 terminal on gp443/debian_lenny

Discussion

  • Ethan Merritt

    Ethan Merritt - 2014-03-09
    • status: open --> pending-accepted
    • Group: -->
     
  • Ethan Merritt

    Ethan Merritt - 2014-03-09

    I have added a preliminary implementation of boldface and italic markup to the enhanced text mode. It currently works for the cairo terminals, for qt, and partially for the libgd terminals. Implementing for additional terminals unfortunately will require taking them one by one and for some I don't see how it will be possible at all. But for cairo and qt it works nicely.
    Syntax:
    set label 1 '{\it italic text _{\bf bold subscript}}'

    Add to CVS for the development version.

     
  • Ethan Merritt

    Ethan Merritt - 2014-03-13

    The consensus ran against using the TeX-like construct, so 4.7 CVS now contains an implemenation of a different syntax. See bolditalic.dem and enhanced_utf8.dem.

     
  • Ethan Merritt

    Ethan Merritt - 2014-03-19
    • status: pending-accepted --> closed-accepted
     

Log in to post a comment.