Skip to content

Change text paint order to stroke-fill - #3013

Closed
Enter-tainer wants to merge 3 commits into
typst:mainfrom
Enter-tainer:mgt/text-stroke-paint-order
Closed

Enter-tainer wants to merge 3 commits into
typst:mainfrom
Enter-tainer:mgt/text-stroke-paint-order

Conversation

@Enter-tainer

@Enter-tainer Enter-tainer commented Dec 19, 2023 •

Copy link
Copy Markdown
Contributor

Problem remains:

  • copy paste code in pdf export Fixed
  • pdf export doesnt look the same as png and svg when stroke is large.
    The paint order in pdf is Stroke(Lorem), Fill(Lorem) ... But for svg and png it is Stroke(L), Fill(L), Stroke(o), Fill(o) ...
    So they may look different when the stroke is very large.

To solve this we need either: paint pdf text glyph by glyph, or render twice for png and svg. I feel like neither one is not worth it. Maybe keep current behavior is good enough.

Comment thread crates/typst-pdf/src/page.rs Resolved
@Dherse

Dherse commented Dec 19, 2023

Copy link
Copy Markdown
Contributor

I feel like rendering it glyph-by-glyph might be an issue with some of the PDF/A limitations (maybe, not too sure): #2942

@Enter-tainer Enter-tainer mentioned this pull request Dec 20, 2023
2 tasks done
@Enter-tainer
Enter-tainer force-pushed the mgt/text-stroke-paint-order branch from 7d71b97 to 2786cc6 Compare December 20, 2023 15:18
@Enivex

Enivex commented Dec 20, 2023

Copy link
Copy Markdown
Collaborator

I feel like rendering it glyph-by-glyph might be an issue with some of the PDF/A limitations (maybe, not too sure): #2942

Surely the goal is to have a PDF/A-compliant mode, not that all typst documents should necessarily be PDF/A compliant?

@laurmaedje

Copy link
Copy Markdown
Member

Rendering the text twice might also result in problems with copy paste and accessibility.

@Enter-tainer

Copy link
Copy Markdown
Contributor Author

agree. we may see how users react to the current behavior and decide whether to merge this

@laurmaedje
laurmaedje marked this pull request as draft January 5, 2024 08:42
@laurmaedje

Copy link
Copy Markdown
Member

I'll close this for now. If we think this is useful down the road, we can reopen.

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