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

Float Layout #437

Open
Tracked by #345
giannissc opened this issue Apr 14, 2023 · 3 comments
Open
Tracked by #345

Float Layout #437

giannissc opened this issue Apr 14, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@giannissc
Copy link

giannissc commented Apr 14, 2023

Typst developers have been talking about refactoring the layout engine to make it more flexible and powerful. I have thrown the idea of looking into taffy either for inspiration or to use directly. One layout that is missing from taffy is the float layout (more relevant for paged media). Is this something you would care for supporting?

@nicoburns

@giannissc giannissc added the enhancement New feature or request label Apr 14, 2023
@nicoburns
Copy link
Collaborator

nicoburns commented Apr 14, 2023

So I haven't thought too deeply about this, but I believe that float layout requires close integration with text layout (because, for example, the y-axis position a floated element that occurs midway through a sentence of text depends on how that text is wrapped, and thus which line that sentence occurs on). If that is the case, then I would inclined to consider float layout as out of scope of Taffy on the basis that anything involving text layout is considered out of scope.

That being said:

  • Taffy is designed to be easy to integrate as part of a wider layout engine implementing text layout (or any other kind of layout for that matter)
  • If there was another library that implemented float layout (perhaps cosmic-text) then Taffy could potentially pull that in as a dependency (behind a feature flag) to offer that feature too.

Out of interest, how does Typst currently do text layout (and indeed layout in general)?

@nicoburns
Copy link
Collaborator

You may also be interested in Servo's Layout 2020 engine which has recently been revived as a project and is intending to implement float layout (but doesn't yet implement flexbox or grid well)

@giannissc
Copy link
Author

Thanks for the link I will have a look!

Out of interest, how does Typst currently do text layout (and indeed layout in general)?

I have started looking into typst just last week so the answer for now is I am not sure. But I will be looking into the codebase soon and I can get back to you!

@nicoburns nicoburns mentioned this issue Aug 6, 2024
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants