[changeset] print.m (matlab compatibility)

Ben Abbott bpabbott at mac.com
Mon Mar 9 23:39:24 CDT 2009


On Mar 10, 2009, at 12:02 PM, John W. Eaton wrote:

> On 10-Mar-2009, Ben Abbott wrote:
>
> | Does the attached find a font that works with the png terminal on  
> our
> | system?
>
> No.  But is it something we can fix in Octave?  I think it is just
> that gnuplot on my system doesn't know where to find fonts.  I can
> probably work around it by setting GDFONTPATH, but should every user
> have to do that?  Especially on systems like Debian where there are
> packages.  OTOH, running gnuplot and generating a png file with some
> labels works when I don't explicitly set any font.  So if Octave's
> default font is "*", can we just skip passing a font name to gnuplot?
> Will that work?
>
> jwe


I don't think so.

(1) gnuplot assumes the canvas is 6 inches wide and sets the  
conversion of pixels to/from points on this assumption.

(2) gnuplot positions the tick-labels, axes-labels, and title using  
the default character width for each terminal type (normally 12pt, but  
not always).

I *think* I have all the font scaling/positioning done correctly to  
obtain the desired result for any resolution, but this requires that  
octave is permitted to tell gnuplot what the fontsize is for every  
text object, *and* requires that each text object's position be  
adjusted.

In order to obtain the proper size and position for the tick-labels,  
axes-labels, and title I scale and offset each of these.

Without any TrueType and Type-1 fonts, there are only five fonts  
available from the GD library, and they do not scale. From the  
manual ...

Five basic fonts are supported directly by the gd library. These are  
tiny (5x8 pixels), small (6x12
pixels), medium, (7x13 Bold), large (8x16) or giant (9x15 pixels).  
These fonts cannot be scaled or
rotated (pure horizontal or vertical text only).

Without having a scalable font, I don't know how to reconcile this.

Would it be possible to include a single ttf, or pfa file with Octave?

Ben



More information about the Octave-maintainers mailing list