Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #419

Re: {/Symbol w} chooses letter omega fom DejaVu font, not Symbol

From James Cloos <cloos@jhcloos.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: {/Symbol w} chooses letter omega fom DejaVu font, not Symbol
References <8639izzgx6.fsf@aiuole.stru.polimi.it> <iu2css$g23$2@dont-email.me> <86boxmhyi0.fsf@aiuole.stru.polimi.it>
Date 2011-07-02 14:39 -0400
Message-ID <m3fwmottlt.fsf@jhcloos.com> (permalink)

Show all headers | View raw


If you look at gnuplot/src/wxterminal/gp_cairo.c (which is called not
only by the wxt terminal but also by the pdfcairo and pngcairo terminals),
you find this:

,----
| #ifdef MAP_SYMBOL
|         /* we have to treat Symbol font as a special case */
|         if (!strcmp(plot->fontname,"Symbol")) {
|                 FPRINTF((stderr,"Parsing a Symbol string\n"));
|                 string_utf8 = gp_cairo_convert_symbol_to_unicode(plot, string);
|                 strncpy(plot->fontname, gp_cairo_default_font(), sizeof(plot->fontname));
|                 symbol_font_parsed = TRUE;
|         } else
| #endif /*MAP_SYMBOL*/
`----

where gp_cairo_default_font() is:

,----
| const char *
| gp_cairo_default_font(void)
| {
| #ifdef WIN32
|         return "Tahoma";
| #else
|         return "Sans";
| #endif
| }
`----

On most fontconfig installs Sans maps to DejaVu Sans.

Without changing the gnuplot src, the only way to get pdfcairo to use
something other than Sans (or Tahoma on doze) for Symbol is to do the
Symbol→utf8 conversion yourself.  Eg:

,----
| set term pdfcairo enhanced font "DejaVu Serif,18"
| set out 'test.pdf'
| set xlabel "ωt"
| plot sin(x) t "sin(ωt)"
| set out
`----

Note the use of U+03C9 GREEK SMALL LETTER OMEGA instead of {/Symbol w}.

You still have to choose a font which contains glyphs for all of the
characters you want to use, and you will need to have your $LANG set
to a UTF-8 locale, such as LANG=en_US.UTF-8 (adjusted as appropriate
for your language and country).

The funtion gp_cairo_convert_symbol_to_unicode() in that src file
shows the conversion the cairo-based terms use for /Symbol.

Or, if you compile gnuplot yourself, you can edit gp_cairo_default_font().
PanGo, though, probably will still fall back to Sans for any characters
not supported by your chosen font.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

{/Symbol w} chooses letter omega fom DejaVu font, not Symbol Giacomo Boffi <giacomo.boffi@polimi.it> - 2011-06-24 12:01 +0200
  Re: {/Symbol w} chooses letter omega from DejaVu font, not Symbol James Waldby <not@valid.invalid> - 2011-06-24 15:19 +0000
  Re: {/Symbol w} chooses letter omega fom DejaVu font, not Symbol James Waldby <not@valid.invalid> - 2011-06-24 16:10 +0000
    Re: {/Symbol w} chooses letter omega fom DejaVu font, not Symbol Giacomo Boffi <giacomo.boffi@polimi.it> - 2011-06-25 14:44 +0200
      Re: {/Symbol w} chooses letter omega fom DejaVu font, not Symbol James Cloos <cloos@jhcloos.com> - 2011-07-02 14:39 -0400
        Re: {/Symbol w} chooses letter omega fom DejaVu font, not Symbol Giacomo Boffi <giacomo.boffi@polimi.it> - 2011-07-25 22:44 +0200

csiph-web