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


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

Formatting Unicode symbol in a label

Started by"Dan'l B" <dan.hinckley@gmail.com>
First post2014-01-04 04:32 -0800
Last post2014-01-07 08:28 -0800
Articles 12 — 4 participants

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


Contents

  Formatting Unicode symbol in a label "Dan'l B" <dan.hinckley@gmail.com> - 2014-01-04 04:32 -0800
    Re: Formatting Unicode symbol in a label Karl <mail.kfr@gmx.net> - 2014-01-04 18:16 +0100
    Re: Formatting Unicode symbol in a label Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2014-01-04 19:09 +0100
    Re: Formatting Unicode symbol in a label "Dan'l B" <dan.hinckley@gmail.com> - 2014-01-04 23:56 -0800
      Re: Formatting Unicode symbol in a label Karl <mail.kfr@gmx.net> - 2014-01-05 18:44 +0100
    Re: Formatting Unicode symbol in a label "Dan'l B" <dan.hinckley@gmail.com> - 2014-01-05 00:05 -0800
      Re: Formatting Unicode symbol in a label Karl <mail.kfr@gmx.net> - 2014-01-05 18:28 +0100
    Re: Formatting Unicode symbol in a label "Dan'l B" <dan.hinckley@gmail.com> - 2014-01-05 18:08 -0800
    Re: Formatting Unicode symbol in a label "Dan'l B" <dan.hinckley@gmail.com> - 2014-01-07 08:22 -0800
      Re: Formatting Unicode symbol in a label Ethan A Merritt <merritt@u.washington.edu> - 2014-01-07 13:18 -0800
        Re: Formatting Unicode symbol in a label "Dan'l B" <dan.hinckley@gmail.com> - 2014-01-07 23:59 -0800
    Re: Formatting Unicode symbol in a label "Dan'l B" <dan.hinckley@gmail.com> - 2014-01-07 08:28 -0800

#2215 — Formatting Unicode symbol in a label

From"Dan'l B" <dan.hinckley@gmail.com>
Date2014-01-04 04:32 -0800
SubjectFormatting Unicode symbol in a label
Message-ID<f42d0c0d-5118-47af-96b5-2289abd59dcb@googlegroups.com>
Given a line such as

"" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\

How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.

Arial Unicode MS includes that unicode character. Times New Roman PSMT also supports it; both are available on my system.

OSX 10.6.8
GN   4.6 patchlevel 4
pdfcairo installed
using PDF terminal

[toc] | [next] | [standalone]


#2216

FromKarl <mail.kfr@gmx.net>
Date2014-01-04 18:16 +0100
Message-ID<la9fki$8q5$1@news.rz.uni-karlsruhe.de>
In reply to#2215
Am 04.01.2014 13:32, schrieb Dan'l B:
> Given a line such as
> 
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\
> 
> How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.
> 
(the abscissa part of your using statement seems to be missing the
dollar signs)

One simple way would be to

  set encoding utf8

and then directly put the symbol there.



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


#2219

FromHans-Bernhard Bröker <HBBroeker@t-online.de>
Date2014-01-04 19:09 +0100
Message-ID<bir123F586rU1@mid.dfncis.de>
In reply to#2215
On 04.01.2014 13:32, Dan'l B wrote:
> Given a line such as
>
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\

I'm less than convinced that you can have a ternary operator's two 
results be one string and one number.

> How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.

So how exactly does it fail, then?

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


#2221

From"Dan'l B" <dan.hinckley@gmail.com>
Date2014-01-04 23:56 -0800
Message-ID<ba537ae5-e913-4984-88f7-85aacee0cc71@googlegroups.com>
In reply to#2215
On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
> Given a line such as
> 
> 
> 
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\
> 
> 
> 
> How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.
> 
> 
> 
> Arial Unicode MS includes that unicode character. Times New Roman PSMT also supports it; both are available on my system.
> 
> 
> 
> OSX 10.6.8
> 
> GN   4.6 patchlevel 4
> 
> pdfcairo installed
> 
> using PDF terminal

Failure: it simple prints the literal codepoint: U+1F311

This, for example, works, but only with Aqua and SVG terminals; it fails in PDF (prints the literal "G"):

"" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("G"):1/0) w labels left font "Moon Phases,28" offset -4,0,\

(Moon Phases is an old symbol font; it fails in PDF using any of its variants: TTF, PS, OTF.)

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


#2224

FromKarl <mail.kfr@gmx.net>
Date2014-01-05 18:44 +0100
Message-ID<lac5kt$bbc$1@news.rz.uni-karlsruhe.de>
In reply to#2221
Am 05.01.2014 08:56, schrieb Dan'l B:
> 
> Failure: it simple prints the literal codepoint: U+1F311
> 

