Thread Subject: Print Euro symbol

Subject: Print Euro symbol

From: Thomas

Date: 17 Aug, 2007 20:10:17

Message: 1 of 6

Hello,

does anybody know how to include an Euro symbol ('€') in a
figure and print it on a postscript printer?

Best regards
Thomas

Subject: Print Euro symbol

From: us

Date: 17 Aug, 2007 20:44:07

Message: 2 of 6

Thomas:
<SNIP a european...

one of the solutions

     eu=sprintf('%c',8364);
     line(0:1,0:1);
     title(eu,...
          'fontsize',32,...
          'fontname','arial');
     text(.1,.5,eu,...
          'fontsize',64,...
          'fontname','courier new');

us
     

Subject: Print Euro symbol

From: Thomas

Date: 17 Aug, 2007 21:51:12

Message: 3 of 6

Thank you for your prompt answer.
Your solution works when I print the figure directly in
verbose mode. Though, it fails when I try to print it
(figure handle fh) to a file using

    print(fh,'-dpsc2','test.ps');

After distilling it to PDF the Euro symbol is gone. Any
idea how could this be solved?


"us " <us@neurol.unizh.ch> wrote in message <fa51an$6
$1@fred.mathworks.com>...
> Thomas:
> <SNIP a european...
>
> one of the solutions
>
> eu=sprintf('%c',8364);
> line(0:1,0:1);
> title(eu,...
> 'fontsize',32,...
> 'fontname','arial');
> text(.1,.5,eu,...
> 'fontsize',64,...
> 'fontname','courier new');
>
> us
>

Subject: Print Euro symbol

From: Thomas

Date: 18 Aug, 2007 20:56:23

Message: 4 of 6

Finally, I found a solution by switching to symbol font.

To get a PDF with a figure containing the string "Less than
10€ per piece." the following code could be used:

% --------------------------
fh = figure;
text(fh,0.5,0.5,strcat('Less than 10\fontname{Symbol}',char
(160),'\fontname{Helvetica}per piece.');
print(fh,'-dpsc2','test.ps');
% --------------------------

Finally, the postscript file "test.ps" needs to be
distilled to PDF.

The '€' symbol will not be displayed in the MATLAB figure
but it will show up in the PDF.

(The archaic printer driver functions of MATLAB are
hopelessly outdated. The use of Unicode encoding and system
available fonts in graphics is standard elsewhere.)

Subject: Print Euro symbol

From: Franck Bourry

Date: 13 Oct, 2009 21:18:19

Message: 5 of 6

Hello,
I am using Matlab running on a Linux OS and the tips you gave don't seem to work :-(
I want to get the euro symbol on a figure (ylabel and xlabel) and I want to save this figure as a pdf file.
Which command should I use ?

Thank you


"Thomas " <thomas.liebscher@uni-potsdam.de> wrote in message <fa7mdn$m75$1@fred.mathworks.com>...
> Finally, I found a solution by switching to symbol font.
>
> To get a PDF with a figure containing the string "Less than
> 10€ per piece." the following code could be used:
>
> % --------------------------
> fh = figure;
> text(fh,0.5,0.5,strcat('Less than 10\fontname{Symbol}',char
> (160),'\fontname{Helvetica}per piece.');
> print(fh,'-dpsc2','test.ps');
> % --------------------------
>
> Finally, the postscript file "test.ps" needs to be
> distilled to PDF.
>
> The '€' symbol will not be displayed in the MATLAB figure
> but it will show up in the PDF.
>
> (The archaic printer driver functions of MATLAB are
> hopelessly outdated. The use of Unicode encoding and system
> available fonts in graphics is standard elsewhere.)
>

Subject: Print Euro symbol

From: Thomas

Date: 13 Nov, 2009 12:33:03

Message: 6 of 6

Hi Franck,

for my system (MS Windows XP) and my pdf-font the ASCII code for the "Euro"-symbol is 160. For you it might be a different one.

In order to find out about it you might try the following code at first:

% --------------------------
fh = figure;
for i=1:4
for j=1:32
t = 128 + (i-1)*32+j;
text((i-1)*0.25,1-(j-1)/32,['char(' num2str(t) ') = ' char(t)],'FontName','Symbol','FontSize',10);
end
end
print(fh,'-dpsc2','charset.ps');
% --------------------------

I suggest you identify the ASCII-code for the "Euro"-symbol in the figure both on the screen and in the resulting file "charset.ps" (after you distilled it to "charset.pdf"). Just replace the number 160 in the code I posted earlier with the one you found and it should work.


"Franck Bourry" <franck.bourry@mines-paristech.fr> wrote in message <hb2qqq$k74$1@fred.mathworks.com>...
> Hello,
> I am using Matlab running on a Linux OS and the tips you gave don't seem to work :-(
> I want to get the euro symbol on a figure (ylabel and xlabel) and I want to save this figure as a pdf file.
> Which command should I use ?
>
> Thank you

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
euro symbol Franck Bourry 13 Oct, 2009 17:19:22
pdf Thomas 17 Aug, 2007 17:55:09
euro character us 17 Aug, 2007 16:45:43
graphics us 17 Aug, 2007 16:45:10
character us 17 Aug, 2007 16:45:10
ascii us 17 Aug, 2007 16:45:10
code us 17 Aug, 2007 16:45:10
rssFeed for this Thread

Contact us at files@mathworks.com