@weasel-js/font 1.9.4 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -3
- package/dist/{chunk-ERSHQYJL.js → chunk-NM6K6M4Y.js} +460 -242
- package/dist/chunk-NM6K6M4Y.js.map +1 -0
- package/dist/index.d.ts +142 -77
- package/dist/index.js +148 -3
- package/dist/index.js.map +1 -1
- package/dist/{test-seams-BC5Ykf4D.d.ts → test-seams-BvULFsbo.d.ts} +170 -230
- package/dist/test-seams.d.ts +1 -1
- package/dist/test-seams.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-ERSHQYJL.js.map +0 -1
package/README.md
CHANGED
|
@@ -24,14 +24,24 @@ An unregistered family renders in the default family with a one-time warning:
|
|
|
24
24
|
```ts
|
|
25
25
|
setFontFallbackPolicy('substitute'); // default — render in the default family
|
|
26
26
|
setFontFallbackPolicy('canvas'); // rasterize the real typeface at runtime
|
|
27
|
-
setFontFallbackPolicy('none'); // hard miss: render nothing
|
|
27
|
+
setFontFallbackPolicy('none'); // hard miss: render nothing
|
|
28
28
|
|
|
29
29
|
setDefaultFontFamily('Inter'); // defaults to the first registered family
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
Substitution changes advance widths, so measurement and wrap differ from the
|
|
33
|
-
requested font. `ResolveResult.substituted` reports it
|
|
34
|
-
surface the swap
|
|
33
|
+
requested font. `ResolveResult.substituted` reports it so a UI can
|
|
34
|
+
surface the swap.
|
|
35
|
+
|
|
36
|
+
## Emoji
|
|
37
|
+
|
|
38
|
+
An emoji is drawn by the platform, whatever face its run is set in: the whole
|
|
39
|
+
grapheme cluster (`👍🏽`, `🇨🇦`, a joined family) is rasterized once through a 2D
|
|
40
|
+
canvas and kept, in its own colors, on RGBA pages of the dynamic atlas beside
|
|
41
|
+
the distance-field ones. It paints untinted and takes only the opacity of the
|
|
42
|
+
text's fill. Under `setFontFallbackPolicy('none')` only a run already on the
|
|
43
|
+
canvas tier gets one; anywhere without a canvas or a color emoji font, a
|
|
44
|
+
cluster is laid out one code point at a time in the fill color.
|
|
35
45
|
|
|
36
46
|
## Generating an atlas
|
|
37
47
|
|