Well, of course. That´s what your string contains.

You can enter (octal) ascii codepoints as, e.g. "\131", but i´m not sure
this is possible for unicode, see "help enhanced tex mode":

"You can access special symbols numerically by specifying
\character-code (in octal), e.g., {/Symbol \245} is the symbol for
infinity. This does not work for multibyte encodings like UTF-8,
however. In a UTF-8 environment, you should be able to enter multibyte
sequences implicitly by typing or otherwise selecting the character you
want. "


K

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


#2222

From"Dan'l B" <dan.hinckley@gmail.com>
Date2014-01-05 00:05 -0800
Message-ID<0e74b780-befc-4055-9ad2-56261446d80b@googlegroups.com>
In reply to#2215
On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
> Given a line such as
> 
> 
> 
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\
> 
> 
> 
> How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.
> 
> 
> 
> Arial Unicode MS includes that unicode character. Times New Roman PSMT also supports it; both are available on my system.
> 
> 
> 
> OSX 10.6.8
> 
> GN   4.6 patchlevel 4
> 
> pdfcairo installed
> 
> using PDF terminal

Aha, Karl's suggestion did the trick: set encoding utf8

It does not, however, enable that Moon Phases font to work on the PDFcairo terminal.

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


#2223

FromKarl <mail.kfr@gmx.net>
Date2014-01-05 18:28 +0100
Message-ID<lac4nk$aui$1@news.rz.uni-karlsruhe.de>
In reply to#2222
Am 05.01.2014 09:05, schrieb Dan'l B:
> On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
>>
>> pdfcairo installed
>>
>> using PDF terminal
> 
> Aha, Karl's suggestion did the trick: set encoding utf8
> 
> It does not, however, enable that Moon Phases font to work on the PDFcairo terminal.
> 

pdf and pdfcairo have different ways of handling the font names etc. I´d
say you just gave the wrong name. :-/

Have you tried using the font in a simpler way, e.g. in an axis label or
plot title, to make sure it´s not a problem in "with label"?

  K

P.S. Who on earth gave you a data file that contains utf8 moon symbols? ;-)

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


#2225

From"Dan'l B" <dan.hinckley@gmail.com>
Date2014-01-05 18:08 -0800
Message-ID<4fd64237-cc96-4816-845d-0a262c127bcb@googlegroups.com>
In reply to#2215
On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
> Given a line such as
> 
> 
> 
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\
> 
> 
> 
> How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.
> 
> 
> 
> Arial Unicode MS includes that unicode character. Times New Roman PSMT also supports it; both are available on my system.
> 
> 
> 
> OSX 10.6.8
> 
> GN   4.6 patchlevel 4
> 
> pdfcairo installed
> 
> using PDF terminal

I'll go back to the "help enhanced tex mode", thanks.

I've tried every trick in the book that I could find (man pages, searching, etc): putting the font name in the working directory, fontpath, removing spaces in the name, etc. That said, I am a complete noob on these font issues so it's a steep curve.

Last discovery is that SVG terminal outputs the Moon Phases symbols OK but when I used an online SVG -> PDF converter, the symbols didn't survive. Opening the SVG in Photoshop Elements and printing to PDF locally fails as well. The Aqua terminal handles it nicely and I can then print to PDF but it adds a lot of steps to the workflow when I have many pages.

It's a font one finds searching for Moon Phases font, and I think it dates back a way; a fella over in the Apple discussions ran it through his professional font mgmt tool and cleaned it up and produced various PS, OTF, TTF versions for me; nada...

Research ongoing. :-))

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


#2228

From"Dan'l B" <dan.hinckley@gmail.com>
Date2014-01-07 08:22 -0800
Message-ID<96b72de8-5f0c-4670-9608-50af2131a220@googlegroups.com>
In reply to#2215
On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
> Given a line such as
> 
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\
> 
> How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.
> 
> Arial Unicode MS includes that unicode character. Times New Roman PSMT also supports it; both are available on my system.
> 
> OSX 10.6.8
> GN   4.6 patchlevel 4
> pdfcairo installed
> using PDF terminal

Turns out that the Symbola font includes all the unicode glyphs for moon phases.

Can anyone illuminate me about why the following problem might occur? In these labels, the last two work, the first two do not when outputting to PDFcairo terminal. They all appear in the OSX Font Book, and when inserted as symbols into the BBedit command file, the symbols appear correctly; the BBedit file is saved as UTF8; UTF8 is set in the terminal. The SVG terminal displays all the characters properly; the Aqua terminal displays only the First and Last Quarters properly; EPS and PDF terminals do not display any of the four:

