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


Groups > comp.graphics.apps.gnuplot > #398 > unrolled thread

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

Started byGiacomo Boffi <giacomo.boffi@polimi.it>
First post2011-06-24 12:01 +0200
Last post2011-07-25 22:44 +0200
Articles 6 — 3 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  {/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

#398 — {/Symbol w} chooses letter omega fom DejaVu font, not Symbol

FromGiacomo Boffi <giacomo.boffi@polimi.it>
Date2011-06-24 12:01 +0200
Subject{/Symbol w} chooses letter omega fom DejaVu font, not Symbol
Message-ID<8639izzgx6.fsf@aiuole.stru.polimi.it>
this happens when i use the pdfcairo terminal, that uses the pango
library to render text

# cat test.gp
set term pdfcairo enhanced font "Utopia"
set out 'test.pdf'
set xlabel "{/Symbol w}t"
plot sin(x) t "sin({/Symbol w}t)"
set out
# fc-match symbol ; fc-match utopia
Symbol.pfb: "Symbol" "Regular"
putr8a.pfb: "Utopia" "Regular"
# pdffonts test.pdf 
name                         type              emb sub uni object ID
---------------------------- ----------------- --- --- --- ---------
TPHAFU+Utopia                Type 1            yes yes yes      5  0
KKVWMP+DejaVuSans            CID TrueType      yes yes yes      6  0
# 

is this a problem with gnuplot or a problem with pango? please help as
the symbol font that is used in my plots doesn't match very well with
the text font
-- 
termy prende per fatica, attento.                     -- PLS, in IFQ

[toc] | [next] | [standalone]


#399 — Re: {/Symbol w} chooses letter omega from DejaVu font, not Symbol

FromJames Waldby <not@valid.invalid>
Date2011-06-24 15:19 +0000
SubjectRe: {/Symbol w} chooses letter omega from DejaVu font, not Symbol
Message-ID<iu29te$g23$1@dont-email.me>
In reply to#398
On Fri, 24 Jun 2011 12:01:57 +0200, Giacomo Boffi wrote:
[re letter omega being taken from DejaVu font, not Utopia]

> this happens when i use the pdfcairo terminal, that uses the pango
> library to render text
> 
> # cat test.gp
> set term pdfcairo enhanced font "Utopia" set out 'test.pdf'
> set xlabel "{/Symbol w}t"
> plot sin(x) t "sin({/Symbol w}t)"
> set out
> # fc-match symbol ; fc-match utopia
> Symbol.pfb: "Symbol" "Regular"
> putr8a.pfb: "Utopia" "Regular"
> # pdffonts test.pdf
> name                         type              emb sub uni object ID
> ---------------------------- ----------------- --- --- --- ---------
> TPHAFU+Utopia                Type 1            yes yes yes      5  0
> KKVWMP+DejaVuSans            CID TrueType      yes yes yes      6  0 #
> 
> is this a problem with gnuplot or a problem with pango?

Apparently neither.  From following link it appears that Utopia doesn't 
include Greek letters.  
<http://code.google.com/p/evristika/issues/detail?id=5>

> please help as the symbol font that is used in my plots doesn't 
> match very well with the text font

True.  I see that output from 
    set term pdfcairo enhanced font "DejaVu"
is self-consistent, but perhaps you don't like that font.

-- 
jiw

[toc] | [prev] | [next] | [standalone]


#400

FromJames Waldby <not@valid.invalid>
Date2011-06-24 16:10 +0000
Message-ID<iu2css$g23$2@dont-email.me>
In reply to#398
On Fri, 24 Jun 2011 12:01:57 +0200, Giacomo Boffi wrote:
[re letter omega being taken from DejaVu font, not Symbol]

> this happens when i use the pdfcairo terminal, that uses the pango
> library to render text
> 
> # cat test.gp
> set term pdfcairo enhanced font "Utopia" set out 'test.pdf'
> set xlabel "{/Symbol w}t"
> plot sin(x) t "sin({/Symbol w}t)"
> set out
> # fc-match symbol ; fc-match utopia
> Symbol.pfb: "Symbol" "Regular"
> putr8a.pfb: "Utopia" "Regular"
> # pdffonts test.pdf
> name                         type              emb sub uni object ID
> ---------------------------- ----------------- --- --- --- ---------
> TPHAFU+Utopia                Type 1            yes yes yes      5  0
> KKVWMP+DejaVuSans            CID TrueType      yes yes yes      6  0 #
> 
> is this a problem with gnuplot or a problem with pango? please help as
> the symbol font that is used in my plots doesn't match very well with
> the text font

Please ignore my earlier reply; because the omega should have been 
drawn from the Symbol font, it apparently shouldn't matter that
Utopia doesn't have Greek letters.  (It might be better to be able to
specify within gnuplot the name of a symbols font, rather than that 
name being externally specified -- eg, gnuplot's help pdfcairo seems 
to say to use 'usual fonts subsystems' for Symbol font control.)

Anyhow, as a work-around for the specific omega problem, if you
scale the omega to be a little smaller it may look good enough.
For example:
    set xlabel "{/Symbol=5 w}t"
    plot sin(x) t "sin({/Symbol=5 w}t)"

-- 
jiw

[toc] | [prev] | [next] | [standalone]


#401

FromGiacomo Boffi <giacomo.boffi@polimi.it>
Date2011-06-25 14:44 +0200
Message-ID<86boxmhyi0.fsf@aiuole.stru.polimi.it>
In reply to#400
James Waldby <not@valid.invalid> writes:

>> # fc-match symbol ; fc-match utopia
>> Symbol.pfb: "Symbol" "Regular"
>> putr8a.pfb: "Utopia" "Regular"

> It might be better to be able to specify within gnuplot the name of
> a symbols font, rather than that name being externally specified --
> eg, gnuplot's help pdfcairo seems to say to use 'usual fonts
> subsystems' for Symbol font control.

for libcairo/libpango the usual fonts subsystem is, on linux,
fontconfig and fontconfig (see above the quoted text from my OP) knows
that symbol is a reference to (the URW clone of) the Adobe font

is it possible that my problem is a utf8 vs ascii problem? gnuplot
pdfcairo's help say something about utf8 but, i must confess, a
chicken has a better understanding of utf8 than mine

thank you for the (omitted) workaround

[toc] | [prev] | [next] | [standalone]


#419

FromJames Cloos <cloos@jhcloos.com>
Date2011-07-02 14:39 -0400
Message-ID<m3fwmottlt.fsf@jhcloos.com>
In reply to#401
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

[toc] | [prev] | [next] | [standalone]


#485

FromGiacomo Boffi <giacomo.boffi@polimi.it>
Date2011-07-25 22:44 +0200
Message-ID<86vcuqum31.fsf@aiuole.stru.polimi.it>
In reply to#419
James Cloos <cloos@jhcloos.com> writes:

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

thank you very much James, yours is the explanation i was looking for;
i'll probably use epslatex + epspdf in the future

again, thank you very much

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web