Menu

#2121 issue of font name with hyphen in enhanced text on some terminals

None
closed-not-a-bug
nobody
None
2019-05-21
2019-01-28
No
set title '{/Times-New-Roman aaa}' font ',24'
plot x 

"Times New Roman" is default selif font on windows . On enhanced text mode does not allow font name with space. In fontconfig releted terminals (gd(png, ...), cairo (wxt, pngciaro, ....)), and postscirpt one can use font name with hyphen like the above example.
However, this font specication is ignored on x11, windows, qt, emf and svg terminals.
(I have not tested on other terminals.)

I think that font specification like /Times-New-Roman on enhanced text should be available on all terminals.

Discussion

<< < 1 2 (Page 2 of 2)
  • Ethan Merritt

    Ethan Merritt - 2019-02-06

    Can you give an example that shows why the font needs to be specified inside the label text rather than outside? For me it works fine to place the font selection outside in most cases:

    set title "これは Times New Roman" font  "Times New Roman"
    set key title "函数 sin(x)" font "Arial:Italic"
    set key box opaque
    plot sin(x)
    

    It is true that there are places this does not work. For example you cannot say
    plot sin(x) title "函数 sin(x)" font "Arial:Italic"
    We could add that. Would it help?

     
  • Tatsuro MATSUOKA

    There are a lot of Japanese fonts selection. The above exmaple, we cannot select arbitrary pair of Japanese and Laten fonts.

    At this moment, I am too busy to make some examples so that please wait a while.

    Anyway thanks your comments.

     
  • Tatsuro MATSUOKA

    I have made an example

    reset
    set encoding utf8
    set xrange[-1:1]
    set yrange[-1:1]
    set term wxt
    set label "これは Times New Roman" font  "Times New Roman" at -0.8, 0.8
    set label "{/MS-Minchoこれは} Times New Roman" font  "Times New Roman" at -0.8, 0
    set label "{/MS-PMinchoこれは} Times New Roman" font  "Times New Roman" at -0.8, -0.1
    plot x
    
     
    • Ethan Merritt

      Ethan Merritt - 2019-02-09

      Yes. So that works correctly, right?
      I get the same here without the large "0" symbols at the top.

       
      • Tatsuro MATSUOKA

        Sorry I only show an example. As I said at first, font name with hyphen works on cairo based terminals. On windows terminals MS Mincho and MS PMIncho are ingnored as an attached file.

         

        Last edit: Tatsuro MATSUOKA 2019-02-09
  • Tatsuro MATSUOKA

    I tried the below again with "PANGOCAIRO_BACKEND=fc"

    set label 1 "{/Times This label uses font Times}" at 0,0
    set label 2 "{/TimesNewRoman This label uses font TimesNewRoman}" at 0, -.1
    set label 3 "{/Times-New-Roman This label uses font Times-New-Roman}" at 0, -.2
    plot [-1:1][-1:1] -1
    

    "PANGOCAIRO_BACKEND=win32"
    wxt:
    Times does not work - uses default font
    TimesNewRoman does not work - uses default font
    Times-New-Roman works and fins MS Times New Roman

    "PANGOCAIRO_BACKEND=fc"
    Times works and finds MS Times New Roman
    TimesNewRoman works and finds MS Times New Roman
    Times-New-Roman works and finds MS Times New Roman

     
  • Tatsuro MATSUOKA

    Honestly speaking, I myself usually use cairo based terminals so that the issue is not serious personally. However, I think that teriminal dependent behaivors are preferrablelly removed.

     
  • Tatsuro MATSUOKA

    I also think that enhanced text should keep to support local font specificcation like "{/fontname}" as for use Japanese-English combined text.

     
  • Ethan Merritt

    Ethan Merritt - 2019-02-10

    I have modified the enhanced text code for both 5.2 and 5.3 so that you can provide a font name in quotes. This allows you to pass "Times New Roman" and a quoted string.

    set label 1 "{/'MS Mincho' これは} {/'Times New Roman'=12 Times New Roman}"
    

    This does not change the font requirements of any terminal. If the terminal did not recognize Times New Roman before this change, it will still not recognize it after the change. However if the terminal does recognize the font name you can now use it in enhanced text markup.

     
  • Tatsuro MATSUOKA

    I have confirmed the font name in qutoes works fine on windows terminal using the shapshot you modified. Thanks!

     
  • Ethan Merritt

    Ethan Merritt - 2019-05-21
    • status: open-not-a-bug --> closed-not-a-bug
     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

MongoDB Logo MongoDB