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

Improved text shaping #3106

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open

Improved text shaping #3106

wants to merge 52 commits into from

Conversation

b-wils
Copy link
Collaborator

@b-wils b-wils commented Aug 6, 2024

Introduce a new/optional text shaper implementation, with improved internationalization (RTL, BiDi) support. The new shaping engine can be selected via animation rendererSettings:

      rendererSettings: {
        useSkriptShaping: true,
      },

Rusino and others added 20 commits June 12, 2024 19:59
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
Leading/trailing spaces are still a problem.
Tests airbnb#45 & airbnb#50.
4 tests fail on caught exception outside of the shaper: airbnb#13, airbnb#22. airbnb#36, airbnb#44.
if (goingLeft) {
return TextDirection.Mixed;
}
console.assert(goingRight);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can asserts be removed?

Copy link

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.

Copy link
Collaborator

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.

span = document.getElementById(this.coloredId);
rect = document.getElementById(this.measurementId);
} else {
this.coloredId = 'undefined';
Copy link
Collaborator

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?

Copy link

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';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Collaborator

@bodymovin bodymovin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants