Qucs / qucs

Qucs Project official mirror
http://qucs.sourceforge.net/
GNU General Public License v2.0
1.15k stars 213 forks source link

Components text size is (often) wrongly computed #91

Closed in3otd closed 9 years ago

in3otd commented 9 years ago

This is related to PR #87 and bug 170 on SF. The components text size (Name, Value, Properties, etc.) is often computed using the size of QucsSettings.font, as in https://github.com/Qucs/qucs/blob/master/qucs/qucs/components/component.cpp#L514 , but this is not necessarily (almost always not, I think) the actual font used by the painter. As an example, the QucsSettings.font on my system is Helvetica 12, but the font actually used for the components text is Nimbus Sans L 16; as far as I understood this is because

Things seems relatively simple up to now, but if an unusual font which has not a close substitution or a weird display resolution is declared the actual absolute font size is not directly proportional to the display DPI. The right solution will be to let the painter compute the actual font size, but to do this in a straightforward manner every component should belong to a schematic when asked to compute its text size, but this is not always the case, e.g. during the modules registration at startup, https://github.com/Qucs/qucs/blob/master/qucs/qucs/main.cpp#L639 . This can be worked around, but I wonder if there is a better way/place to compute the components text size.

in3otd commented 9 years ago

Fixed by PR #98