@mark1russell7/typeset 0.1.2 → 0.1.4
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/build/chunks/font.d.ts +25 -0
- package/build/chunks/font.d.ts.map +1 -1
- package/build/chunks/font.js +397 -143
- package/build/chunks/font.js.map +1 -1
- package/build/chunks/fonts.d.ts +25 -2
- package/build/chunks/fonts.d.ts.map +1 -1
- package/build/chunks/fonts.js +141 -3
- package/build/chunks/fonts.js.map +1 -1
- package/build/fonts-inspect.d.ts +5 -0
- package/build/fonts-inspect.d.ts.map +1 -1
- package/build/fonts-inspect.js +1 -1
- package/build/fonts.d.ts +2 -2
- package/build/fonts.js +2 -2
- package/package.json +2 -2
- package/src/fonts/bound.ts +170 -0
- package/src/fonts/font.ts +30 -6
- package/src/fonts/index.ts +1 -0
- package/src/fonts/indic.ts +19 -75
- package/src/fonts/kerning.ts +68 -7
- package/src/fonts/normalize.ts +144 -0
- package/src/fonts/substitution.ts +101 -1
- package/src/fonts/tables.ts +22 -0
- package/src/fonts-inspect.ts +2 -2
- package/src/fonts.ts +1 -0
package/build/chunks/font.d.ts
CHANGED
|
@@ -22,6 +22,15 @@ interface GlyphInfo {
|
|
|
22
22
|
/** The code point of the character of the glyph, after the normalization. */
|
|
23
23
|
readonly codePoint: number;
|
|
24
24
|
}
|
|
25
|
+
/** One substitution that a lookup can do, with no context. */
|
|
26
|
+
interface SubstitutionRule {
|
|
27
|
+
/** The glyph that the rule replaces. The first glyph of a ligature is this glyph. */
|
|
28
|
+
readonly from: number;
|
|
29
|
+
/** The glyphs that replace it. A multiple substitution can give no glyph. */
|
|
30
|
+
readonly to: readonly number[];
|
|
31
|
+
/** The other glyphs of a ligature, in order. Another rule has no such glyphs. */
|
|
32
|
+
readonly components?: readonly number[];
|
|
33
|
+
}
|
|
25
34
|
/** A lookup of GSUB for one script and one set of features. */
|
|
26
35
|
interface SubstitutionLookup {
|
|
27
36
|
/** The index of the lookup in the lookup list of GSUB. */
|
|
@@ -49,6 +58,12 @@ interface SubstitutionLookup {
|
|
|
49
58
|
* `hb_ot_layout_lookup_would_substitute` with zero context tells it. A context rule with backtrack or lookahead does not apply.
|
|
50
59
|
*/
|
|
51
60
|
wouldApply(glyphs: readonly number[]): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* This function gives the rules of the lookup, and the rules of each lookup that it nests in a context rule. Each lookup
|
|
63
|
+
* has one list, and the list of this lookup is the first. The lists do not tell a context, so each nested rule counts.
|
|
64
|
+
* An alternate substitution gives one rule for each alternate.
|
|
65
|
+
*/
|
|
66
|
+
rules(): readonly (readonly SubstitutionRule[])[];
|
|
52
67
|
}
|
|
53
68
|
/** One axis of `fvar`, in the user units of the axis. */
|
|
54
69
|
interface Axis {
|
|
@@ -80,6 +95,16 @@ interface PairLookup {
|
|
|
80
95
|
readonly skip?: (glyph: number) => boolean;
|
|
81
96
|
/** This function gives the value for a pair, or `undefined` when no subtable applies. */
|
|
82
97
|
pair(first: number, second: number): PairValue | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* This function gives the largest positive value of each glyph of a pair, over the pairs with two glyphs of `glyphs`.
|
|
100
|
+
* A value is at least 0. It uses the values of the instance, so it includes each variation delta.
|
|
101
|
+
*/
|
|
102
|
+
largest(glyphs: ReadonlySet<number>): LargestKerning;
|
|
103
|
+
}
|
|
104
|
+
/** The largest positive kerning of the first glyph and of the second glyph of a pair, in font units. */
|
|
105
|
+
interface LargestKerning {
|
|
106
|
+
readonly first: number;
|
|
107
|
+
readonly second: number;
|
|
83
108
|
}
|
|
84
109
|
/** The options of `readFont`. */
|
|
85
110
|
interface ReadOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"font.d.ts","names":[],"sources":["../../src/fonts/substitution.ts","../../src/fonts/variations.ts","../../src/fonts/kerning.ts","../../src/fonts/font.ts"],"mappings":";;;;;cAQa;;;;;UA6CI;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;WAES;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;;;;;EAMT,MAAM,kBAAkB,kBAAkB;;;;;;EAM1C,WAAW,kBAAkB,OAAO,aAAa,cAAc;;;;;EAK/D,WAAW;;;
|
|
1
|
+
{"version":3,"file":"font.d.ts","names":[],"sources":["../../src/fonts/substitution.ts","../../src/fonts/variations.ts","../../src/fonts/kerning.ts","../../src/fonts/font.ts"],"mappings":";;;;;cAQa;;;;;UA6CI;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;WAES;;;UAIM;;WAEN;;WAEA;;WAEA;;;UAIM;;WAEN;;WAEA;;WAEA;;WAEA;;;;;;EAMT,MAAM,kBAAkB,kBAAkB;;;;;;EAM1C,WAAW,kBAAkB,OAAO,aAAa,cAAc;;;;;EAK/D,WAAW;;;;;;EAMX,4BAA4B;;;UC3Gb;WACN;WACA;WACA;WACA;;;KAIC,WAAW,SAAS;;UCLf;WACN;WACA;;WAEA;;WAEA;;WAEA;;;UAIM;WACN;;;;;WAKA,QAAQ;;EAEjB,KAAK,eAAe,iBAAiB;;;;;EAKrC,QAAQ,QAAQ,sBAAsB;;;UAIvB;WACN;WACA;;;UCvBM;;WAEN,aAAa;;;;;WAKb,WAAW;;;;;WAKX;;;;;WAKA;;;;;WAKA;;;KAIC;;UAGK;;;;;WAKN;WACA;;WAEA,eAAe;;WAEf,UAAU;;WAEV;;WAEA,eAAe;WACf;;EAET,MAAM;;EAEN,QAAQ;;EAER,WAAW;;EAEX,QAAQ,0BAA0B;;EAElC,cAAc,gBAAgB,uCAAuC;;EAErE,GAAG,UAAU,WAAW;;;iBAIV,SAAS,OAAO,YAAY,UAAS,cAAmB;;UA8JvD;;WAEN;;;;;WAKA;;WAEA;;;;;;WAMA;;;;;;WAMA;;;;;WAKA;;;;;WAKA;;;;;WAKA;;;;;;iBAYK,aAAa;;;;;;;iBAuEb,cAAc,MAAM,MAAM,cAAc,UAAS;EAAwB;EAAkB;;;;;;iBAkG3F,aAAa,MAAM,MAAM,cAAc,cAAc,UAAS"}
|