-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable vertical point label placement via 'text-writing-mode' style p…
…roperty (#8399) * Add text-writing-mode layout property * Add render tests for text-writing-mode layout property * Skip render tests for text-writing-mode property * Revert "Skip render tests for text-writing-mode property" This reverts commit 069c6f0. * Add 'text-writing-mode' style spec type & symbol layer prop * Add attributes to SymbolInstance & PlacedSymbol structs for vertical placement - Add placedOrientation attribute to PlacedSymbol - Add verticalTextBox attributes to SymbolInstance alongside textBox & iconBox * Rotate glyphs for vertical point labels if needed & correct for y-offset Port changes from gl-native@alexshalamov_wip_vertical_labels (shaping.cpp, quads.cpp glyphs.hpp) * Track writing modes and enable vertical placement in SymbolBucket - Add writingModes and allowVerticalPlacement properties to SymbolBucket - Compute writingModes from `text-writing-mode` style property - Determine glyph dependencies based on whether vertical placement is allowed - Rotate symbols as needed * Track vertical collision boxes in SymbolBucket, if needed * Add vertical text shaping during symbol layout, if needed * Add vertical text collision feature during symbol layout, if needed * Hide unused orientation glyphs when drawing symbols - Add updateVerticalLabels to hide glyphs for unused orientations - Modify updateVariableAnchors to hide unused orientation glyphs when using vertical labels and variable anchors * Place correct orientation variant per chosen writing modes - Attempt to place vertical/horizontal boxes for each symbol according to writing mode order of preference - Integrate with variable-anchor placement to try each anchor/orientation combination possible - Prefer previously placed orientations & anchors - Hide unplaced orientations * Fix symbol unit tests Add yOffset property to shaping objects * Organize text-writing-mode render tests to separate line/point tests * Add more render tests for vertical CJK point labels Add tests for vertical placement of point labels with: - CJK text with punctuation - multiline mixed CJK/latin text - CJK with embedded Arabic RTL text * Tiny clean up * Minor fixes per reviewer comments * Revert "Update yarn.lock" per reviewer comment This reverts commit 3ff7480. * Deduplicate values during SymbolStyleLayer creation (not SymbolBucket) * Add type annotations for variable anchor box placement * Use .indexOf instead of .includes for IE compat; lint fix * Render half-width glyphs in upright orientation This change forces glyphs whose natural orientation in vertical writing mode is 'sideways' to be rendered in upright orientation (only for non complex text layouts). This is different compared to W3C / browser behavior that is by default, renders glyphs in their respective natural orientation. In the future, there might need to add a new layout property that would control glyph orientation separately (e.g., text-glyph-orientation: natural | upright). * Update mixed-multiline-vertical-horizontal-mode expected results
- Loading branch information
Showing
49 changed files
with
1,125 additions
and
116 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.