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

Layout/text #583

Merged
merged 9 commits into from
Sep 6, 2024
Merged

Layout/text #583

merged 9 commits into from
Sep 6, 2024

Conversation

Sharktheone
Copy link
Member

We now use parley for text layout. So, we can now do like wrapping and so on. It still isn't 100% correct, since there are things I haven't yet implemented:

  • flattening of nested inline trees

    This should fix two issues, first line wrapping of nested text, eg when you have

       <p>Hello, world!<span> some other very very long text, that could be partially wrapped to another line</span>
       </p>

    currently if the width of the whole span is to wide to fit, it would get it's own line, we would not try to still fit the first few words of the span on the same line of "Hello, world!"

  • Text Baseline offset

    if you have a inline-block box with text, it tries to align the text inside the inline-block box with the text on the outside. Our current implementation can't do this.

I will implement both of these two things in a next PR, but for now I have enough of text rendering/layouting 😅

@Sharktheone
Copy link
Member Author

Ah, this also adds the ability to use bold and italics and all other variable font axes.

I don't know if I implemented all css shortcuts, but weight and style should work. font-variation-settings is also still left to "parse" the css values into something that it can use.

@Sharktheone Sharktheone merged commit ab4fd1c into gosub-io:main Sep 6, 2024
10 checks passed
@Sharktheone Sharktheone deleted the layout/text branch September 6, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🎯 Done
Development

Successfully merging this pull request may close these issues.

2 participants