text-shape 0.1.4 → 0.1.5
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 +36 -17
- package/dist/font.d.ts +35 -1
- package/dist/font.d.ts.map +1 -1
- package/dist/font.js +65 -0
- package/dist/font.js.map +1 -1
- package/dist/typography.d.ts +4 -1
- package/dist/typography.d.ts.map +1 -1
- package/dist/typography.js.map +1 -1
- package/package.json +1 -1
- package/src/font.ts +81 -0
- package/src/typography.ts +4 -1
- package/wasm/text_shape.d.ts +117 -1
- package/wasm/text_shape.js +181 -0
- package/wasm/text_shape_bg.wasm +0 -0
- package/wasm/text_shape_bg.wasm.d.ts +12 -0
- package/wasm/text_shape_wasm_base64.js +1 -1
package/README.md
CHANGED
|
@@ -107,33 +107,52 @@ feature a range:
|
|
|
107
107
|
t.textProperty('fontFeatures', ['kern[0:2]=0']); // no font kerning for "AV"
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
### Inspecting fonts
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
font.info(); // { family_name: 'Roboto', subfamily_name: 'Regular', weight_class: 400, ... }
|
|
114
|
+
font.name(13); // a name table entry by ID, e.g. the license
|
|
115
|
+
font.glyphId('é'); // glyph for a character, or undefined
|
|
116
|
+
font.characters(); // every code point the font covers
|
|
117
|
+
font.features(); // ['kern', 'liga', 'smcp', 'ss01', ...]: what fontFeatures can toggle
|
|
118
|
+
font.namedInstances(); // [{ name: 'Bold', variations: { wght: 700, ... } }, ...]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The results are cached and read-only.
|
|
122
|
+
|
|
110
123
|
## API
|
|
111
124
|
|
|
112
125
|
Setters are chainable; call them with no arguments to read the current value.
|
|
113
126
|
|
|
114
|
-
| Function
|
|
115
|
-
|
|
|
116
|
-
| `loadFont(url, faceIndex?)`, `Font.fromBytes(bytes)`
|
|
117
|
-
| `new Typography()`
|
|
118
|
-
| `layout(str, x, y, maxWidth?, maxHeight?, extras?)`
|
|
119
|
-
| `font.
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
127
|
+
| Function | Description |
|
|
128
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
129
|
+
| `loadFont(url, faceIndex?)`, `Font.fromBytes(bytes)` | Load a TTF/OTF (or a face from a TTC) |
|
|
130
|
+
| `new Typography()` | Holds text settings; measures and lays out text |
|
|
131
|
+
| `layout(str, x, y, maxWidth?, maxHeight?, extras?)` | Lines and positioned glyphs; wraps when `maxWidth` is given. `extras.kerning` adjusts specific character pairs |
|
|
132
|
+
| `font.info()`, `name(id)`, `names()`, `glyphId(char)`, `characters()`, `glyphName(id)`, `glyphByName(name)`, `features()`, `scripts()`, `namedInstances()`, `tables()` | Font introspection: names and basic facts, character map, glyph names, OpenType features and scripts, named instances of variable fonts, table directory |
|
|
133
|
+
| `font.path(glyphId, variations?)`, `font.outline(glyphId, variations?, { flipY? })` | Glyph shape as a cached `Path2D`, or as raw path commands |
|
|
134
|
+
| `textFont(font, size?)`, `textSize(px)`, `textLeading(px)` | Font, size and line spacing (leading defaults to 1.25 × size) |
|
|
135
|
+
| `textAlign(h, v?)` | `START` (default) `END` `LEFT` `CENTER` `RIGHT` × `TOP` `CENTER` `BOTTOM` `BASELINE` (default). `START` and `END` follow the text direction, like CSS `text-align`: `START` is left for left-to-right text and right for right-to-left |
|
|
136
|
+
| `textWrap(mode)` | `WORD` (break where the Unicode line breaking rules allow, [UAX #14](https://www.unicode.org/reports/tr14/)) or `CHAR` (between characters, keeping emoji and accented letters whole, [UAX #29](https://www.unicode.org/reports/tr29/)) |
|
|
137
|
+
| `textDirection(dir)` | `"ltr"`, `"rtl"` or `"inherit"` (detect from text) |
|
|
138
|
+
| `textWeight(n)` | `wght` axis of variable fonts; with `BOLD`, at least 700 |
|
|
139
|
+
| `textStyle(style)` | `NORMAL` `ITALIC` `BOLD` `BOLDITALIC`: font axes when available, otherwise `layout().synthetic` says how to fake it |
|
|
140
|
+
| `textProperty(name, value?)`, `textProperties(obj?)` | `fontKerning`, `fontVariantCaps`, `letterSpacing`, `wordSpacing`, `direction`, `fontFeatures`, `fontVariationSettings` |
|
|
141
|
+
| `fontAscent()`, `fontDescent()` | Ascent/descent from the font's metrics |
|
|
142
|
+
| `textAscent(str?)`, `textDescent(str?)` | Tight ascent/descent of the first line of `str`, or the font's if omitted |
|
|
143
|
+
| `fontWidth(str)`, `fontBounds(...)` | Loose (advance-based) width and box |
|
|
144
|
+
| `textWidth(str)`, `textBounds(...)` | Tight (ink) width and box |
|
|
131
145
|
|
|
132
146
|
The measurements that take a string (`textAscent`, `textDescent`, `fontWidth`,
|
|
133
147
|
`textWidth`, `fontBounds`, `textBounds`) accept the same optional `extras` as
|
|
134
148
|
`layout()`, as their last argument, so kerned text measures as it's laid out:
|
|
135
149
|
`t.textWidth("AVATAR", { kerning })`.
|
|
136
150
|
|
|
151
|
+
A non-zero `letterSpacing` turns off optional ligatures (`liga`, `clig`, `dlig`,
|
|
152
|
+
`hlig`), as in CSS; add `'liga'` to `fontFeatures` to keep them. Contextual
|
|
153
|
+
alternates (`calt`) stay on, as in Firefox and Safari, so script fonts still join
|
|
154
|
+
their letters (Chrome turns `calt` off; add `'calt=0'` for that).
|
|
155
|
+
|
|
137
156
|
Units are px with y down. Text indices (glyph `cluster`, line ranges) are UTF-16
|
|
138
157
|
offsets, so they work with `String.prototype.slice`.
|
|
139
158
|
|
package/dist/font.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FontMetrics, FontStyle, InitInput, LayoutOptions, LayoutResult, PathCommand, ResolvedStyle, ShapeOptions, ShapingResult, VariationAxis } from '../wasm/text_shape.js';
|
|
1
|
+
import type { FontInfo, FontMetrics, FontStyle, FontTable, InitInput, LayoutOptions, LayoutResult, NameEntry, NamedInstance, PathCommand, ResolvedStyle, ShapeOptions, ShapingResult, VariationAxis } from '../wasm/text_shape.js';
|
|
2
2
|
export type Variations = Record<string, number>;
|
|
3
3
|
/**
|
|
4
4
|
* Initializes the wasm module once. Safe to call repeatedly; only the first
|
|
@@ -25,6 +25,8 @@ export declare class Font {
|
|
|
25
25
|
private styleCache;
|
|
26
26
|
private outlineCache;
|
|
27
27
|
private pathCache;
|
|
28
|
+
/** Introspection results, which don't depend on variations. */
|
|
29
|
+
private infoCache;
|
|
28
30
|
private constructor();
|
|
29
31
|
static load(url: string, faceIndex?: number): Promise<Font>;
|
|
30
32
|
/** Requires `initText()` to have resolved. */
|
|
@@ -42,7 +44,39 @@ export declare class Font {
|
|
|
42
44
|
}): readonly Readonly<PathCommand>[];
|
|
43
45
|
/** Glyph path in font units with y flipped to canvas orientation (y down). */
|
|
44
46
|
path(glyphId: number, variations?: Variations): Path2D;
|
|
47
|
+
/** Names and basic facts from the `name`, `head` and `OS/2` tables. */
|
|
48
|
+
info(): Readonly<FontInfo>;
|
|
49
|
+
/**
|
|
50
|
+
* A name from the `name` table by ID (1 family, 2 subfamily, 4 full name, 9
|
|
51
|
+
* designer, 13 license, ...), in US English if available.
|
|
52
|
+
*/
|
|
53
|
+
name(id: number): string | undefined;
|
|
54
|
+
/** Every decodable string in the `name` table, with its language. */
|
|
55
|
+
names(): readonly Readonly<NameEntry>[];
|
|
56
|
+
/** The glyph for a character (the first one of a string) or code point, or undefined. */
|
|
57
|
+
glyphId(char: string | number): number | undefined;
|
|
58
|
+
/** Every code point the font's character map covers, in order. */
|
|
59
|
+
characters(): readonly number[];
|
|
60
|
+
/** The glyph's name from the `post` or `CFF` table, e.g. "a.ss01", or undefined. */
|
|
61
|
+
glyphName(glyphId: number): string | undefined;
|
|
62
|
+
/** The glyph with this name, e.g. "a.ss01", or undefined. */
|
|
63
|
+
glyphByName(name: string): number | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* OpenType feature tags in the font's `GSUB` and `GPOS` tables, sorted, e.g.
|
|
66
|
+
* `["kern", "liga", "smcp", ...]`: the ones `fontFeatures` can turn on or off.
|
|
67
|
+
*/
|
|
68
|
+
features(): readonly string[];
|
|
69
|
+
/** OpenType script tags in `GSUB` and `GPOS`, sorted, e.g. `["DFLT", "arab", "latn"]`. */
|
|
70
|
+
scripts(): readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* Named instances of a variable font, e.g. "Bold Condensed", with the axis
|
|
73
|
+
* values to pass as `variations` (or `fontVariationSettings`). Empty for static fonts.
|
|
74
|
+
*/
|
|
75
|
+
namedInstances(): readonly Readonly<NamedInstance>[];
|
|
76
|
+
/** The font's tables, in directory order, with their sizes in bytes. */
|
|
77
|
+
tables(): readonly Readonly<FontTable>[];
|
|
45
78
|
dispose(): void;
|
|
79
|
+
private cached;
|
|
46
80
|
/** Drops unknown axes and clamps values to each axis range. */
|
|
47
81
|
private clamp;
|
|
48
82
|
private apply;
|
package/dist/font.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.d.ts","sourceRoot":"","sources":["../src/font.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAIhD;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAEhF;AAUD;;;;;;GAMG;AACH,qBAAa,IAAI;IAChB,QAAQ,CAAC,EAAE,EAAE,MA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S,MAAM,EAAE;IAI5B;;;OAGG;IACH,cAAc,IAAI,SAAS,QAAQ,CAAC,aAAa,CAAC,EAAE;IAIpD,wEAAwE;IACxE,MAAM,IAAI,SAAS,QAAQ,CAAC,SAAS,CAAC,EAAE;IAIxC,OAAO,IAAI,IAAI;IASf,OAAO,CAAC,MAAM;IAKd,+DAA+D;IAC/D,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,KAAK;CAUb"}
|
package/dist/font.js
CHANGED
|
@@ -35,6 +35,8 @@ export class Font {
|
|
|
35
35
|
styleCache = new Map();
|
|
36
36
|
outlineCache = new Map();
|
|
37
37
|
pathCache = new Map();
|
|
38
|
+
/** Introspection results, which don't depend on variations. */
|
|
39
|
+
infoCache = new Map();
|
|
38
40
|
constructor(id) {
|
|
39
41
|
this.id = id;
|
|
40
42
|
this.axes = wasm.get_variation_axes(id);
|
|
@@ -105,12 +107,75 @@ export class Font {
|
|
|
105
107
|
}
|
|
106
108
|
return path;
|
|
107
109
|
}
|
|
110
|
+
// -------------------------------------------------------------------------
|
|
111
|
+
// Introspection. Results are cached and read-only; none depend on variations.
|
|
112
|
+
// -------------------------------------------------------------------------
|
|
113
|
+
/** Names and basic facts from the `name`, `head` and `OS/2` tables. */
|
|
114
|
+
info() {
|
|
115
|
+
return this.cached('info', () => wasm.get_font_info(this.id));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A name from the `name` table by ID (1 family, 2 subfamily, 4 full name, 9
|
|
119
|
+
* designer, 13 license, ...), in US English if available.
|
|
120
|
+
*/
|
|
121
|
+
name(id) {
|
|
122
|
+
return this.cached(`name|${id}`, () => wasm.get_name(this.id, id));
|
|
123
|
+
}
|
|
124
|
+
/** Every decodable string in the `name` table, with its language. */
|
|
125
|
+
names() {
|
|
126
|
+
return this.cached('names', () => wasm.get_names(this.id));
|
|
127
|
+
}
|
|
128
|
+
/** The glyph for a character (the first one of a string) or code point, or undefined. */
|
|
129
|
+
glyphId(char) {
|
|
130
|
+
const cp = typeof char === 'number' ? char : char.codePointAt(0);
|
|
131
|
+
return cp === undefined ? undefined : wasm.get_glyph_id(this.id, cp);
|
|
132
|
+
}
|
|
133
|
+
/** Every code point the font's character map covers, in order. */
|
|
134
|
+
characters() {
|
|
135
|
+
return this.cached('characters', () => Array.from(wasm.get_characters(this.id)));
|
|
136
|
+
}
|
|
137
|
+
/** The glyph's name from the `post` or `CFF` table, e.g. "a.ss01", or undefined. */
|
|
138
|
+
glyphName(glyphId) {
|
|
139
|
+
return wasm.get_glyph_name(this.id, glyphId);
|
|
140
|
+
}
|
|
141
|
+
/** The glyph with this name, e.g. "a.ss01", or undefined. */
|
|
142
|
+
glyphByName(name) {
|
|
143
|
+
return wasm.get_glyph_by_name(this.id, name);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* OpenType feature tags in the font's `GSUB` and `GPOS` tables, sorted, e.g.
|
|
147
|
+
* `["kern", "liga", "smcp", ...]`: the ones `fontFeatures` can turn on or off.
|
|
148
|
+
*/
|
|
149
|
+
features() {
|
|
150
|
+
return this.cached('features', () => wasm.get_features(this.id));
|
|
151
|
+
}
|
|
152
|
+
/** OpenType script tags in `GSUB` and `GPOS`, sorted, e.g. `["DFLT", "arab", "latn"]`. */
|
|
153
|
+
scripts() {
|
|
154
|
+
return this.cached('scripts', () => wasm.get_scripts(this.id));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Named instances of a variable font, e.g. "Bold Condensed", with the axis
|
|
158
|
+
* values to pass as `variations` (or `fontVariationSettings`). Empty for static fonts.
|
|
159
|
+
*/
|
|
160
|
+
namedInstances() {
|
|
161
|
+
return this.cached('instances', () => wasm.get_named_instances(this.id));
|
|
162
|
+
}
|
|
163
|
+
/** The font's tables, in directory order, with their sizes in bytes. */
|
|
164
|
+
tables() {
|
|
165
|
+
return this.cached('tables', () => wasm.get_tables(this.id));
|
|
166
|
+
}
|
|
108
167
|
dispose() {
|
|
109
168
|
wasm.unload_font(this.id);
|
|
110
169
|
this.metricsCache.clear();
|
|
111
170
|
this.styleCache.clear();
|
|
112
171
|
this.outlineCache.clear();
|
|
113
172
|
this.pathCache.clear();
|
|
173
|
+
this.infoCache.clear();
|
|
174
|
+
}
|
|
175
|
+
cached(key, compute) {
|
|
176
|
+
if (!this.infoCache.has(key))
|
|
177
|
+
this.infoCache.set(key, compute());
|
|
178
|
+
return this.infoCache.get(key);
|
|
114
179
|
}
|
|
115
180
|
/** Drops unknown axes and clamps values to each axis range. */
|
|
116
181
|
clamp(variations) {
|
package/dist/font.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.js","sourceRoot":"","sources":["../src/font.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,KAAK,IAAI,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"font.js","sourceRoot":"","sources":["../src/font.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAoBxD,IAAI,SAAS,GAA4B,IAAI,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAqC;IAC7D,OAAO,CAAC,SAAS,KAAK,QAAQ,CAAC,EAAE,cAAc,EAAE,IAAI,IAAI,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,KAAK,UAAU,YAAY;IAC1B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC;IAC9E,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE;QAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC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,CAAC,CAAC,CAAC;SACnB,IAAI,EAAE;SACN,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;SAC9B,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC;AAED,SAAS,eAAe,CAAC,IAAsC;IAC9D,MAAM,CAAC,GAAG,IAAI,MAAM,EAAE,CAAC;IACvB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,QAAQ;gBACZ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;gBACvB,MAAM;YACP,KAAK,QAAQ;gBACZ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;gBACvB,MAAM;YACP,KAAK,QAAQ;gBACZ,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;gBACjD,MAAM;YACP,KAAK,SAAS;gBACb,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;gBAClE,MAAM;YACP,KAAK,OAAO;gBACX,CAAC,CAAC,SAAS,EAAE,CAAC;gBACd,MAAM;QACR,CAAC;IACF,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC"}
|
package/dist/typography.d.ts
CHANGED
|
@@ -35,7 +35,10 @@ export interface TextLayout extends LayoutResult {
|
|
|
35
35
|
export interface TextProperties {
|
|
36
36
|
fontKerning: 'auto' | 'normal' | 'none';
|
|
37
37
|
fontVariantCaps: 'normal' | 'small-caps' | 'all-small-caps' | 'petite-caps' | 'all-petite-caps' | 'unicase' | 'titling-caps';
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* px, or a CSS length string in px such as "2px". When non-zero, optional
|
|
40
|
+
* ligatures are off, as in CSS, unless `fontFeatures` turns them on.
|
|
41
|
+
*/
|
|
39
42
|
letterSpacing: number | string;
|
|
40
43
|
wordSpacing: number | string;
|
|
41
44
|
direction: TextDirectionSetting;
|
package/dist/typography.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../src/typography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EACX,MAAM,EACN,OAAO,EACP,aAAa,EACb,YAAY,EACZ,SAAS,EACT,MAAM,uBAAuB,CAAC;AAE/B,kGAAkG;AAClG,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,mFAAmF;AACnF,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,eAAO,MAAM,GAAG,QAAQ,CAAC;AACzB,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,QAAQ,aAAa,CAAC;AACnC,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,eAAO,MAAM,IAAI,SAAS,CAAC;AAC3B,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;AAC/D,MA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AK,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,UAAU;YACtD,MAAM,EAAE,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,KAAK,UAAU;SAC1D,CAAC,CAAC;QACH,OAAO;YACN,UAAU,EAAE,EAAE,GAAG,QAAQ,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE;YAC3E,SAAS,EAAE,QAAQ,CAAC,SAAS;SAC7B,CAAC;IACH,CAAC;CACD;AAED,SAAS,IAAI,CAAC,CAAkB;IAC/B,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,CAAC,CAAC;AACV,CAAC"}
|
package/package.json
CHANGED
package/src/font.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import initWasm, * as wasm from '../wasm/text_shape.js';
|
|
2
2
|
import type {
|
|
3
|
+
FontInfo,
|
|
3
4
|
FontMetrics,
|
|
4
5
|
FontStyle,
|
|
6
|
+
FontTable,
|
|
5
7
|
InitInput,
|
|
6
8
|
LayoutOptions,
|
|
7
9
|
LayoutResult,
|
|
10
|
+
NameEntry,
|
|
11
|
+
NamedInstance,
|
|
8
12
|
PathCommand,
|
|
9
13
|
ResolvedStyle,
|
|
10
14
|
ShapeOptions,
|
|
@@ -53,6 +57,8 @@ export class Font {
|
|
|
53
57
|
private styleCache = new Map<string, ResolvedStyle>();
|
|
54
58
|
private outlineCache = new Map<string, readonly Readonly<PathCommand>[]>();
|
|
55
59
|
private pathCache = new Map<string, Path2D>();
|
|
60
|
+
/** Introspection results, which don't depend on variations. */
|
|
61
|
+
private infoCache = new Map<string, unknown>();
|
|
56
62
|
|
|
57
63
|
private constructor(id: number) {
|
|
58
64
|
this.id = id;
|
|
@@ -145,12 +151,87 @@ export class Font {
|
|
|
145
151
|
return path;
|
|
146
152
|
}
|
|
147
153
|
|
|
154
|
+
// -------------------------------------------------------------------------
|
|
155
|
+
// Introspection. Results are cached and read-only; none depend on variations.
|
|
156
|
+
// -------------------------------------------------------------------------
|
|
157
|
+
|
|
158
|
+
/** Names and basic facts from the `name`, `head` and `OS/2` tables. */
|
|
159
|
+
info(): Readonly<FontInfo> {
|
|
160
|
+
return this.cached('info', () => wasm.get_font_info(this.id));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* A name from the `name` table by ID (1 family, 2 subfamily, 4 full name, 9
|
|
165
|
+
* designer, 13 license, ...), in US English if available.
|
|
166
|
+
*/
|
|
167
|
+
name(id: number): string | undefined {
|
|
168
|
+
return this.cached(`name|${id}`, () => wasm.get_name(this.id, id));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** Every decodable string in the `name` table, with its language. */
|
|
172
|
+
names(): readonly Readonly<NameEntry>[] {
|
|
173
|
+
return this.cached('names', () => wasm.get_names(this.id));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** The glyph for a character (the first one of a string) or code point, or undefined. */
|
|
177
|
+
glyphId(char: string | number): number | undefined {
|
|
178
|
+
const cp = typeof char === 'number' ? char : char.codePointAt(0);
|
|
179
|
+
return cp === undefined ? undefined : wasm.get_glyph_id(this.id, cp);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** Every code point the font's character map covers, in order. */
|
|
183
|
+
characters(): readonly number[] {
|
|
184
|
+
return this.cached('characters', () => Array.from(wasm.get_characters(this.id)));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** The glyph's name from the `post` or `CFF` table, e.g. "a.ss01", or undefined. */
|
|
188
|
+
glyphName(glyphId: number): string | undefined {
|
|
189
|
+
return wasm.get_glyph_name(this.id, glyphId);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** The glyph with this name, e.g. "a.ss01", or undefined. */
|
|
193
|
+
glyphByName(name: string): number | undefined {
|
|
194
|
+
return wasm.get_glyph_by_name(this.id, name);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* OpenType feature tags in the font's `GSUB` and `GPOS` tables, sorted, e.g.
|
|
199
|
+
* `["kern", "liga", "smcp", ...]`: the ones `fontFeatures` can turn on or off.
|
|
200
|
+
*/
|
|
201
|
+
features(): readonly string[] {
|
|
202
|
+
return this.cached('features', () => wasm.get_features(this.id));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** OpenType script tags in `GSUB` and `GPOS`, sorted, e.g. `["DFLT", "arab", "latn"]`. */
|
|
206
|
+
scripts(): readonly string[] {
|
|
207
|
+
return this.cached('scripts', () => wasm.get_scripts(this.id));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Named instances of a variable font, e.g. "Bold Condensed", with the axis
|
|
212
|
+
* values to pass as `variations` (or `fontVariationSettings`). Empty for static fonts.
|
|
213
|
+
*/
|
|
214
|
+
namedInstances(): readonly Readonly<NamedInstance>[] {
|
|
215
|
+
return this.cached('instances', () => wasm.get_named_instances(this.id));
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** The font's tables, in directory order, with their sizes in bytes. */
|
|
219
|
+
tables(): readonly Readonly<FontTable>[] {
|
|
220
|
+
return this.cached('tables', () => wasm.get_tables(this.id));
|
|
221
|
+
}
|
|
222
|
+
|
|
148
223
|
dispose(): void {
|
|
149
224
|
wasm.unload_font(this.id);
|
|
150
225
|
this.metricsCache.clear();
|
|
151
226
|
this.styleCache.clear();
|
|
152
227
|
this.outlineCache.clear();
|
|
153
228
|
this.pathCache.clear();
|
|
229
|
+
this.infoCache.clear();
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
private cached<T>(key: string, compute: () => T): T {
|
|
233
|
+
if (!this.infoCache.has(key)) this.infoCache.set(key, compute());
|
|
234
|
+
return this.infoCache.get(key) as T;
|
|
154
235
|
}
|
|
155
236
|
|
|
156
237
|
/** Drops unknown axes and clamps values to each axis range. */
|
package/src/typography.ts
CHANGED
|
@@ -52,7 +52,10 @@ export interface TextProperties {
|
|
|
52
52
|
| 'all-petite-caps'
|
|
53
53
|
| 'unicase'
|
|
54
54
|
| 'titling-caps';
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* px, or a CSS length string in px such as "2px". When non-zero, optional
|
|
57
|
+
* ligatures are off, as in CSS, unless `fontFeatures` turns them on.
|
|
58
|
+
*/
|
|
56
59
|
letterSpacing: number | string;
|
|
57
60
|
wordSpacing: number | string;
|
|
58
61
|
direction: TextDirectionSetting;
|
package/wasm/text_shape.d.ts
CHANGED
|
@@ -50,6 +50,51 @@ export function resolve_style(font_id: number, style: FontStyle | null | undefin
|
|
|
50
50
|
* current variations.
|
|
51
51
|
*/
|
|
52
52
|
export function get_outline(font_id: number, glyph_id: number, flip_y?: boolean | null): PathCommand[];
|
|
53
|
+
/**
|
|
54
|
+
* Names and basic facts from the `name`, `head` and `OS/2` tables.
|
|
55
|
+
*/
|
|
56
|
+
export function get_font_info(font_id: number): FontInfo;
|
|
57
|
+
/**
|
|
58
|
+
* A name from the `name` table by ID, in US English if available, otherwise
|
|
59
|
+
* English, otherwise the first one.
|
|
60
|
+
*/
|
|
61
|
+
export function get_name(font_id: number, name_id: number): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Every decodable string in the `name` table, by ID.
|
|
64
|
+
*/
|
|
65
|
+
export function get_names(font_id: number): NameEntry[];
|
|
66
|
+
/**
|
|
67
|
+
* The glyph the character map gives a code point, or undefined.
|
|
68
|
+
*/
|
|
69
|
+
export function get_glyph_id(font_id: number, code_point: number): number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Every code point the character map covers, in order.
|
|
72
|
+
*/
|
|
73
|
+
export function get_characters(font_id: number): Uint32Array;
|
|
74
|
+
/**
|
|
75
|
+
* The glyph's name from the `post` or `CFF` table, or undefined.
|
|
76
|
+
*/
|
|
77
|
+
export function get_glyph_name(font_id: number, glyph_id: number): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* The glyph with this name, or undefined.
|
|
80
|
+
*/
|
|
81
|
+
export function get_glyph_by_name(font_id: number, name: string): number | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* OpenType feature tags in `GSUB` and `GPOS`, sorted.
|
|
84
|
+
*/
|
|
85
|
+
export function get_features(font_id: number): string[];
|
|
86
|
+
/**
|
|
87
|
+
* OpenType script tags in `GSUB` and `GPOS`, sorted.
|
|
88
|
+
*/
|
|
89
|
+
export function get_scripts(font_id: number): string[];
|
|
90
|
+
/**
|
|
91
|
+
* The named instances of a variable font (empty for static fonts).
|
|
92
|
+
*/
|
|
93
|
+
export function get_named_instances(font_id: number): NamedInstance[];
|
|
94
|
+
/**
|
|
95
|
+
* The font's tables, in directory order.
|
|
96
|
+
*/
|
|
97
|
+
export function get_tables(font_id: number): FontTable[];
|
|
53
98
|
/**
|
|
54
99
|
* Lays out `text`: hard breaks, wrapping (with `max_width`), bidi reordering,
|
|
55
100
|
* alignment and bounds. Uses the font's current variations.
|
|
@@ -89,6 +134,62 @@ export interface FontMetrics {
|
|
|
89
134
|
global_bbox: GlyphBBox;
|
|
90
135
|
}
|
|
91
136
|
|
|
137
|
+
/** Names and basic facts from the `name`, `head` and `OS/2` tables. */
|
|
138
|
+
export interface FontInfo {
|
|
139
|
+
/** Typographic family name if the font has one, otherwise the family name. */
|
|
140
|
+
family_name: string | null;
|
|
141
|
+
/** Typographic subfamily name if the font has one, otherwise the subfamily name, e.g. "Bold Italic". */
|
|
142
|
+
subfamily_name: string | null;
|
|
143
|
+
full_name: string | null;
|
|
144
|
+
postscript_name: string | null;
|
|
145
|
+
/** The version string, e.g. "Version 3.011". */
|
|
146
|
+
version: string | null;
|
|
147
|
+
/** `head.fontRevision`, e.g. 3.011. */
|
|
148
|
+
font_revision: number;
|
|
149
|
+
/** Four-character vendor ID from `OS/2`, e.g. "GOOG", trailing spaces trimmed. */
|
|
150
|
+
vendor_id: string | null;
|
|
151
|
+
/** `OS/2` weight class: 100 (thin) to 900 (black), 400 regular, 700 bold. */
|
|
152
|
+
weight_class: number | null;
|
|
153
|
+
/** `OS/2` width class: 1 (ultra-condensed) to 9 (ultra-expanded), 5 normal. */
|
|
154
|
+
width_class: number | null;
|
|
155
|
+
/** `OS/2.fsType` embedding permission bits; 0 = installable. */
|
|
156
|
+
embedding: number | null;
|
|
157
|
+
/** Creation date from `head`, in seconds since the Unix epoch (`new Date(created * 1000)`). */
|
|
158
|
+
created: number | null;
|
|
159
|
+
modified: number | null;
|
|
160
|
+
num_glyphs: number;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** One localized string from the `name` table. */
|
|
164
|
+
export interface NameEntry {
|
|
165
|
+
/**
|
|
166
|
+
* Name ID: 0 copyright, 1 family, 2 subfamily, 4 full name, 5 version, 6 PostScript
|
|
167
|
+
* name, 9 designer, 13 license, 16/17 typographic family and subfamily, 256 and up
|
|
168
|
+
* for font-specific names (axes, instances, ...).
|
|
169
|
+
*/
|
|
170
|
+
id: number;
|
|
171
|
+
/** BCP 47 language tag, e.g. "en-US", or null if unknown. */
|
|
172
|
+
language: string | null;
|
|
173
|
+
value: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** A predefined location of a variable font, e.g. "Bold Condensed". */
|
|
177
|
+
export interface NamedInstance {
|
|
178
|
+
/** Subfamily name, e.g. "Bold Condensed". */
|
|
179
|
+
name: string | null;
|
|
180
|
+
postscript_name: string | null;
|
|
181
|
+
/** The value of every axis; pass to `set_variations`. */
|
|
182
|
+
variations: Record<string, number>;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** An entry in the font's table directory. */
|
|
186
|
+
export interface FontTable {
|
|
187
|
+
/** Four-character tag, e.g. "glyf", "CFF " (with its trailing space). */
|
|
188
|
+
tag: string;
|
|
189
|
+
/** Size in bytes. */
|
|
190
|
+
length: number;
|
|
191
|
+
}
|
|
192
|
+
|
|
92
193
|
export interface VariationAxis {
|
|
93
194
|
tag: string;
|
|
94
195
|
min: number;
|
|
@@ -189,7 +290,10 @@ export interface LayoutOptions {
|
|
|
189
290
|
size?: number;
|
|
190
291
|
/** Distance between baselines. Defaults to 1.25 × size. */
|
|
191
292
|
leading?: number | null;
|
|
192
|
-
/**
|
|
293
|
+
/**
|
|
294
|
+
* Added after every cluster. When non-zero, optional ligatures (liga, clig, dlig,
|
|
295
|
+
* hlig) are off, as in CSS, unless `features` turns them on.
|
|
296
|
+
*/
|
|
193
297
|
letter_spacing?: number;
|
|
194
298
|
/** Added after every space. */
|
|
195
299
|
word_spacing?: number;
|
|
@@ -282,8 +386,19 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
282
386
|
export interface InitOutput {
|
|
283
387
|
readonly memory: WebAssembly.Memory;
|
|
284
388
|
readonly bidi_line: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
389
|
+
readonly get_characters: (a: number) => [number, number, number, number];
|
|
390
|
+
readonly get_features: (a: number) => [number, number, number, number];
|
|
391
|
+
readonly get_font_info: (a: number) => [number, number, number];
|
|
392
|
+
readonly get_glyph_by_name: (a: number, b: number, c: number) => [number, number, number];
|
|
393
|
+
readonly get_glyph_id: (a: number, b: number) => [number, number, number];
|
|
394
|
+
readonly get_glyph_name: (a: number, b: number) => [number, number, number, number];
|
|
285
395
|
readonly get_metrics: (a: number) => [number, number, number];
|
|
396
|
+
readonly get_name: (a: number, b: number) => [number, number, number, number];
|
|
397
|
+
readonly get_named_instances: (a: number) => [number, number, number];
|
|
398
|
+
readonly get_names: (a: number) => [number, number, number];
|
|
286
399
|
readonly get_outline: (a: number, b: number, c: number) => [number, number, number];
|
|
400
|
+
readonly get_scripts: (a: number) => [number, number, number, number];
|
|
401
|
+
readonly get_tables: (a: number) => [number, number, number];
|
|
287
402
|
readonly get_variation_axes: (a: number) => [number, number, number];
|
|
288
403
|
readonly graphemes: (a: number, b: number) => [number, number];
|
|
289
404
|
readonly layout: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -301,6 +416,7 @@ export interface InitOutput {
|
|
|
301
416
|
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
302
417
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
303
418
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
419
|
+
readonly __externref_drop_slice: (a: number, b: number) => void;
|
|
304
420
|
readonly __wbindgen_start: () => void;
|
|
305
421
|
}
|
|
306
422
|
|