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
Char spacing #4642
Char spacing #4642
Conversation
…of space between each character.
src/extras/BitmapText.js
Outdated
|
||
set letterSpacing(value) // eslint-disable-line require-jsdoc | ||
{ | ||
if (this._maxWidth !== value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be this._letterSpacing
src/extras/BitmapText.js
Outdated
/** | ||
* Letter spacing. This is useful for setting the space between characters. | ||
* @member {number} | ||
* @public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't public. The getter is what's public
Please consider to add some unit tests for this feature. |
Can anyone help me find out why the TravisCI is failing? |
There's something wrong with Travis |
Added basic tests for BitmapText.
@themoonrat the problem with the center and right aligning was because the BitmapText supported only space as line breaking character and the line flipped-turned was too big. All lines are currently aligned to the biggest line, not the maxWidth property. |
@themoonrat could you review this again? |
@bigtimebuddy will do. Code lgtm ... just wanna have a little play to try and see if I can break things :) |
Sure, no problem. Fiddles welcomed |
So, the letter spacing itself I'm happy with. For example Second: And this bug isn't unique to your code, but also existed in the existing code.... it doesn't take into account line breaks added into strings already.
Notice how it repeats the 'ei' on line 4... the first 2 letters of eight. It doesn't distinguish between line breaks already within the text, and line breaks created internally due to word wrap. I don't know whether it's worth fixing in this PR, or put this PR through as it matches old behaviour and ask for a new PR later on to fix this? Thoughts again @bigtimebuddy ? |
|
Reverted breaking on -/\.,?!;:
…into char_spacing
@ceco-fmedia and @themoonrat where are we with this PR? Would like to get into 4.8 if we can. Please let me know. Also @ceco-fmedia could you resolve conflicts? |
Issues have been addressed above
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Added additional property letterSpacing in BitmapText to set extra space between each character.
Set textWidth/lineWidth to include the additional space at the end of the last character as it includes the space before the first one.