Recently, when chasing the font size differences between the wayland and xcb Qt backends, I ended up normalizing on the wayland sizing when bypassing the backend's font metrics calculation (#272). Unfortunately, the wayland backend was not rendering the font sizes correctly, and it was a mistake to duplicate its behavior.
* Assume a virtual DPI of 72 pixels/in instead of 96 when compulting font size
- Based on testing, this produces the correct font size
- Updated reference labels.
* No longer need to scale fonts when importing glabels-3 files.
- The glabels-3 font sizes were correct afterall! (#306)
- No longer need to compensate for scale factor in unit tests when importing glabels-3 files.
This commit partially addresses issues in #296. Due to the fact that glabels-3
and glabels-4 use different underlying technologies for rendering text, a
pixel-perfect import can probably never be fully achieved.
This commit focuses on small adjustments to imported text objects to approximate
the visual appearance of these objects.
- glabels-3 rendered text at 75% of stated font size, compensate by adjusting
font size of imported object.
- Text boxes behave differently in glabels-4 than in glabels-3. In glabels-4,
text boxes must be of a fixed size, so compensate when a variable sized
box (when w=0 and/or h=0) is detected and fix the size to the natural text
size.
- In glabels-3, the fixed margin size (3pt) was not used in the text baseline
calculations. Compensate by adjusting vertical position of imported text
object.
* Bulk replaced tabs with spaces
* Bulk removed trailing whitespace from lines
* Replaced c-style comments with c++-style comments in file banners
* Replace nested namespace definitions with single concise definitions (C++17), this keeps the indentation more manageable
* Cleanup ordering and spacing of include directives
* Bulk renaming of header file extensions from '.h' to '.hpp'.
* Update CODING-STYLE.md
* Update target_compile_features from cxx_std_11 to cxx_std_20.
* Refresh .clang-format file. Still needs a lot of tweaking.
- Made greater use of smart pointers, eliminating many instances of manual memory management
- Do not use pointers at all for many non-polymorphic classes
- Assorted other code cleanup
* Update QT5 references 5.6 -> 5.15
Builds and runs but now needs deprecated -> current updates.
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
* Update build instructions for Fedora 35 particulars
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
* Replace deprecated QtString::sprintf with QtString::arg
This was deprecated some revisions prior to 5.15.
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
* Replace deprecated QtString::SkipEmptyParts with Qt::SkipEmptyParts
Builds now with 5.15
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
* Replace deprecated QPrinter::setPageMargins with 5.15 version
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
* Replace deprecated QImage::byteCount() with QImage::sizeInBytes()
This could be problematic if qsizetype differs from int
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
* Replace deprecated endl with QT::endl
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
* Replace deprecated QMatrix with QTransform
Signed-off-by: Jim Lieb <lieb@sea-troll.net>
---------
Signed-off-by: Jim Lieb <lieb@sea-troll.net>