-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
textToPoints not working with letter "B" from Google Font #5462
Comments
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, be sure to follow the issue template if you haven't already. |
The should be resolved with #5466 Explanation: the issue here is the final line of the isSpace() function which checks that the glyph's index is not the literal number 3. I'm not sure why this was originally included in the code (there is no comment), but I have run all the tests without it and see no adverse affects. It is likely however that there was a valid reason for including it originally, so we should keep an eye out for problems its removal may cause. I've also fixed some tests which were broken when fonts were moved around. function isSpace(i) {
return (
(glyphs[i].name && glyphs[i].name === 'space') ||
(txt.length === glyphs.length && txt[i] === ' ') ||
(glyphs[i].index && glyphs[i].index === 3) // PR removes this line
);
} |
yes, I also looked up that commit -- but no idea where that index check came from |
|
So this is fine with single or multiple spaces, including tabs, and can be merged as is |
Fixed by #5466 |
Most appropriate sub-area of p5.js?
Details about the bug:
I loaded the Google Font "Dancing Script" and used
textToPoints
on it. It works well for all letters, but with letter "B" no points are returned. When simply using "text" with the same font, the letter "B" prints as expected. So i suppose it is not a problem with the font.Please refer to https://editor.p5js.org/pifragile/sketches/l0JS6TCks. It is all setup there. You can take a look at the console output and you can see that for letter "B" an empty array of points is returned.
The text was updated successfully, but these errors were encountered: