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

Proposing another label template #14645

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft

Conversation

mattv8
Copy link

@mattv8 mattv8 commented Apr 24, 2024

Description

Proposing an additional label template and layout to provide users with more options. This label template dynamically adjusts field sizes for optimal display, particularly suited for "landscape" aspect ratios. This is a derivative of the DefaultLabel template, and should allow for some dynamic resizing of the page and label dimensions.

Please note there is also a minor change to the public final function writeText(). I've added a new input at the end called $whiteBg=false that allows text boxes to render with a white background. I'm including this change in this PR because of the dependency.

Type of change

  • [x ] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I have tested a variety of different scenarios in my test environment. I've tested with and without logo, title, barcode, etc. I've tested different numbers of fields, different logo sizes, and so forth.

Test Configuration:

  • PHP version: PHP 8.1.2-1ubuntu2.14
  • MySQL version: mariadb from 11.3.2-MariaDB, client 15.2 for debian-linux-gnu (x86_64)
  • Webserver version: Apache/2.4.52 (Ubuntu)
  • OS version: Ubuntu 22.04.4 LTS

Checklist:

Proposing an alternative label template and layout to provide users with more options. This label template dynamically adjusts field sizes for optimal display, particularly suited for "landscape" aspect ratios.
Copy link

welcome bot commented Apr 24, 2024

💖 Thanks for this pull request! 💖

We use semantic commit messages to streamline the release process and easily generate changelogs between versions. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix if it doesn't have one already.

Examples of commit messages with semantic prefixes:

  • Fixed #<issue number>: don't overwrite prevent_default if default wasn't prevented
  • Added #<issue number>: add checkout functionality to assets
  • Improved Asset Checkout: use new notification method for checkout

Things that will help get your PR across the finish line:

  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

Copy link

what-the-diff bot commented Apr 24, 2024

PR Summary

  • Introduction of a New DefaultLabelAlternate Class
    A new file named app/Models/Labels/DefaultLabelAlternate.php is added in this PR. It introduces a class called DefaultLabelAlternate that expands the functionalities of the existing RectangleSheet. This new class provides additional constants, properties, and easy-to-use getter methods. Moreover, it contains methods like preparePDF() and write(), which are implemented to pave the way for better ease of usage and potential innovation.

  • Augmentation of writeText() Method in Label.php
    In the app/Models/Labels/Label.php file, the method writeText() is enhanced. An extra parameter called $whiteBg is incorporated. A new feature of drawing a white background for the text can be activated by setting this parameter as true. This seems to be a neat way to enhance the aesthetic aspect while retaining clarity, without compromising on the functionality of the code.

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

Successfully merging this pull request may close these issues.

None yet

1 participant