Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI: Diagram unit dimensions are coupled with character dimensions #215

Closed
rakhimov opened this issue Aug 12, 2017 · 1 comment
Closed

Comments

@rakhimov
Copy link
Owner

This is both blessing and curse.
On the one hand,
this approach decouples the graphics from the screen dpi
and ensures that boxes can fit n-character strings on m-lines.
On the other hand, the diagram look changes as the system font type changes,
which makes the graph look different on each operating system.

The solution can be to use absolute measures (cm)
and lose the charachter fit guarantees.

Another solution is to use the same font accross operating systems.

rakhimov added a commit that referenced this issue Aug 12, 2017
The diagram sizes operate with float values instead of integer.
Using QSizeF, avoids accidental narrowing.

Issue #215
@rakhimov rakhimov modified the milestone: v0.15.0 Aug 12, 2017
rakhimov added a commit that referenced this issue Aug 12, 2017
Instead of using independent width and height,
the width units are fixed to be a half of the height units.
This is the original assumption of the diagram dimensions.
The height unit is still derived from the height metrics of the font
to make the graphics screen DPI independent.
With these changes, the diagram graphics size units
have only single degree of freedom,
which should minimize
the differing looks on different operation systems.

Issue #215
@rakhimov
Copy link
Owner Author

There's no easy way to guarantee an availability of certain fonts on the platform
even though some of them (Helvetica) are ubiquitous.

The current compromise is to fix the diagram unit dimensions (1 : 2) for width and height,
but the absolute values are relative to the font height only (a single degree of freedom).
This will keep the shapes the same across different platforms but at different scale
depending on the font metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant