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

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.localnet!news.posted.localnet.POSTED!not-for-mail
NNTP-Posting-Date Sat, 02 Jul 2011 13:40:31 -0500
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>
User-Agent Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)
Face iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX///8ZGXBQKKnCrDQ3 AAAAJElEQVQImWNgQAAXzwQg4SKASgAlXIEEiwsSIYBEcLaAtMEAADJnB+kKcKioAAAAAElFTkSu QmCC
Copyright Copyright 2011 James Cloos
OpenPGP ED7DAEA6; url=http://jhcloos.com/public_key/0xED7DAEA6.asc
OpenPGP-Fingerprint E9E9 F828 61A4 6EA9 0F2B 63E7 997A 9F17 ED7D AEA6
Date Sat, 02 Jul 2011 14:39:02 -0400
Message-ID <m3fwmottlt.fsf@jhcloos.com> (permalink)
Cancel-Lock sha1:wLZcgEx7bDEQEFYfNpJdeZngLls=
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Lines 61
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 69.48.12.10
X-Trace sv3-hgWn5mf1BSJRwIhdzR+ILXbj3MKlRLjMXWR3+CrQJSUf7zNnpaJsB0NyAxcc/PgF99ODqJRHcdUeYuT!Vf+Gc3vVQVrRuWZvmoQHnJVbN3MPNFEVIU88wA5cIpV5BIS9EeDbeL5fww==
X-Complaints-To abuse@localnet.com
X-DMCA-Complaints-To abuse@localnet.com
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 3519
Xref x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:419

Show key headers only | 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