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



On 16.02.2006 21:42, Rob McDonald wrote:
I think I've found the problem.  The text size appears to be keyed into
the
zoom level selected on screen.  Zoom to 100%, the exported text looks
right.
Zoom to 200%, the font gets bigger.  Zoom to 400%, everything gets bigger
yet.

Previously, when I deleted 14 of the objects, I must've selected some
intermediate zoom level.

Hope this helps, this one ought to be pretty easy to fix.

If someone wants an easy way to re-create this bug, the following procedure
does it for me...

1) Start Dia.
2) Insert a text label "foo".
3) Set the zoom to 100%.
4) Export a MetaPost file foo1.mp
5) Set the zoom to 200% (or anything else)
6) Export a MetaPost file foo2.mp
7) Compare the two files.  diff foo1.mp foo2.mp

The font scaling parameter will be different, while it shouldn't be.  The
exported output should in no way be tied to the current on-screen view
(scroll bar position, zoom, grid on/off, etc.)

I would appreciate if someone else would confirm this problem, but I'm
pretty sure I've seen it in 0.95-pre1 Windows and 0.94 Linux.

I tried following through the code where the MetaPost export does a lookup
for the font size.  It makes a call to pango and that's where I decided to
defer to the experts.

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;)

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?

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?

Thanks,
        Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



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