Re: Font scaling on RH 7.2



Quoting Thomas Evans (tevans losalamos com):
I have had problems exporting dia UML figures on RH7.2.  I believe it 
has to do with the font substitution during export.  For example, I 
can go into the .eps output and change the scale (scf) factor on the 
fonts and things fit inside of class boxes fine.  

I'm not sure why things are working this way as X11 font stuff has 
always confused me somewhat. 

Does anybody know about this issue or have any suggestions?

I'm not doing a lot of exporting, but I can reliably break the font
scaling in UML classes by using the name "Terrain Feature" as the
class name.

The problem appears to be in the font_string_width function (in
font.c), which comments itself to be an admitted hack.

The attached patch resolves this for my system, and a friend who's
running Mandrake 8.1. The old calculation was taking total height of
the string and width from origin to next suggested origin, performing
some mathematical transforms on them to try to guess at "wide enough
or wider".

My patch uses the ascent of the font in place of total height (because
that appears consistent with the way the fonts render, and other
available metrics do not), and the total width of the font, from the
leftmost rendered pixel to the rightmost.

In using these numbers, the kruft placed around the other calculation
to try to fuzzy up the guess wasn't really required.

Please let me know if this doesn't work for you.

Thanks,
--G

-- 
Geoff Gerrietts <ggerrietts yahoo com>
-rw-rw-rw-:  permissions of the beast

Attachment: font.c.patch
Description: Text document



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