Add Pango-based TextLayoutManager for CXX platform#55600
Open
NickGerleman wants to merge 1 commit intofacebook:mainfrom
Open
Add Pango-based TextLayoutManager for CXX platform#55600NickGerleman wants to merge 1 commit intofacebook:mainfrom
NickGerleman wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@NickGerleman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93564131. |
Summary: Replace the CXX TextLayoutManager stub (which returns minimumSize/zero for all text) with a real Pango-based text measurement implementation. This enables actual text layout in Fantom tests on Linux, providing real font metrics, line breaking, and attachment positioning. Uses `#ifdef RCT_USE_PANGO` guards so that builds without Pango (e.g. Granite on non-Linux) continue to get the old stub behavior. The Pango path provides: - Full text measurement via PangoLayout (font family, size, weight, style, letter spacing, line height) - Per-line measurement via measureLines() detected by TextLayoutManagerExtended C++20 concepts - Attachment positioning via cursor positions at U+FFFC object replacement characters - Thread-safe caching for both measure() and measureLines() - Text transform support (uppercase, lowercase, capitalize) - Paragraph attributes (alignment, ellipsize mode, max lines, justify) For Buck builds, pango/pangoft2 deps are added under PLATFORMS_USING_CXX. For Fantom/CMake builds, 8 vendored libraries are added (freetype, harfbuzz, expat, libffi, fribidi, glib, fontconfig, pango) with custom CMakeLists.txt files and pre-generated config headers for Linux x86_64. Differential Revision: D93564131
284abb5 to
456da1b
Compare
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.
Summary:
Replace the CXX TextLayoutManager stub (which returns minimumSize/zero for all text) with a real Pango-based text measurement implementation. This enables actual text layout in Fantom tests on Linux, providing real font metrics, line breaking, and attachment positioning.
Uses
#ifdef RCT_USE_PANGOguards so that builds without Pango (e.g. Granite on non-Linux) continue to get the old stub behavior.The Pango path provides:
For Buck builds, pango/pangoft2 deps are added under PLATFORMS_USING_CXX. For Fantom/CMake builds, 8 vendored libraries are added (freetype, harfbuzz, expat, libffi, fribidi, glib, fontconfig, pango) with custom CMakeLists.txt files and pre-generated config headers for Linux x86_64.
Differential Revision: D93564131