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
Helvetica is not available, so the closest equivalent is automatically chosen by Qt
The font size requested was 12 points (that is, 12/72 of an inch) but my display is set at 96 DPI, so to keep the same absolute font size, a size of 12*(96/72) is automatically chosen by Qt
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.
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, theQucsSettings.font
on my system isHelvetica 12
, but the font actually used for the components text isNimbus Sans L 16
; as far as I understood this is becauseThings 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.