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

Additional metadata, Text Slot Rotation and Support for OTF fonts #58

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bladerail
Copy link

@bladerail bladerail commented Mar 30, 2022

Summary

  • Added metadata support for text slots:
    • horizontal_align: 0 for left, 1 for center, 2 for right. If not defined, defaults to center.
    • vertical_align: 0 for top, 1 for middle, 2 for bottom. If not defined, defaults to center.
    • outline_color: Similar to text_color, an array of RGB values capped at 255.
    • outline_width: Int specifying the thickness of the outline. If not defined, defaults to 8
    • rotation: A rotation angle in degrees. Rotates the text slot clockwise by that angle (about it's center).
  • Revamped drawing functions with that of fogleman/gg to support text rotation.
    The gg image library also provides support for text wrapping and computing the size of the rectangle given the font face, allowing the removal of previous code which tried to compute the text for each line in the event that a text would need to stretch over to multiple lines.
  • Added support for OpenType fonts. Provided Zag-Bold and Zag-Regular.otf for verification.
  • Added a debug boolean to draw the text boxes and print out the slot coordinates. if this boolean is set to True, useful for creating new templates.

I added the change-my-mind meme template to demo the text slot rotation. Set it to use the Zag OTF font for demonstration.
Updated this-is-fine because the black text over the fire was difficult to see.

Ticket Link

Addresses [#57] Additional metadata options, text rotation, support for Opentype fonts

Additional Remarks

First time working in GoLang. I was encountering some issues on the Master branch with regards to linting or make check-style. Example fieldalignment: struct with 136 pointer bytes could be 72 (govet). I needed to rearrange the fields to fix the field alignment errors brought up by Govet. I also noted that golint had been deprecated and replaced with revive. Do let me know if neither of these are desired.

Edit: Found out why golint is still used over revive. Do let me know if the field rearrangment is an issue.

@bladerail bladerail requested a review from hanzei as a code owner March 30, 2022 17:38
@bladerail bladerail changed the title Additional metadata and Support for OTF fonts Additional metadata, Text Slot Rotation and Support for OTF fonts Mar 30, 2022
@bladerail bladerail force-pushed the additional-metadata-and-otf-fonts branch 3 times, most recently from 5b35cc9 to a8986a3 Compare March 30, 2022 18:07
@bladerail bladerail force-pushed the additional-metadata-and-otf-fonts branch from a8986a3 to 8ebaaa1 Compare March 30, 2022 18:11
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2022

Codecov Report

Merging #58 (8ebaaa1) into master (53c2abe) will decrease coverage by 0.32%.
The diff coverage is 67.64%.

@@            Coverage Diff             @@
##           master      #58      +/-   ##
==========================================
- Coverage   80.02%   79.70%   -0.33%     
==========================================
  Files           3        3              
  Lines        1537     1606      +69     
==========================================
+ Hits         1230     1280      +50     
- Misses        184      192       +8     
- Partials      123      134      +11     
Impacted Files Coverage Δ
server/memelibrary/assets.go 79.91% <ø> (+0.11%) ⬆️
server/memelibrary/metadata.go 74.39% <66.66%> (-9.22%) ⬇️
server/memelibrary/memelibrary.go 82.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53c2abe...8ebaaa1. Read the comment docs.

@hanzei hanzei requested review from catalintomai and removed request for hanzei March 30, 2022 19:36
@catalintomai catalintomai self-assigned this Apr 4, 2022
@hanzei hanzei added the Triage label May 10, 2022
@catalintomai catalintomai added this to the v1.5.0 milestone May 16, 2022
@mickmister mickmister self-requested a review August 22, 2022 15:20
@catalintomai catalintomai removed this from the v1.5.0 milestone Sep 12, 2022
@DHaussermann DHaussermann added this to the v1.6.0 milestone Sep 13, 2022
@hanzei hanzei added the 3: QA Review Requires review by a QA tester label Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: QA Review Requires review by a QA tester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants