-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
textAlign wrong for Arabic #6392
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
Comments
@munusshih the loadFont() method of p5.js typography section does the same thing as mentioned as one solution in the stackoverflow link (Workaround 1) that you have shared! But the problem here is that, the font is applied only as |
I believe if the user is using a font from p5.js/src/core/p5.Renderer2D.js Lines 1267 to 1269 in 558505e
|
@priyankuhazarika @davepagurek That is why in workaround 1, it utilized CSS @font-face. It would not activate opentype.js to function as intended, thus earning it the label of a workaround. Like I said, apparently this is because opentype.js doesn't support rendering of arabic correctly, which is a known and open issue here: opentypejs/opentype.js#364 |
Hmm might be the case, but i also found this piece of code @munusshih @davepagurek Also opentypejs/opentype.js#364 might be the case, needs further experiments on this! |
@munusshih pointed out in another issue somewhere that we add that line but then never actually make use of it anywhere else. Relying on it more could be one direction we go in, as it would have better RTL support than opentype! We have some active discussion about that going on here if you're interested: #6391 |
Ohhh i see, thanks for the reference @davepagurek |
would be great to have a range of test cases for this in v2.0 |
Most appropriate sub-area of p5.js?
p5.js version
1.7.0
Web browser and version
chrome://version
Operating System
MacOSX
Steps to reproduce this
Steps:
preload()
I personally don't read or write arabic. I just noticed this stackoverflow discussion.
This is heavily related to how opentype.js didn't know how to handle arabic. The only current solution would be, instead of using
preload()
, use CSS @font-face to render it so that it is drawing through the native HTML Canvas.The text was updated successfully, but these errors were encountered: