* Introduce a universal IGlyphTypeface implementation that does not rely on any platform implementation
* Revert changes
* Fix Android
* Make the test happy
* Fix build
* Update baseline
* Fix naming
* Fix headless
* Move interfaces to dedicated files
Make GlyphTypeface.GlyphCount an integer
* Fix GlyphCount
* Make IGlyphTypeface NotClientImplementable
* Make sure we cache platform typefaces by their desired name, style, weight and stretch
* Update baseline
* Only use IGlyphTypeface
* Fix Android
* Try to clear the buffer before we encode somethimg
* Add needed test font
* Add more unit tests
* Reduce allocations
* Remove Direct2D1 test files
* More tests
* More complete table implementations
* More adjustments
* Use batch APIs
* Handle invalid timestamps
* Update baseline
* Introduce a CharacterToGlyphMap struct for faster access
* Remove AggressiveInlining
* Remove AggressiveInlining
* Make the head table optional for legacy fonts
* Remove Load method. Fix TextBlockTests
* Fix nullables
* Remove redundant folder
* Update Api baseline
* revert diff helper changes
* revert changes
* Use bare minimum font for Headless platform and introduce a test font manager that uses the Inter font for testing.
* Add missing font file for Headless platform
---------
Co-authored-by: Gillibald <stebner@avaloniaui.net>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Reduce allocations for FontFamily.Parse
* Turn Trie data into static data
* Use static lambda in s_cachedLanguage.GetOrAdd
* Make LineBreakEnumerator+LineBreakState a ref struct to avoid allocations
* Use backing field for storing trie data in debug builds
* Fixed the issue where a newline character required two backspaces to be deleted in Windows.
* add unit test
* Handling the differences between HeadlessTextShaperStub and TextShaperImpl
* Make unit tests available
* Treat "\r\n" as a single unit.
* The backspace test against CRLF
* Backspace should treat CRLF as a unit.
* Do not treat spacing combining marks as whitespace
* Do not treat combining marks as whitespace
Try to find a matching typeface on a grapheme boundary
* Add embedded font for testing
* Remove using
* Fix naming and remove redundant code
* Apply default until we reach the next base character
* - Adjusts the overhang calculation so it matches what WPF produces
- Fixes baseline alignment for inline controls
* Adjust OverhangTrailing
Add unit test
* Only run overhang unit test on Windows
* xml documentatation for paragraph properties
* TextTestApp
* text test files renamed parameter
* glyph ink bounds
* shaped buffer make selected row visible
* text test app force light theme
* text test app distinguish start and end distance marks
---------
Co-authored-by: Jan Kučera <miloush@users.noreply.github.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Reverse text runs for RTL flow direction
* Optimize text run traversal.
* Remove unused LINQ directive from TextLineImpl.cs
* Add RTL newline handling test in TextLineTests
* Add RTL newline handling tests for text formatting.
* Make sure we only apply the cluster offset if we are inside the current cluster
* Better naming
* Guard coveredLength against invalid values
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Adjust TextLineImpl.GetTextRunBounds so it properly handles substitutions
Adjust TextLineImpl.GetTextRunBounds so it properly reports out of text range bounds
Adjust TextLineImpl.GetTextRunBounds so it properly reports text source run indices
* Remove redundant comments
* Add requested changes
* Fix issue with MinTextWidth (Fixes#18372)
* Make sure that MeasureOverride for TextPresenter and TextBlock are using same textWidth
* Revert #16601 that is introducing an invalid calculation for the OverhangLeading
Add tests for OverhangLeading and OverhangTrailing
* Revert MinTextWidth
* Fix tests to not rely on fixed values
* Fix remaining issues
* Fix comment in Direct2D1 GlyphRunImpl.cs
* Fix Direct2D1 rendering
* Fix gold images
* Restore TextLineImpl
* Update gold image
* Restore Math.Max on OverhangLeading and Trailing
* Adopt similar behavior to WPF: don't use OverhangLeading/Trailing for measuring and remove clip by default.
But it requires further support with NeedsClipBounds
* Remove MinTextWidth
Keep ClipToBounds=true default for TextBlock
* Revert change
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Added FormattedTextSource->GetTextRun failing test
* Ensure that TextLayout-TextRuns are correctly generated from the passed TextStyleOverrides using the FormattedTextSource->GetTextRun method.
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Trim text-runs in their logical order
* Revert breaking changes
* Added TODO12 comment
* Added test unit
* Use LogicalTextRunEnumerator
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Fix BiDi algorithm and tests
* More adjustments
* Add EastAsianWidth trie and class
* Start implementing Unicode v15.1 Standard Annex #14
* Update Unicode data to V15.1 and initial Unicode® Standard Annex #14 implementation
* Some adjustments
* More fixes
* 543 to go
* 273 to go
* Almost done
* Finish up line breaker
* Some adjustments
* Always Return 0 bidi level for TextEndOfLine run
* Fix test unit
* Expand the unit test
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* [Text] fix infinite loop hang on selection of bidi text
* Deal with zero width whitespaces during run bounds calculation
* Do the same thing for RTL
---------
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Add font table loading
* Add localized family names
* Adjust license reference
* Add support for localized family names to the FontManager
* Add supported font features list
* Add unit test
* Fix font metrics
* Fix TextLineImpl baseline calculation of drawable runs
* Invert InlineRun baseline
* Adjust drawable run ascent offset calculation
* Ability to configure font features
* Minor adjustments
---------
Co-authored-by: Herman Kirshin <herman.kirshin@jetbrains.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>