"" u (myDateSP(1,2)):3:((strcol(4) eq "New") ?  ("🌑"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Full") ?  ("🌕"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("☽"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Last") ?  ("☾"):1/0) w labels left font "Symbola,28" offset -4,0,\

Neither of these terminal setups seems to help:

set terminal pdfcairo enhanced size 13.5,9.8
set term pdfcairo enhanced  font "Symbola" size 13.5,9.8

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


#2230

FromEthan A Merritt <merritt@u.washington.edu>
Date2014-01-07 13:18 -0800
Message-ID<lahquf$thd$1@dont-email.me>
In reply to#2228
Dan'l B wrote:

> On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
>> Given a line such as
>> 
>> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w
>> labels left font "Arial Unicode MS,18" offset -4,0,\
>> 
>> How do I insert the Unicode codepoint for a quarter moon symbol (for
>> example)? The above formatting doesn't work.
>> 
>> Arial Unicode MS includes that unicode character. Times New Roman PSMT
>> also supports it; both are available on my system.
>> 
>> OSX 10.6.8
>> GN   4.6 patchlevel 4
>> pdfcairo installed
>> using PDF terminal
> 
> Turns out that the Symbola font includes all the unicode glyphs for moon
> phases.
> 
> Can anyone illuminate me about why the following problem might occur? In
> these labels, the last two work, the first two do not when outputting to
> PDFcairo terminal. They all appear in the OSX Font Book, and when inserted
> as symbols into the BBedit command file, the symbols appear correctly; the
> BBedit file is saved as UTF8; UTF8 is set in the terminal. The SVG
> terminal displays all the characters properly; the Aqua terminal displays
> only the First and Last Quarters properly; EPS and PDF terminals do not
> display any of the four:
> 
> "" u (myDateSP(1,2)):3:((strcol(4) eq "New") ?  ("🌑"):1/0) w labels left
> font "Symbola,28" offset -4,0,\
> "" u (myDateSP(1,2)):3:((strcol(4) eq "Full") ?  ("🌕"):1/0) w labels left
> font "Symbola,28" offset -4,0,\
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("☽"):1/0) w labels left
> font "Symbola,28" offset -4,0,\
> "" u (myDateSP(1,2)):3:((strcol(4) eq "Last") ?  ("☾"):1/0) w labels left
> font "Symbola,28" offset -4,0,\


The UTF sequences in your 3rd and 4th commands are indeed
 ☽ Unicode 263D UTF8 0xE2 0x98 0xBD first quarter moon
 ☾ Unicode 263E UTF8 0xE2 0x98 0xBE last quarter moon
and they display correctly here on my screen as I read your post.

The sequences in your 1st and 2nd commands are not displayed
correctly here but a hex dump shows that they are
Unicode 01F311 UTF8 0xF0 0x9F 0x8C 0x91
Unicode 01F315 UTF8 0xF0 0x9F 0x8C 0x95
These lie on a higher page of the Unicode tables and were added to
the standard in Unicode 6.0 (released Oct 2010).  So I can easily
believe that many environments do not yet support them,
including my desktop display.

Maybe you can use instead
 ⬤ Unicode 2B24 UTF8  0xE2 0xAC 0xA4 Large Black Circle
 ◯ Unicode 25EF UTF8 0xE2 0x97 0xAF Large Circle

> 
> Neither of these terminal setups seems to help:
> 
> set terminal pdfcairo enhanced size 13.5,9.8
> set term pdfcairo enhanced  font "Symbola" size 13.5,9.8

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


#2232

