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

Text Function Simplification #555

Merged
merged 9 commits into from
Aug 19, 2018
Merged

Text Function Simplification #555

merged 9 commits into from
Aug 19, 2018

Conversation

hipstersmoothie
Copy link
Collaborator

@hipstersmoothie hipstersmoothie commented Aug 18, 2018

What's Changing and Why

Simplify text function to not be recursive and hard to understand.

All it does now is:

  1. Split lines based on maxWidth
  2. Print each line

This changed alignment in some cases because the old implementation was adding a space to the end of every line. The new one does not.

Also:

  • changed the test images to be black text on white backgrounds instead of black on black. Makes testing these functions easier.
  • exposed measureText and measureTextHeight

What else might be affected

Just text printing.

Tasks

  • Add tests
  • Update Documentation
  • Update jimp.d.ts
  • Add SemVer Label

@hipstersmoothie hipstersmoothie added the bug there is a bug in the way jimp behaves label Aug 18, 2018
@hipstersmoothie hipstersmoothie changed the title Text Text Function Simplification Aug 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug there is a bug in the way jimp behaves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants