Optional STB based Glyph Atlas Support#12
Merged
bdero merged 1 commit intobdero:masterfrom Jul 17, 2023
johnoneil:user/joneil/stb-text-support
Merged
Optional STB based Glyph Atlas Support#12bdero merged 1 commit intobdero:masterfrom johnoneil:user/joneil/stb-text-support
bdero merged 1 commit intobdero:masterfrom
johnoneil:user/joneil/stb-text-support
Conversation
bdero
reviewed
Jul 13, 2023
Owner
bdero
left a comment
There was a problem hiding this comment.
Overall this impl is looks great! My comments are mainly around dependency management. Would be nice if we could pull the stb repo in as a submodule instead of versioning the headers inline here.
We're also missing a .clang-format in this repo, but we can take care of any Chromium-style deviations later once we've added a check for that.
bdero
approved these changes
Jul 17, 2023
Owner
bdero
left a comment
There was a problem hiding this comment.
LGTM. We recently how scaling works recently in the glyph atlas: flutter/engine#43695. I'll patch this backend with those changes next time we sync Flutter to HEAD in this repo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Here's the basic STB based Glyph Atlas support we've been working on.
The CMake footprint should keep the
noopbackend default unlessIMPELLER_CMAKE_TYPOGRAPHER_BACKEND_STBistrue. I do this for our builds by command line option-DIMPELLER_CMAKE_TYPOGRAPHER_BACKEND_STB=true.If that's defined the
typeface_stbandtext_render_context_stbmodules should be available for C++ clients instead of the currentnoopbackend.For the most part the
text_render_context_stbis closely based on the Impellertext_render_context_skia.cc. I tried to make it as close as possible to ensure it behaves as similarly as possible so it's familiar and can be compared.The only current test rigs we have are a couple of Rust based applications currently under review. This project forms the basis of Rust binding, so we exercise this module from Rust.
Any feedback or changes are appreciated.
Features:
ttfandotftypefaces.Deficiencies:
Additional Notes:
For our current target platform we have a texture size limitation of 2048x2048, so I've included a preprocessor definition to set this maximum size per build
MAX_GLYPH_ATLAS_SIZE