Jason Johnston 6fb806145f
feat(troika-three-text): add fallback font loading for full Unicode support (#279)
* feat(troika-three-text): initial support for multiple font files split by unicode range - #13

Mimics how CSS @font-face resolves across multiple fonts by unicode-range, only loading
those font files needed for the characters actually used. This allows for more complete
language coverage without having to include everything in one font file, and Latin text
can now load a smaller font file by default. The support is currently limited to an
internal set of fallback fonts, but it will be opened up to the public API soon.

Internally this required supporting varying font metrics between characters, which also
sets us up for inline styling e.g. varying font-size, font-style, etc. - see #65

* feat(troika-three-text): add fallback fonts for CJK and support 'lang' prop

* feat(troika-three-text): add Noto Emoji font to fallback list

* fix(troika-three-text): add CJK punctuation to unicode ranges

* feat(troika-three-text): add Arabic and Chinese texts to example

* feat(troika-three-text): integrate unicode-font-resolver for full unicode fallback font coverage

* chore: allow unicode-ranges branch to publish prerelease versions

* v0.48.0-unicode.0

* fix: fontResolverWorkerModule wasn't exported

* v0.48.0-unicode.1

* fix: fix hang on zero-length text

* v0.48.0-unicode.2

* feat: add fontWeight and fontStyle params for fallback font resolution

* v0.48.0-unicode.3

* fix: pre-transpile the unicode-font-resolver lib

* feat: allow configuring unicode-font-resolver data URL

* docs for unicode font loading

* v0.48.0-unicode.4

* chore: update unicode-font-resolver to 1.0.0
2023-09-08 16:37:12 -06:00
..
2021-02-16 13:18:27 -07:00