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

[Impeller] Implement path based text rendering. #112213

Closed
chinmaygarde opened this issue Sep 22, 2022 · 6 comments
Closed

[Impeller] Implement path based text rendering. #112213

chinmaygarde opened this issue Sep 22, 2022 · 6 comments
Assignees
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list

Comments

@chinmaygarde
Copy link
Member

No description provided.

@chinmaygarde chinmaygarde added the c: performance Relates to speed or footprint issues (see "perf:" labels) label Sep 22, 2022
@chinmaygarde chinmaygarde added this to the Impeller on iOS milestone Dec 10, 2022
@chinmaygarde chinmaygarde removed the a: typography Text rendering, possibly libtxt label Feb 3, 2023
@matthew-carroll
Copy link
Contributor

@chinmaygarde can you describe the scope of this goal?

I've been working with @slightfoot for some time on custom glyph rendering in Flutter because Paragraphs were too heavy for us.

We've explored using standard curves to paint individual glyphs. We've explored pre-painting fonts to textures and then drawing glyphs with drawAtlas(). And now we're exploring doing our own tessellation and drawing with drawVertices().

If Flutter is going to bring more granular control to text painting, I'd really like for our use-case to make it on the roadmap, and ensure that we can use any such new Flutter APIs.

@chinmaygarde
Copy link
Member Author

chinmaygarde commented Feb 7, 2023

This issue doesn't track modifying the existing Flutter APIs in any way. It just that Impeller's text rendering today is extremely rudimentary in that it only uses glyph atlases with glyphs in them rendered at-scale. This works in most cases but is slow or takes up more memory than necessary (especially relative to the benchmark) for extremely large glyphs (when they are zoomed in). This issue along with a related on for SDF based rendering (which has already been implemented by not wired up in the high level interface) rounds out text rendering strategies necessary for ideal text rending support with Impeller.

@delfme
Copy link

delfme commented Feb 16, 2023

This might also lead to the fix of the infamous emojis rendering issue #28894

@chinmaygarde chinmaygarde removed this from the Impeller on iOS milestone Mar 1, 2023
@chinmaygarde
Copy link
Member Author

@jonahwilliams implemented this in flutter/engine#41402 to get numbers and also did a comparative study of Skias text rendering strategies. The finding was that that this isn't something that is used today for any point size.

While it's good to know that we could use this approach if we needed to, it doesn't have a current use-case. Closing this as wont-fix and putting the patch in the icebox.

@chinmaygarde chinmaygarde closed this as not planned Won't fix, can't repro, duplicate, stale May 18, 2023
@jonahwilliams
Copy link
Member

Yes, two important points:

  • Tessellation of the geometry across various point sizes was often times more expensive than software rendering of the same text. I don't expect compute shader based tessellation approaches to change this as text paths are often concave or self intersecting in ways that defeat common optimizations.

  • generally 4x MSAA is not sufficient anti aliasing for text at any point size, though it was harder to tell if the text was particularly heavy.

@github-actions
Copy link

github-actions bot commented Jun 1, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list
Projects
No open projects
Archived in project
Development

No branches or pull requests

4 participants