From"Dan'l B" <dan.hinckley@gmail.com>
Date2014-01-07 23:59 -0800
Message-ID<67efecfe-d24a-4967-82e2-0a465665ecf3@googlegroups.com>
In reply to#2230
On Tuesday, January 7, 2014 10:18:04 PM UTC+1, Ethan A Merritt wrote:
> Dan'l B wrote:
> 
> 
> 
> > On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
> 
> >> Given a line such as
> 
> >> 
> 
> >> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w
> 
> >> labels left font "Arial Unicode MS,18" offset -4,0,\
> 
> >> 
> 
> >> How do I insert the Unicode codepoint for a quarter moon symbol (for
> 
> >> example)? The above formatting doesn't work.
> 
> >> 
> 
> >> Arial Unicode MS includes that unicode character. Times New Roman PSMT
> 
> >> also supports it; both are available on my system.
> 
> >> 
> 
> >> OSX 10.6.8
> 
> >> GN   4.6 patchlevel 4
> 
> >> pdfcairo installed
> 
> >> using PDF terminal
> 
> > 
> 
> > Turns out that the Symbola font includes all the unicode glyphs for moon
> 
> > phases.
> 
> > 
> 
> > Can anyone illuminate me about why the following problem might occur? In
> 
> > these labels, the last two work, the first two do not when outputting to
> 
> > PDFcairo terminal. They all appear in the OSX Font Book, and when inserted
> 
> > as symbols into the BBedit command file, the symbols appear correctly; the
> 
> > BBedit file is saved as UTF8; UTF8 is set in the terminal. The SVG
> 
> > terminal displays all the characters properly; the Aqua terminal displays
> 
> > only the First and Last Quarters properly; EPS and PDF terminals do not
> 
> > display any of the four:
> 
> > 
> 
> > "" u (myDateSP(1,2)):3:((strcol(4) eq "New") ?  ("🌑"):1/0) w labels left
> 
> > font "Symbola,28" offset -4,0,\
> 
> > "" u (myDateSP(1,2)):3:((strcol(4) eq "Full") ?  ("🌕"):1/0) w labels left
> 
> > font "Symbola,28" offset -4,0,\
> 
> > "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("☽"):1/0) w labels left
> 
> > font "Symbola,28" offset -4,0,\
> 
> > "" u (myDateSP(1,2)):3:((strcol(4) eq "Last") ?  ("☾"):1/0) w labels left
> 
> > font "Symbola,28" offset -4,0,\
> 
> 
> 
> 
> 
> The UTF sequences in your 3rd and 4th commands are indeed
> 
>  ☽ Unicode 263D UTF8 0xE2 0x98 0xBD first quarter moon
> 
>  ☾ Unicode 263E UTF8 0xE2 0x98 0xBE last quarter moon
> 
> and they display correctly here on my screen as I read your post.
> 
> 
> 
> The sequences in your 1st and 2nd commands are not displayed
> 
> correctly here but a hex dump shows that they are
> 
> Unicode 01F311 UTF8 0xF0 0x9F 0x8C 0x91
> 
> Unicode 01F315 UTF8 0xF0 0x9F 0x8C 0x95
> 
> These lie on a higher page of the Unicode tables and were added to
> 
> the standard in Unicode 6.0 (released Oct 2010).  So I can easily
> 
> believe that many environments do not yet support them,
> 
> including my desktop display.
> 
> 
> 
> Maybe you can use instead
> 
>  ⬤ Unicode 2B24 UTF8  0xE2 0xAC 0xA4 Large Black Circle
> 
>  ◯ Unicode 25EF UTF8 0xE2 0x97 0xAF Large Circle
> 

Ethan,

That worked just right in the PDFcairo output. I did have to use the small black circle as the large one doesn't render but that is fine.

Many thanks! I find this font business a black art and appreciate you shining some light on the problem.
Big relief after many hours of frustration!

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


#2229

From"Dan'l B" <dan.hinckley@gmail.com>
Date2014-01-07 08:28 -0800
Message-ID<5f527c28-954d-4ba1-9476-c09fddb44cd0@googlegroups.com>
In reply to#2215
On Saturday, January 4, 2014 1:32:56 PM UTC+1, Dan'l B wrote:
> Given a line such as
> 
> 
> 
> "" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("U+1F311"):1/0) w labels left font "Arial Unicode MS,18" offset -4,0,\
> 
> 
> 
> How do I insert the Unicode codepoint for a quarter moon symbol (for example)? The above formatting doesn't work.
> 
> 
> 
> Arial Unicode MS includes that unicode character. Times New Roman PSMT also supports it; both are available on my system.
> 
> 
> 
> OSX 10.6.8 
> GN   4.6 patchlevel 4
> pdfcairo installed
> using PDF terminal

The Symbola font includes all unicode glyphs for moon phases.

In these 4 labels, the last two work. All glyphs appear in OSX Font Book; when inserted as symbols into the BBedit command file, the symbols appear correctly; the BBedit file is saved as UTF8; UTF8 is set in the terminal. The SVG terminal displays all the characters properly; the Aqua and PDF terminals display only the First and Last Quarters properly.

"" u (myDateSP(1,2)):3:((strcol(4) eq "New") ?  ("🌑"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Full") ?  ("🌕"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "First") ?  ("☽"):1/0) w labels left font "Symbola,28" offset -4,0,\
"" u (myDateSP(1,2)):3:((strcol(4) eq "Last") ?  ("☾"):1/0) w labels left font "Symbola,28" offset -4,0,\

Neither of these terminal setups seems to help:

set terminal pdfcairo enhanced size 13.5,9.8
set term pdfcairo enhanced  font "Symbola" size 13.5,9.8

[toc] | [prev] | [standalone]


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


csiph-web