@margoengine/loaders 0.0.0-stage → 1.0.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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +1665 -2
- package/dist/3dm.d.ts +161 -0
- package/dist/3dm.js +289 -0
- package/dist/3ds.d.ts +124 -0
- package/dist/3ds.js +392 -0
- package/dist/acclaim.d.ts +90 -0
- package/dist/acclaim.js +312 -0
- package/dist/amf.d.ts +45 -0
- package/dist/amf.js +256 -0
- package/dist/babylon.d.ts +197 -0
- package/dist/babylon.js +701 -0
- package/dist/common.d.ts +7 -0
- package/dist/common.js +6 -0
- package/dist/crease.d.ts +7 -0
- package/dist/crease.js +67 -0
- package/dist/dae-animation.d.ts +66 -0
- package/dist/dae-animation.js +266 -0
- package/dist/dae-common.d.ts +95 -0
- package/dist/dae-common.js +226 -0
- package/dist/dae-controllers.d.ts +57 -0
- package/dist/dae-controllers.js +164 -0
- package/dist/dae-kinematics.d.ts +65 -0
- package/dist/dae-kinematics.js +461 -0
- package/dist/dae-pose.d.ts +131 -0
- package/dist/dae-pose.js +381 -0
- package/dist/dae-scene.d.ts +203 -0
- package/dist/dae-scene.js +279 -0
- package/dist/dae.d.ts +166 -0
- package/dist/dae.js +644 -0
- package/dist/detect.d.ts +20 -0
- package/dist/detect.js +72 -0
- package/dist/dxf-hatch.d.ts +8 -0
- package/dist/dxf-hatch.js +346 -0
- package/dist/dxf-leaders.d.ts +59 -0
- package/dist/dxf-leaders.js +258 -0
- package/dist/dxf.d.ts +122 -0
- package/dist/dxf.js +985 -0
- package/dist/engine.d.ts +41 -0
- package/dist/engine.js +120 -0
- package/dist/font-opentype.d.ts +14 -0
- package/dist/font-opentype.js +33 -0
- package/dist/font-woff.d.ts +23 -0
- package/dist/font-woff.js +293 -0
- package/dist/font.d.ts +41 -0
- package/dist/font.js +26 -0
- package/dist/gcode.d.ts +92 -0
- package/dist/gcode.js +369 -0
- package/dist/geo-model.d.ts +84 -0
- package/dist/geo-model.js +220 -0
- package/dist/geo-mvt.d.ts +15 -0
- package/dist/geo-mvt.js +302 -0
- package/dist/geo-shp.d.ts +15 -0
- package/dist/geo-shp.js +234 -0
- package/dist/geo-xml.d.ts +6 -0
- package/dist/geo-xml.js +165 -0
- package/dist/geo.d.ts +8 -0
- package/dist/geo.js +59 -0
- package/dist/geometry.d.ts +60 -0
- package/dist/geometry.js +273 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +28 -0
- package/dist/kmz.d.ts +78 -0
- package/dist/kmz.js +173 -0
- package/dist/las.d.ts +92 -0
- package/dist/las.js +110 -0
- package/dist/ldraw.d.ts +118 -0
- package/dist/ldraw.js +474 -0
- package/dist/load.d.ts +72 -0
- package/dist/load.js +205 -0
- package/dist/lottie.d.ts +154 -0
- package/dist/lottie.js +893 -0
- package/dist/lwo.d.ts +81 -0
- package/dist/lwo.js +454 -0
- package/dist/lzf.d.ts +13 -0
- package/dist/lzf.js +56 -0
- package/dist/materialx.d.ts +120 -0
- package/dist/materialx.js +563 -0
- package/dist/md2.d.ts +52 -0
- package/dist/md2.js +112 -0
- package/dist/mmcif.d.ts +14 -0
- package/dist/mmcif.js +246 -0
- package/dist/mmd.d.ts +244 -0
- package/dist/mmd.js +958 -0
- package/dist/mocap.d.ts +71 -0
- package/dist/mocap.js +178 -0
- package/dist/molecule-common.d.ts +4 -0
- package/dist/molecule-common.js +54 -0
- package/dist/mtl.d.ts +125 -0
- package/dist/mtl.js +550 -0
- package/dist/normals.d.ts +7 -0
- package/dist/normals.js +31 -0
- package/dist/nrrd.d.ts +70 -0
- package/dist/nrrd.js +785 -0
- package/dist/nurbs.d.ts +118 -0
- package/dist/nurbs.js +265 -0
- package/dist/obj.d.ts +145 -0
- package/dist/obj.js +462 -0
- package/dist/off.d.ts +10 -0
- package/dist/off.js +155 -0
- package/dist/outline-font.d.ts +87 -0
- package/dist/outline-font.js +110 -0
- package/dist/outline.d.ts +20 -0
- package/dist/outline.js +215 -0
- package/dist/pcd.d.ts +34 -0
- package/dist/pcd.js +258 -0
- package/dist/pdb.d.ts +67 -0
- package/dist/pdb.js +126 -0
- package/dist/ply.d.ts +35 -0
- package/dist/ply.js +392 -0
- package/dist/polygon.d.ts +9 -0
- package/dist/polygon.js +49 -0
- package/dist/prwm.d.ts +24 -0
- package/dist/prwm.js +114 -0
- package/dist/render.d.ts +32 -0
- package/dist/render.js +181 -0
- package/dist/sfnt-cff.d.ts +37 -0
- package/dist/sfnt-cff.js +749 -0
- package/dist/sfnt-layout.d.ts +24 -0
- package/dist/sfnt-layout.js +266 -0
- package/dist/sfnt-reader.d.ts +28 -0
- package/dist/sfnt-reader.js +87 -0
- package/dist/sfnt-variation.d.ts +40 -0
- package/dist/sfnt-variation.js +318 -0
- package/dist/shared/asset-url.js +82 -0
- package/dist/shared/crc32.d.ts +2 -0
- package/dist/shared/crc32.js +47 -0
- package/dist/shared/errors.js +36 -0
- package/dist/shared/inflate.js +284 -0
- package/dist/shared/normals.js +26 -0
- package/dist/shared/scene-scope.js +56 -0
- package/dist/shared/trailing-data.js +45 -0
- package/dist/stl.d.ts +64 -0
- package/dist/stl.js +309 -0
- package/dist/svg.d.ts +90 -0
- package/dist/svg.js +1007 -0
- package/dist/tds.d.ts +2 -0
- package/dist/tds.js +2 -0
- package/dist/textures.d.ts +42 -0
- package/dist/textures.js +53 -0
- package/dist/threemf-beam-reader.d.ts +19 -0
- package/dist/threemf-beam-reader.js +165 -0
- package/dist/threemf-beams.d.ts +52 -0
- package/dist/threemf-beams.js +268 -0
- package/dist/threemf-boolean-read.d.ts +10 -0
- package/dist/threemf-boolean-read.js +113 -0
- package/dist/threemf-boolean.d.ts +59 -0
- package/dist/threemf-boolean.js +20 -0
- package/dist/threemf-csg.d.ts +14 -0
- package/dist/threemf-csg.js +193 -0
- package/dist/threemf-displacement-read.d.ts +8 -0
- package/dist/threemf-displacement-read.js +213 -0
- package/dist/threemf-displacement.d.ts +71 -0
- package/dist/threemf-displacement.js +18 -0
- package/dist/threemf-evaluate.d.ts +36 -0
- package/dist/threemf-evaluate.js +86 -0
- package/dist/threemf-functions.d.ts +33 -0
- package/dist/threemf-functions.js +359 -0
- package/dist/threemf-lattice-mesh.d.ts +9 -0
- package/dist/threemf-lattice-mesh.js +115 -0
- package/dist/threemf-lattice.d.ts +139 -0
- package/dist/threemf-lattice.js +379 -0
- package/dist/threemf-levelset.d.ts +23 -0
- package/dist/threemf-levelset.js +105 -0
- package/dist/threemf-materials.d.ts +162 -0
- package/dist/threemf-materials.js +497 -0
- package/dist/threemf-mesh.d.ts +75 -0
- package/dist/threemf-mesh.js +422 -0
- package/dist/threemf-secure.d.ts +50 -0
- package/dist/threemf-secure.js +153 -0
- package/dist/threemf-tessellate.d.ts +37 -0
- package/dist/threemf-tessellate.js +277 -0
- package/dist/threemf-volume-colour.d.ts +25 -0
- package/dist/threemf-volume-colour.js +233 -0
- package/dist/threemf-volume-sample.d.ts +8 -0
- package/dist/threemf-volume-sample.js +65 -0
- package/dist/threemf-volumetric-read.d.ts +15 -0
- package/dist/threemf-volumetric-read.js +539 -0
- package/dist/threemf-volumetric.d.ts +177 -0
- package/dist/threemf-volumetric.js +28 -0
- package/dist/threemf.d.ts +170 -0
- package/dist/threemf.js +609 -0
- package/dist/tilt.d.ts +62 -0
- package/dist/tilt.js +186 -0
- package/dist/tmx.d.ts +151 -0
- package/dist/tmx.js +394 -0
- package/dist/ttf.d.ts +78 -0
- package/dist/ttf.js +568 -0
- package/dist/types.d.ts +108 -0
- package/dist/types.js +35 -0
- package/dist/usd.d.ts +2 -0
- package/dist/usd.js +2 -0
- package/dist/usd.worker.d.ts +1 -0
- package/dist/usdz.d.ts +50 -0
- package/dist/usdz.js +646 -0
- package/dist/util.d.ts +75 -0
- package/dist/util.js +241 -0
- package/dist/vdb.d.ts +111 -0
- package/dist/vdb.js +663 -0
- package/dist/vrml.d.ts +53 -0
- package/dist/vrml.js +532 -0
- package/dist/vtk-cells.d.ts +29 -0
- package/dist/vtk-cells.js +211 -0
- package/dist/vtk-legacy.d.ts +57 -0
- package/dist/vtk-legacy.js +439 -0
- package/dist/vtk-reader.d.ts +19 -0
- package/dist/vtk-reader.js +134 -0
- package/dist/vtk-xml.d.ts +96 -0
- package/dist/vtk-xml.js +578 -0
- package/dist/vtk.d.ts +13 -0
- package/dist/vtk.js +234 -0
- package/dist/woff-glyf.d.ts +17 -0
- package/dist/woff-glyf.js +215 -0
- package/dist/worker.d.ts +10 -0
- package/dist/worker.js +93 -0
- package/dist/workers/usd.js +3 -0
- package/dist/xfile.d.ts +99 -0
- package/dist/xfile.js +706 -0
- package/dist/xml.d.ts +107 -0
- package/dist/xml.js +843 -0
- package/dist/xyz.d.ts +16 -0
- package/dist/xyz.js +110 -0
- package/dist/zip.d.ts +38 -0
- package/dist/zip.js +150 -0
- package/package.json +289 -4
package/dist/render.js
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { parsePreparedPBR } from '@margoengine/gltf/pbr-model';
|
|
2
|
+
import { SRGBToLinear } from '@margoengine/math/color';
|
|
3
|
+
import { creased } from './crease.js';
|
|
4
|
+
import { splitTriangles, toGeometries } from './geometry.js';
|
|
5
|
+
/**
|
|
6
|
+
* Vertices of one part: gltf/pbr's default `maxPartVertices` (20 MiB of 80-byte vertices, inside every storage binding,
|
|
7
|
+
* the WebGL2 layer's included), so gltf/pbr draws each part as made here instead of splitting it again.
|
|
8
|
+
*/
|
|
9
|
+
const PRIMITIVE_MAX_VERTICES = 262_144;
|
|
10
|
+
import { LoaderError } from './types.js';
|
|
11
|
+
const format = 'Render';
|
|
12
|
+
function range(message) {
|
|
13
|
+
throw new LoaderError(format, 'range', message);
|
|
14
|
+
}
|
|
15
|
+
function unit(value, name) {
|
|
16
|
+
if (!Number.isFinite(value) || value < 0 || value > 1)
|
|
17
|
+
range(`${name} must be finite and in [0,1]`);
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
function attribute(value, length, name, bounded = false) {
|
|
21
|
+
if (value === undefined)
|
|
22
|
+
return;
|
|
23
|
+
if (!(value instanceof Float32Array) || value.length !== length)
|
|
24
|
+
range(`${name} must have ${length} Float32 values`);
|
|
25
|
+
for (const v of value)
|
|
26
|
+
if (!Number.isFinite(v) || (bounded && (v < 0 || v > 1)))
|
|
27
|
+
range(`${name} must contain finite${bounded ? ' [0,1]' : ''} values`);
|
|
28
|
+
}
|
|
29
|
+
/** What makes two groups different parts when vertex colors carry their color: everything but it and their range. */
|
|
30
|
+
const partKey = ({ start: _start, count: _count, color, ...rest }) => JSON.stringify([rest, color?.[3] ?? 1]);
|
|
31
|
+
/** Joins each run of neighboring groups of one {@link partKey} into the first of them, in place. */
|
|
32
|
+
function joinColorGroups(parts) {
|
|
33
|
+
let kept = 0, last = '';
|
|
34
|
+
for (const part of parts) {
|
|
35
|
+
const key = partKey(part);
|
|
36
|
+
if (kept && key === last)
|
|
37
|
+
parts[kept - 1] = { ...parts[kept - 1], count: parts[kept - 1].count + part.count };
|
|
38
|
+
else {
|
|
39
|
+
parts[kept++] = part;
|
|
40
|
+
last = key;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
parts.length = kept;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Renders triangle loader output with exact per-vertex RGB and opacity through optional `gltf/pbr`.
|
|
47
|
+
* Source RGB is sRGB; opacity is linear. Group RGBA supplies only missing vertex channels, independently.
|
|
48
|
+
* Uncovered index ranges render with white/opaque fallback. The explicit material factor multiplies RGBA.
|
|
49
|
+
* Returns the renderer's owned model: dispose it once finished; its existing lifecycle restores GPU resources.
|
|
50
|
+
* The input is never modified. A part past 262,144 vertices (gltf/pbr's default `maxPartVertices`) becomes several primitives of one
|
|
51
|
+
* glTF mesh, split as toGeometries splits (normals seam-free). With vertex colors, neighboring groups that differ in
|
|
52
|
+
* color alone are one part, as their corners already carry it (a scan has a group for almost every color). Point
|
|
53
|
+
* clouds, overlapping groups, more than 4096 parts, or an exceeded packed-data budget are refused before any GPU
|
|
54
|
+
* allocation.
|
|
55
|
+
*/
|
|
56
|
+
export function createPBRMeshes(engine, loaded, options = {}) {
|
|
57
|
+
if (loaded.kind !== 'mesh')
|
|
58
|
+
throw new LoaderError(format, 'unsupported', 'createPBRMeshes requires triangles; use createMeshes for point markers');
|
|
59
|
+
let count = loaded.positions?.length / 3, indices = loaded.indices, opacity = loaded.attributes?.opacity;
|
|
60
|
+
const mode = options.normals ?? 'auto', factor = options.baseColorFactor ?? [1, 1, 1, 1], roughness = unit(options.roughness ?? 0.6, 'roughness'), metalness = unit(options.metalness ?? 0, 'metalness'), maxBytes = options.maxBytes ?? 256 * 1024 * 1024;
|
|
61
|
+
if (!Number.isInteger(count) || count < 3)
|
|
62
|
+
range('positions must contain at least three xyz vertices');
|
|
63
|
+
if (!Number.isSafeInteger(maxBytes) || maxBytes < 1)
|
|
64
|
+
range('maxBytes must be a positive safe integer');
|
|
65
|
+
if (!['auto', 'smooth', 'flat'].includes(mode))
|
|
66
|
+
range('normals must be auto, smooth or flat');
|
|
67
|
+
if (factor.length !== 4)
|
|
68
|
+
range('baseColorFactor must contain four values');
|
|
69
|
+
for (const v of factor)
|
|
70
|
+
unit(v, 'baseColorFactor');
|
|
71
|
+
for (const key of ['doubleSided', 'unlit'])
|
|
72
|
+
if (options[key] !== undefined && typeof options[key] !== 'boolean')
|
|
73
|
+
range(`${key} must be boolean`);
|
|
74
|
+
attribute(loaded.positions, count * 3, 'positions');
|
|
75
|
+
attribute(loaded.normals, count * 3, 'normals');
|
|
76
|
+
attribute(loaded.colors, count * 3, 'colors', true);
|
|
77
|
+
attribute(loaded.uvs, count * 2, 'uvs');
|
|
78
|
+
attribute(opacity, count, 'opacity', true);
|
|
79
|
+
if (!(indices instanceof Uint32Array) || !indices.length || indices.length % 3)
|
|
80
|
+
range('indices must be a nonempty Uint32 triangle list');
|
|
81
|
+
if (indices.byteLength > maxBytes)
|
|
82
|
+
throw new LoaderError(format, 'limit', 'indices alone exceed maxBytes; increase maxBytes or split the asset');
|
|
83
|
+
for (const index of indices)
|
|
84
|
+
if (index >= count)
|
|
85
|
+
range(`index ${index} exceeds the vertex count`);
|
|
86
|
+
if (mode === 'auto') {
|
|
87
|
+
loaded = creased(loaded, options.creaseAngle);
|
|
88
|
+
count = loaded.positions.length / 3;
|
|
89
|
+
indices = loaded.indices;
|
|
90
|
+
opacity = loaded.attributes?.opacity;
|
|
91
|
+
}
|
|
92
|
+
const parts = [];
|
|
93
|
+
let end = 0;
|
|
94
|
+
for (const group of loaded.groups ?? []) {
|
|
95
|
+
const { start, count: size, color } = group;
|
|
96
|
+
if (!Number.isSafeInteger(start) ||
|
|
97
|
+
!Number.isSafeInteger(size) ||
|
|
98
|
+
start < end ||
|
|
99
|
+
size < 0 ||
|
|
100
|
+
start % 3 ||
|
|
101
|
+
size % 3 ||
|
|
102
|
+
start + size > indices.length)
|
|
103
|
+
range('groups must be ordered, non-overlapping triangle ranges inside indices');
|
|
104
|
+
if (color) {
|
|
105
|
+
if (color.length !== 4)
|
|
106
|
+
range('group color must contain four values');
|
|
107
|
+
for (const v of color)
|
|
108
|
+
unit(v, 'group color');
|
|
109
|
+
}
|
|
110
|
+
if (start > end)
|
|
111
|
+
parts.push({ start: end, count: start - end });
|
|
112
|
+
if (size)
|
|
113
|
+
parts.push(group);
|
|
114
|
+
end = start + size;
|
|
115
|
+
}
|
|
116
|
+
if (end < indices.length)
|
|
117
|
+
parts.push({ start: end, count: indices.length - end });
|
|
118
|
+
if (loaded.colors)
|
|
119
|
+
joinColorGroups(parts);
|
|
120
|
+
if (parts.length > 4096)
|
|
121
|
+
throw new LoaderError(format, 'limit', 'more than 4096 parts; merge or split the asset');
|
|
122
|
+
// Count before preparing any renderer resources. The same source order is used by toGeometry's compaction.
|
|
123
|
+
let bytes = 0;
|
|
124
|
+
const chunks = [];
|
|
125
|
+
for (const part of parts) {
|
|
126
|
+
const triangles = indices.subarray(part.start, part.start + part.count), split = splitTriangles(triangles, count, mode === 'flat', PRIMITIVE_MAX_VERTICES).map((r) => triangles.subarray(r.start, r.start + r.count));
|
|
127
|
+
chunks.push(split);
|
|
128
|
+
for (const chunk of split)
|
|
129
|
+
bytes += (mode === 'flat' ? chunk.length : new Set(chunk).size) * 80 + chunk.length * 4;
|
|
130
|
+
if (bytes > maxBytes)
|
|
131
|
+
throw new LoaderError(format, 'limit', `packed geometry needs ${bytes} bytes; increase maxBytes or split the asset`);
|
|
132
|
+
}
|
|
133
|
+
const geometry = [], doc = { asset: { version: '2.0' }, nodes: [], meshes: [], materials: [] };
|
|
134
|
+
for (const [p, part] of parts.entries()) {
|
|
135
|
+
// toGeometries splits the part exactly as splitTriangles did above, so cores[k] is built from chunks[p][k].
|
|
136
|
+
const cores = toGeometries(loaded, { normals: mode, group: part, maxPartVertices: PRIMITIVE_MAX_VERTICES }), primitives = [];
|
|
137
|
+
let transparent = factor[3] < 1;
|
|
138
|
+
for (const [k, core] of cores.entries()) {
|
|
139
|
+
const triangles = chunks[p][k], sources = mode === 'flat' ? triangles : new Set(triangles), vertices = new Float32Array((core.vertices.length / 6) * 20);
|
|
140
|
+
let target = 0;
|
|
141
|
+
for (const source of sources) {
|
|
142
|
+
const o = target * 20, c = source * 3, uv = source * 2, fallback = part.color;
|
|
143
|
+
vertices.set(core.vertices.subarray(target * 6, target * 6 + 3), o);
|
|
144
|
+
vertices[o + 3] = 1;
|
|
145
|
+
vertices.set(core.vertices.subarray(target * 6 + 3, target * 6 + 6), o + 4);
|
|
146
|
+
if (loaded.uvs)
|
|
147
|
+
vertices.set(loaded.uvs.subarray(uv, uv + 2), o + 12);
|
|
148
|
+
for (let j = 0; j < 3; j++)
|
|
149
|
+
vertices[o + 16 + j] = SRGBToLinear(loaded.colors?.[c + j] ?? fallback?.[j] ?? 1);
|
|
150
|
+
const alpha = opacity?.[source] ?? fallback?.[3] ?? 1;
|
|
151
|
+
vertices[o + 19] = alpha;
|
|
152
|
+
transparent ||= alpha < 1;
|
|
153
|
+
target++;
|
|
154
|
+
}
|
|
155
|
+
primitives.push({ vertices, indices: core.indices });
|
|
156
|
+
}
|
|
157
|
+
const index = geometry.length;
|
|
158
|
+
geometry.push(primitives);
|
|
159
|
+
doc.nodes.push({ mesh: index, name: part.name });
|
|
160
|
+
doc.meshes.push({ primitives: primitives.map(() => ({ attributes: {}, material: index })) });
|
|
161
|
+
doc.materials.push({
|
|
162
|
+
name: part.name,
|
|
163
|
+
pbrMetallicRoughness: { baseColorFactor: [...factor], roughnessFactor: roughness, metallicFactor: metalness },
|
|
164
|
+
alphaMode: transparent ? 'BLEND' : 'OPAQUE',
|
|
165
|
+
doubleSided: options.doubleSided ?? true,
|
|
166
|
+
...(options.unlit ? { extensions: { KHR_materials_unlit: {} } } : {}),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
if (options.unlit)
|
|
170
|
+
doc.extensionsUsed = ['KHR_materials_unlit'];
|
|
171
|
+
const model = parsePreparedPBR(engine, doc, geometry, [], { maxNodes: 4096 });
|
|
172
|
+
try {
|
|
173
|
+
if (options.parent)
|
|
174
|
+
model.root.setParent(options.parent);
|
|
175
|
+
return model;
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
model.dispose();
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { OutlineCommand } from './outline.js';
|
|
2
|
+
import { BinaryReader } from './sfnt-reader.js';
|
|
3
|
+
/**
|
|
4
|
+
* The CFF (`'CFF '`, name-keyed or CID-keyed) or CFF2 outlines of one font. `commands(glyph)` runs the glyph's Type 2 charstring (blends at the
|
|
5
|
+
* font's variation coordinates for CFF2) into move, line and cubic commands in font units: the FontMatrix (and a
|
|
6
|
+
* CFF2 Font DICT's own matrix) times units per em.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CFFOutlines {
|
|
9
|
+
private readonly cff2;
|
|
10
|
+
private readonly glyphCount;
|
|
11
|
+
private readonly unitsPerEm;
|
|
12
|
+
private readonly coordinates;
|
|
13
|
+
private readonly charStrings;
|
|
14
|
+
private readonly globalSubrs;
|
|
15
|
+
private localSubrs;
|
|
16
|
+
private charset;
|
|
17
|
+
private matrix;
|
|
18
|
+
private store?;
|
|
19
|
+
private cid;
|
|
20
|
+
private fontDicts;
|
|
21
|
+
private select;
|
|
22
|
+
constructor(r: BinaryReader, cff2: boolean, glyphCount: number, unitsPerEm: number, coordinates: readonly number[]);
|
|
23
|
+
/** Font units of a font matrix: the matrix times units per em. */
|
|
24
|
+
private scaled;
|
|
25
|
+
private parseCFF2;
|
|
26
|
+
private parseCFF;
|
|
27
|
+
/** The local subroutines and default `vsindex` of the Private DICT a Top or Font DICT points to, if any. */
|
|
28
|
+
private privateDict;
|
|
29
|
+
/** The Font DICT of every glyph: FDSelect formats 0 and 3, and CFF2's 32-bit format 4. */
|
|
30
|
+
private readFDSelect;
|
|
31
|
+
private readIndex;
|
|
32
|
+
private parseDict;
|
|
33
|
+
/** The glyph's outline in font units: one `'M'` per contour, `'L'` and `'C'` segments, `'Z'` at each close. */
|
|
34
|
+
commands(glyph: number): OutlineCommand[];
|
|
35
|
+
/** Charstring space commands of one glyph; `component` marks a `seac`-style endchar accent or base. */
|
|
36
|
+
private raw;
|
|
37
|
+
}
|