Commit Graph

80 Commits

Author SHA1 Message Date
Jaye Evins d1ee78e58a Fix incorrect font sizes (#321)
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.
2026-03-27 15:47:46 -04:00
Jaye Evins e6673a0a24 Add generic templates (#307)
- Add generic full-page templates.  (This feature from 3.4 was missing)
- Also add generic half-page, quarter-page, and envelope templates.
- Add several more common envelope sizes to page-sizes.xml
- Qt print backend does not need pwg_size.
    - Replace with pwg_class, to distinguish between ISO and NA sizes
2026-02-11 11:27:41 -05:00
Jaye Evins 993e1e460d Tweaks to glabels-3 text object compatability. (#306)
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.
2026-02-05 18:45:18 -05:00
Jaye Evins 4b16b0900b Update copyright notices for 2026. (#280) 2026-01-13 19:19:42 -05:00
Jaye Evins 1c902230fe Big-Ugly Style Update (#278)
* 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.
2026-01-07 19:43:34 -05:00
Jaye Evins 3cd173a37f Replaced all Qt foreach loops with modern C++ range-based loops. (#277) 2026-01-05 15:24:00 -05:00
Jaye Evins 742b80fc47 Use canonical file paths for filenames in model (#275) 2026-01-02 13:34:44 -05:00
Jaye Evins ce8bbad26c Bypass Qt font metric calculations (#272)
- This originally showed up as fonts rendering differently on X11 than Wayland. (#230)
- Setting font size in points should be device and back end independent, however the same exact font face and size, on
  the same machine, sometimes results in different font metrics between the xcb and wayland Qt back ends.
- Setting font size in pixels, assuming a virtual DPI of 96 pixels/inch, results in consistent font metrics and rendering
  between these back ends. Furthermore, this virtual DPI works for either on-screen or hi-res printer QPainter contexts.
- This virtual DPI seems to work correctly with some limited testing with Windows and MacOS.
- Add rendering tests to build-tests CI script.
2025-12-30 00:33:17 -05:00
Jaye Evins 90e236f847 Remove files from Settings::recentFileList(), if they fail to open. (#268)
- i.e. they no longer exist or have been moved
- update recent file menu in StartupView as Settings change
2025-12-17 21:26:30 -05:00
p0358 aba0f11616 Preparation for flatpack support (#255)
- Updates to project and desktop metadata in preparation for flatpak packaging
- These updates are independent of flatpack
- This commit unmingles the actual flatpack packaging from #255
2025-12-17 16:07:57 -05:00
Merikei 7f1fa64114 Fix typo that prevents user roll templates from having a customisable length (#263) 2025-12-10 13:38:44 -05:00
Jaye Evins b6cac2d208 Fix several compile issues (#261)
Fixed several code issues.  Mostly pedantic compiler warnings.  But also a sign issue exposed by newer compilers (#228, #260)
2025-12-06 15:58:38 -05:00
Jaye Evins 44a10fc796 Make detailed version information available to command line (#257)
- Moved detailed version information from ReportBugDialog to Version::details()
- Added QPA Platform information to verbose version information
- Added Qt version to detailed version information
- Added `-V` command line option to glabels-qt and glabels-batch-qt
2025-12-03 20:43:37 -05:00
Jaye Evins 9d516b7e1f Minor string cleanup (#248)
- Simplified some strings to not include unnecessary markup.
- Fix translator comments so that they actually make it to glabels_C.ts file
      - Reconciled the style of these comments.
      - Added translator comments
2025-11-10 17:46:07 -05:00
Jaye Evins 8c8e447336 Pointer cleanup (#242)
- 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
2025-10-31 16:11:28 -04:00
Jaye Evins 0e7049ed73 Support libzint >= 2.15 (#225,#222,#186))
- Update libzint support for 2.15 as new baseline version, removing support for earlier versions, avoiding '#ifdef'-hell
- Based on #186

---------

Co-authored-by: gitlost <burmartke@gmail.com>
2025-08-16 17:00:14 -04:00
Jaye Evins fa96cc5a17 Add grid settings to preferences (#224)
- Allow origin to be either at the top-left corner or center of label (#174)
- For non-rectangular labels (cd, round, etc.) the origin will still
  always be at the center of the label.
- User controllable grid spacing
2025-08-14 15:47:22 -04:00
Jaye Evins f147407a46 Drag n drop (#223)
Added drop interface for image files, images, and text, dragged from other applications.  (#153,#223)

- Lock aspect ration on new image objects by default
- Communicate context menu click location to paste actions
2025-08-12 16:06:43 -04:00
Jaye Evins 9c3e21faf3 Add ObjectsCenter action to center objects in label both h and v. (#184) 2025-07-31 18:01:22 -04:00
Jaye Evins 475971b701 Remember most recently used printer. (#215) 2025-07-28 15:11:36 -04:00
Jaye Evins 4c0ce1146a Improvements to SelectTemplateDialog (#109 and #142)
- Added side pane for product preview and information
- Product selection is done with a separate pushbutton, so that user gets a
  chance to preview the complete product information before committing to the
  selection
- Supports two view modes: Grid View and List View
- View mode is automatically stored in Settings, so it will default to the
  user's prefered mode
- Should address most concerns in #109 and #142
2025-05-26 19:23:36 -04:00
Jaye Evins ca68c84cad Handle filenames with periods in basename consistently. (#199)
Use QFileInfo::completeBaseName() instead of QFileInfo::baseName() in
Model::shortName().  This was already the case when building list of
recent labels in MainWindow.
2025-05-15 00:02:47 -04:00
Jaye Evins 18b0a1b09b Minor bug fixes
- model::Db::lookupPaperNameFromId() bad if-else-if
- model::StrUtil::formatFraction missing arg in QString
- Added unit tests for StrUtil
2025-05-08 11:09:11 -04:00
Jaye Evins f15c21a01d Update to Qt6
- New baseline minimum platform is Ubuntu 22.04
    - Qt6 requires at least 6.2
        - some deprecations may be flagged on later versions (e.g. 6.8)
    - CMake requires at least 3.22
- Include build-tests.yml github action to validate builds on mulitple platforms
- QtTest is no longer optional since it easily comes along for the ride with Qt
- Replaced QStringRef in model::SubstitutionField with simple ParserState class
- Removed deprecations up to Qt 6.2
2025-05-06 18:26:53 -04:00
Jim Lieb be567f90eb Update Qt dependency from QT 5.6 to QT 5.15 (#162)
* 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>
2025-04-28 22:16:28 -04:00
Jaye Evins f8efe3aafa Update all occurrences of my name with my legal name. 2025-04-08 18:47:02 -04:00
Jim Evins 2d5650767a Reconciled parsing of field names with Substitution Field Spec. (#82)
According to the spec., valid syntax for merge field names is determined
by the merge source with a couple of minor exceptions.  Current text backends
allow any printable characters, so the SubstitutionField parser now accepts
any printable characters.
2020-01-01 17:04:19 -05:00
Jim Evins aebcda43cb Merge branch 'RefactorPrint'
- Modifies printing model to be similar to glabels-3.x.
   - Allow simple projects to print by-the-page (#51)
   - Added collated vs uncollated document merges
- Added ability to separate merge groups by page
- Updated man pages
- Updated misc developer documentation
2020-01-01 14:35:15 -05:00
Jim Evins 75e613e9f1 Trim leading and trailing spaces from image filenames from merge records. (#76) 2019-11-11 23:21:34 -05:00
Jim Evins 7a02c0b226 Allow user variables to be set from glabels-batch command line (#75) 2019-10-12 21:57:04 -04:00
gitlost 6bc0cb8443 Remove XmlLabel png render tests, too system dependent 2019-08-29 08:10:27 +01:00
gitlost 7e44bbdc06 New FileUtil::makeRelativeIfInDir func; label parser_3 barcode map; unit tests 2019-08-26 03:00:32 +01:00
gitlost e8daa8aa48 Fix readImageFile to set mSvg, use in drawShadow also 2019-08-23 09:27:14 +01:00
gitlost 98038e34e7 Make absolute image filename more Windows friendly 2019-08-23 00:56:31 +01:00
gitlost 010879fa71 Add root to images search path, readImageFile svg; unit tests 2019-08-21 15:04:52 +01:00
gitlost 2444cacb74 UserVariables branch merge 2019-08-21 03:37:56 +01:00
Jim Evins 6a789c9632 Save/restore file paths as relative to project file. 2019-08-18 21:56:37 -04:00
Jim Evins 3fedb16c2c Look for image files from substitution fields relative to project file. 2019-08-04 23:32:50 -04:00
Jim Evins f41461ef26 Added color variable type. 2019-08-03 17:16:14 -04:00
Jim Evins 6fda0246a8 Implement fields in ModelImageObject. 2019-07-30 21:26:16 -04:00
Jim Evins 57cbf18039 Added variables expansion to TextNode and ColorNode. 2019-07-27 22:00:05 -04:00
Jim Evins cd0af020c6 Added default cases to switch statements. 2019-07-21 19:26:03 -04:00
Jim Evins 5b9eba9af9 Tweaked look of image object placeholders. 2019-07-21 13:17:45 -04:00
gitlost 6ab3a12b92 Share Model merge; Merge initializers; undo/redo descs (#65)
- use "shared" pointer between Model and undo/redo instances
- adds missing initializers to Merge and Text classes
- adds checkpoints for mouse resize, barcode, and image reset.
- renames the position dialog checkpoint from Move -> Position to differentiate it from a mouse move.
- adds the Undo/Redo action descriptions to the menu items.
- adds unit tests for the Merge and Model change, and for ColorNode, RawText and TextNode.
2019-07-20 14:41:01 -04:00
gitlost 850c62ddd0 Make lockAspectRatio (sizeAspectCheck) per-object (#63)
* Make lockAspectRatio (sizeAspectCheck) per-object
* Added unit tests for XmlLabelCreator and XmlLabelParser.
2019-07-13 22:18:30 -04:00
Jim Evins 3256c407fb Make version numbers of snapshots more meaningful. 2019-05-05 14:45:44 -04:00
Jim Evins 54a66dfd8f Increment per item, not per merge record. 2019-03-24 22:33:40 -04:00
Jim Evins efbb052856 Implemented variables in merge print jobs. 2019-03-24 20:22:12 -04:00
Jim Evins 37f0a8890d Implemented variable substitution in simple print jobs. 2019-03-24 17:49:41 -04:00
Jim Evins 3a425f932a Include variables in glabels project file. 2019-03-17 22:38:45 -04:00