print/save Liberation font

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

print/save Liberation font

samuel WEBER
Hi all,

I am using the fltk graphic toolkit and octave 4.0.0 on archlinux.
I try to print a figure with an other font than "Helvetica" which is not
available in my system for Inkscape. I successfully set the font to the
figure with :

>> allAxes = findall(0,'type','axes');

>> set(allAxes, 'FontName', 'LiberationSans')

but when I try to print it out, it's still 'Helvetica'. I use

>> print filename.pdf -dpdf

but the result is the same in png or eps.

It appears that the font is not in the GhostScript path, because when i
set the font to Times/Arial or whatever in
http://ghostscript.com/doc/current/Fonts.htm#Fontmap, it works. Isn't it
weird that the Liberation Font are not in the path?
How could I print the figure with Liberation font? Should I go to the
GhostScript config' or is it a way directly in Octave?

Also, how to set the default font to Liberation? I try the following
lines (found in a post in 2009):

set (0, "defaultaxesfontname", "LiberationSans")

set (0, "defaultaxesfontsize", 12)

set (0, "defaulttextfontname", "LiberationSans")

set (0, "defaulttextfontsize", 12)

without success.

Bests,
Samuel



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: print/save Liberation font

samuel WEBER
Sorry for the spam.
The

set (0, "defaultaxesfontname", "LiberationSans")

set (0, "defaultaxesfontsize", 12)

set (0, "defaulttextfontname", "LiberationSans")

set (0, "defaulttextfontsize", 12)

work perfectly. Sorry.

On 04/02/2016 10:31, samuel WEBER wrote:

> Hi all,
>
> I am using the fltk graphic toolkit and octave 4.0.0 on archlinux.
> I try to print a figure with an other font than "Helvetica" which is not
> available in my system for Inkscape. I successfully set the font to the
> figure with :
>
>>> allAxes = findall(0,'type','axes');
>>> set(allAxes, 'FontName', 'LiberationSans')
> but when I try to print it out, it's still 'Helvetica'. I use
>
>>> print filename.pdf -dpdf
> but the result is the same in png or eps.
>
> It appears that the font is not in the GhostScript path, because when i
> set the font to Times/Arial or whatever in
> http://ghostscript.com/doc/current/Fonts.htm#Fontmap, it works. Isn't it
> weird that the Liberation Font are not in the path?
> How could I print the figure with Liberation font? Should I go to the
> GhostScript config' or is it a way directly in Octave?
>
> Also, how to set the default font to Liberation? I try the following
> lines (found in a post in 2009):
>
> set (0, "defaultaxesfontname", "LiberationSans")
>
> set (0, "defaultaxesfontsize", 12)
>
> set (0, "defaulttextfontname", "LiberationSans")
>
> set (0, "defaulttextfontsize", 12)
>
> without success.
>
> Bests,
> Samuel
>
>


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: print/save Liberation font

Pantxo
samuel WEBER wrote
Sorry for the spam.
The

set (0, "defaultaxesfontname", "LiberationSans")

set (0, "defaultaxesfontsize", 12)

set (0, "defaulttextfontname", "LiberationSans")

set (0, "defaulttextfontsize", 12)

work perfectly. Sorry.

On 04/02/2016 10:31, samuel WEBER wrote:
> Hi all,
>
> I am using the fltk graphic toolkit and octave 4.0.0 on archlinux.
> I try to print a figure with an other font than "Helvetica" which is not
> available in my system for Inkscape. I successfully set the font to the
> figure with :
>
>>> allAxes = findall(0,'type','axes');
>>> set(allAxes, 'FontName', 'LiberationSans')
> but when I try to print it out, it's still 'Helvetica'. I use
>
>>> print filename.pdf -dpdf
> but the result is the same in png or eps.
>
> It appears that the font is not in the GhostScript path, because when i
> set the font to Times/Arial or whatever in
> http://ghostscript.com/doc/current/Fonts.htm#Fontmap, it works. Isn't it
> weird that the Liberation Font are not in the path?
> How could I print the figure with Liberation font? Should I go to the
> GhostScript config' or is it a way directly in Octave?
>
> Also, how to set the default font to Liberation? I try the following
> lines (found in a post in 2009):
>
> set (0, "defaultaxesfontname", "LiberationSans")
>
> set (0, "defaultaxesfontsize", 12)
>
> set (0, "defaulttextfontname", "LiberationSans")
>
> set (0, "defaulttextfontsize", 12)
>
> without success.
>
> Bests,
> Samuel
>
>

Hi,

Unfortunately, gl2ps, the library we use to print opengl based figures (from fltk ot qt toolkits), doesn't allow us to use any other font than Helvetica, Courier, Times, Symbol an Zapfdingbats. The reason is that those fonts don't have to be embeded for pdf documents to be portable: they are defined as base pdf fonts, thus necessarily available (or a replacement) in any viewers/printers.

That is why Octave will fallback to Helvetica for printing when any other font is chosen.

We could argue that we already use ghostscript (which is able to embed any font from your system) to convert figures and it would thus be possible to embed fonts in documents.

So in short : the workaround is to print to eps, replace Helvetica by any font you like and then use ghosscript to embed the font (and eventually convert to another format). Keep in mind though that if the font you choose is too different from Helvetica, the extent of the text will be wrong, i.e. legend boxes won't fit anymore with the text.


Pantxo

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave