You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Impeller] Typographer: Track multiple atlas Textures when exceeding the device limit. #133092
Currently, if the rect packer is unable to fit all of the text glyphs into a single atlas texture, then text rendering will fail.
This is normally not a problem when targeting modern mobile devices with huge texture size limits, but Impeller may be used with embedded systems that are much more restrictive. For example, QNX with a 2048x2048 OpenGL texture size limit. To make Impeller text rendering safer, we should overflow atlas glyphs into multiple packed textures when the max texture size has been reached.
I was also thinking that beyond a certain glyph size we'd need to essentially fall back to path rendering, but this was more of a desktop issue - i.e. something silly like a 1000pt single character A will probably kill our backend. So there are two directions here, one is splitting the atlas when the max texture size is reached (this should come from capabilities because the current size is just hard coded) and the other is falling back to a non atlas strategy if a particular glyph is too large for any atlas (or large enough to not be practical for softare rendering).
I think adding a utility to the typographer backend for requesting a path for a given text frame would be a good idea. Letting Aiks make that decision based on some characteristics of the TextFrame would probably be an acceptable design.
In general, as far as the text atlas is concerned, typefaces can have 10s of thousands of glyphs, so if we want to reuse atlases across frames, we aught to support overflowing to multiple atlases lest we fail to render in constrained environments regardless of the presence of a cross-text-backend path rendering solution.
Activity
jonahwilliams commentedon Aug 23, 2023
I was also thinking that beyond a certain glyph size we'd need to essentially fall back to path rendering, but this was more of a desktop issue - i.e. something silly like a 1000pt single character A will probably kill our backend. So there are two directions here, one is splitting the atlas when the max texture size is reached (this should come from capabilities because the current size is just hard coded) and the other is falling back to a non atlas strategy if a particular glyph is too large for any atlas (or large enough to not be practical for softare rendering).
bdero commentedon Aug 23, 2023
I think adding a utility to the typographer backend for requesting a path for a given text frame would be a good idea. Letting Aiks make that decision based on some characteristics of the TextFrame would probably be an acceptable design.
In general, as far as the text atlas is concerned, typefaces can have 10s of thousands of glyphs, so if we want to reuse atlases across frames, we aught to support overflowing to multiple atlases lest we fail to render in constrained environments regardless of the presence of a cross-text-backend path rendering solution.
[Impeller] Respect max supported texture size when allocating glyph a…
[Impeller] Respect max supported texture size when allocating glyph a…
[Impeller] Respect max supported texture size when allocating glyph a…
[Impeller] Respect max supported texture size when allocating glyph a…