-
-
Notifications
You must be signed in to change notification settings - Fork 813
Separate the Text node's generated glyphs into separate vector table rows #2821
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
Conversation
ea8eb10
to
6ffc93f
Compare
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.
Works nicely; thanks for the contribution.
node-graph/gstd/src/text.rs
Outdated
for glyph in glyph_vectors { | ||
let instance = graphene_core::instances::Instance { | ||
instance: glyph, | ||
transform: DAffine2::IDENTITY, |
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.
To position the glyph within the text, do we want to apply a transform here instead of to all of the points?
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.
do we want to apply a transform here instead of to all of the points?
I'm sorry, but I couldn't understand what you mean by this
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.
The text is shaped by positioning all of the glyphs. Each glyph is offset from the last one by an advance value. The PathBuilder
struct then creates the subpaths. Currently, this is achieved by offsetting all of the coordinates within the glyph.
I was suggesting that the origin of the glyph could instead be applied here.
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.
Ok, will do that and push it in a bit
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 just rebased, and pushed some changes to do what you requested, however I'm facing some issues
in the image here the transform of the layer is set to 0,0
- The dashed bounding box is being drawn under the text, not over it
- The only thing that can be selected from the text is the last letter (
A
in this case), however @Keavon have already answered that, and said it will be fixed in the future - The
A
highlighting is not positioned on the actual rendered letter
I couldn't find the source of the issue yet, and wanted to give an update
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.
The source of the issue is the fact that instances are broken. However this isn't relevant to this PR.
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.
ok I see
what should we do, should we wait for that to fixed before merging, or merge for now (if there is no other comments)?
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'm not really sure what @Keavon plans to do about the Instances<T>
not being implemented properly. Last weekend they expressed a desire to start a refactor, however it seems that no commits in this direction have been made.
The issue is that the editor and tooling frequently use document.metadata.transform_to_viewport(layer_id)
and related functions. However since a layer is now made of zero or more instances with different transforms (after another Keavon refactor), this assumption no longer holds.
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.
Still planning to start on this soon, it's ultra high priority. It's not a merge blocker for this PR.
ec51271
to
e025103
Compare
Please add the checkbox to make this optional (for the moment), when you get the time, thank you! |
- Properly count characters with `str.chars().count()` instead of bytes `str.len()` - Change `String Length` node's output to `u32`
…rows (GraphiteEditor#2821) * Separate glyphs into Vector data rows * Fix `String Length` node - Properly count characters with `str.chars().count()` instead of bytes `str.len()` - Change `String Length` node's output to `u32` * Apply transform on instance instead of applying it when drawing the glyph * Add checkbox to enable/disable per-glyph instances * Tooltips --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This feature was first mentioned in the Discord server, and is being discussed on a dedicated thread