-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Improved text shaping #3106
base: master
Are you sure you want to change the base?
Improved text shaping #3106
Conversation
This is BEFORE we discussed it with Florin and found lots of improvements to make
* Create npm script to run demo server * Add config and npm script for doing a lighter dev build
One line text is not perfect Multiline text is now showing (Work in progress)
Also fixed the line height issue.
(actually, in paths)
Currently, the arabic text shows in the wrong order. However, this version turns off arabic ligatures and this is the right approach. We need to add another shaping pass to establish the correct text directions.
(stashed in the 'arabic-wip' branch) This reverts commit bdc8209.
Also update the text sample page to show side-by-side examples.
Needs refactoring right away - the code is not clean
Opens with 0.0.0.0:8000/demo/text/skottie/ First test is a single Skript test for debugging The rest comes from the skottie resources
player/js/utils/text/SkriptShaper.js
Outdated
if (goingLeft) { | ||
return TextDirection.Mixed; | ||
} | ||
console.assert(goingRight); |
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.
can asserts be removed?
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.
I removed the assert but kept the logging since these are significant problems and I don't want them to go unnoticed at least for now when the code is not well tested.
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.
I updated all logging to be disabled (no-op) by default. We can enable for testing using a window flag. @bodymovin PTAL.
player/js/utils/text/SkriptShaper.js
Outdated
span = document.getElementById(this.coloredId); | ||
rect = document.getElementById(this.measurementId); | ||
} else { | ||
this.coloredId = 'undefined'; |
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.
are quotes around undefined intentional?
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 code should go away -- it's just a leftovers of an old way of testing.
@@ -0,0 +1,121 @@ | |||
import { nodeResolve } from '@rollup/plugin-node-resolve'; |
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.
nice!
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.
lgtm!
Introduce a new/optional text shaper implementation, with improved internationalization (RTL, BiDi) support. The new shaping engine can be selected via animation
rendererSettings
: