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

Anchor footnotes positioning #135

Open
Tracked by #196
CosmicHorrorDev opened this issue May 29, 2023 · 3 comments · May be fixed by #264
Open
Tracked by #196

Anchor footnotes positioning #135

CosmicHorrorDev opened this issue May 29, 2023 · 3 comments · May be fixed by #264
Labels
A-font Area: Dealing with font loading/rendering C-bug Category: Something isn't working

Comments

@CosmicHorrorDev
Copy link
Collaborator

Question for @trimental since I'm not familiar with the new text system (and was only vaguely familiar with the last one)

It seems like the proper way to handle anchor links now that we support footnotes is to have the anchor attached to the text within a textbox instead of the textbox itself. This way we can have multiple anchors in the same textbox e.g.

This textbox[^1] has two footnotes[^2]

and we can have positioning right in terms of anchors within a textbox e.g. if the above text ran over multiple lines then we want the anchor to be attached to the correct line within the textbox. If this wasn't the case then we could just have a vec of anchors for a textbox and call it a day

I'm opening this issue because I'm not really sure what the appropriate way to figure out the position of text within a textbox. After getting that figured out it should be simple enough to implement the above

@trimental
Copy link
Collaborator

We could move the anchor hashmap out of positioner perhaps to src renderer and have the anchor update everytime the text is layedout. That would presumably be done inside here

@trimental
Copy link
Collaborator

Downside would be having to pass around the anchor map everywhere text is sized, layedout, etc. But perhaps we can just stick in the TextSystem struct.

@CosmicHorrorDev
Copy link
Collaborator Author

That seems like a reasonable approach. I'll play around with it, and see how clean things end up being sometime this week

@CosmicHorrorDev CosmicHorrorDev added C-bug Category: Something isn't working A-font Area: Dealing with font loading/rendering labels Dec 2, 2023
@CosmicHorrorDev CosmicHorrorDev linked a pull request Mar 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-font Area: Dealing with font loading/rendering C-bug Category: Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants