Re: Metapost bug with font size... (Was: PyDia and Metapost)



Just looked into it and it appears to be a really simple solution.
Currently set_font() is ignoring the passed in parameter 'height'
which has the size independent of the scale.
Instead their is a call to dia_font_height() which apparently returns
a scaled font size. The latter may be a bug in itself but the whole
font handling is a little messy at the moment;)

That sounds about right.  I wasn't sure whether dia_font_height() should be
returning a screen scaled font size or not.  I also found it curious that a
font height was passed in and then ignored....

Anyway, as noted before, I'd like to be able to reproduce the complete
issue, so could you please file a bug in http://bugzilla.gnome.org
and attach the information requested?

I'll see what I can do.  I'm new to Dia and wasn't sure whether the bugzilla
was actively used.  So many projects just ignore any sort of bug tracking...

Also note: the size currently used at zoom 100% is different from the
size passed in (0.56 vs 0.80). Would that scale explain the size
mismatch you have mentioned earlier?

That looks like it.

I did some more tests, and the MetaPost side of things is pretty simple.
The font has a 'preferred' size, and the MetaPost scale factor is just a
linear scaling of that size.  So, if you've selected cmr10, it is 10pt.

So, that 0.80 that you referenced above, is that the font size in
centimeters?  If so, it needs to be converted to represent a scale factor
based on the font base size (which may not always be obvious, I'm not sure).
And you can use a value of 72 points per inch when you figure the scaling.
Apparently TeX uses 72.72 while PostScript uses 72.0.  I'm not sure which
the cmr10 font uses, but the 1% difference is going to be tiny.

If you're looking for a test case, 0.35 cm is pretty close to 10pt.  So, if
you select cmr10, the output scale factor should be really close to 1.0.
(I've worked around the issue for now by doing a search & replace for
whatever scale factor Dia comes up with for 1.0, and my figure looks good.)

Thanks again,

            Rob




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]