@ot-builder/io-bin-cff
Advanced tools
@@ -1,3 +0,3 @@ | ||
| import { BinaryView, Read } from "@ot-builder/bin-util"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import type { BinaryView, Read } from "@ot-builder/bin-util"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| export type CffIndexItemReadContext = [CffReadContext, number, number]; | ||
@@ -4,0 +4,0 @@ export declare class CffReadIndex<T> implements Read<T[], [CffReadContext]> { |
@@ -1,2 +0,2 @@ | ||
| import { CffReadContext } from "../context/read"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| export declare const CffDeferIndex: { | ||
@@ -3,0 +3,0 @@ read(view: import("@ot-builder/bin-util").BinaryView, ctx: CffReadContext): { |
@@ -1,3 +0,3 @@ | ||
| import { Frag, Write } from "@ot-builder/bin-util"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import { Frag, type Write } from "@ot-builder/bin-util"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| export type CffIndexItemWriteContext = [CffWriteContext, number]; | ||
@@ -4,0 +4,0 @@ export declare class CffWriteIndex<T> implements Write<readonly T[], [CffWriteContext]> { |
@@ -1,4 +0,4 @@ | ||
| import { OtVar } from "@ot-builder/variance"; | ||
| import type { OtVar } from "@ot-builder/variance"; | ||
| import { CffStackMachine } from "../../interp/stack-machine"; | ||
| import { CffCharStringInterpState } from "./interpreter"; | ||
| import type { CffCharStringInterpState } from "./interpreter"; | ||
| export declare class CffCharStringInterpStateImpl extends CffStackMachine implements CffCharStringInterpState { | ||
@@ -5,0 +5,0 @@ getRandom(): number; |
| import { OtVar } from "@ot-builder/variance"; | ||
| import * as CffInterp from "../../interp/ir"; | ||
| import { CffStackMachine } from "../../interp/stack-machine"; | ||
| import type { CffStackMachine } from "../../interp/stack-machine"; | ||
| export interface CffCharStringInterpState { | ||
@@ -5,0 +5,0 @@ getRandom(): number; |
@@ -7,6 +7,7 @@ "use strict"; | ||
| exports.computeSubroutineBias = computeSubroutineBias; | ||
| const tslib_1 = require("tslib"); | ||
| const bin_util_1 = require("@ot-builder/bin-util"); | ||
| const errors_1 = require("@ot-builder/errors"); | ||
| const variance_1 = require("@ot-builder/variance"); | ||
| const CffInterp = require("../../interp/ir"); | ||
| const CffInterp = tslib_1.__importStar(require("../../interp/ir")); | ||
| const ir_source_1 = require("../../interp/ir-source"); | ||
@@ -28,4 +29,2 @@ const operator_1 = require("../../interp/operator"); | ||
| } | ||
| // Justification: This is a dispatch table and does not contain substantial complexity | ||
| // eslint-disable-next-line complexity | ||
| doOperator(opCode) { | ||
@@ -227,5 +226,3 @@ this.state.log += operator_1.CharStringOperator[opCode] + " "; | ||
| } | ||
| { | ||
| this.sink.curveTo(args[args.length - 6], args[args.length - 5], args[args.length - 4], args[args.length - 3], args[args.length - 2], args[args.length - 1]); | ||
| } | ||
| this.sink.curveTo(args[args.length - 6], args[args.length - 5], args[args.length - 4], args[args.length - 3], args[args.length - 2], args[args.length - 1]); | ||
| } | ||
@@ -232,0 +229,0 @@ doVVCurveTo(args) { |
| import { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { OtVar } from "@ot-builder/variance"; | ||
| import { CffCharStringDataSink } from "./interpreter"; | ||
| import type { CffCharStringDataSink } from "./interpreter"; | ||
| export declare class CffGlyphBuilder implements CffCharStringDataSink { | ||
@@ -5,0 +5,0 @@ readonly glyph: OtGlyph; |
@@ -1,3 +0,3 @@ | ||
| import { CffReadContext } from "../../context/read"; | ||
| import { CffWriteContext } from "../../context/write"; | ||
| import type { CffReadContext } from "../../context/read"; | ||
| import type { CffWriteContext } from "../../context/write"; | ||
| export declare const CffSubroutineIndex: { | ||
@@ -4,0 +4,0 @@ write(target: import("@ot-builder/bin-util").Frag, t: Buffer<ArrayBufferLike>[], ctx: CffWriteContext): void; |
@@ -1,5 +0,5 @@ | ||
| import { Cff, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { CffWriteContext } from "../../context/write"; | ||
| import { type Cff, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { CffWriteContext } from "../../context/write"; | ||
| import { CffDrawCall } from "./draw-call"; | ||
| export declare function codeGenGlyph(wCtx: CffWriteContext, gid: number, glyph: OtGlyph, pd?: Cff.PrivateDict): CffDrawCall[]; | ||
| //# sourceMappingURL=draw-call-gen.d.ts.map |
@@ -65,4 +65,4 @@ "use strict"; | ||
| this.maskPr.index += knot; | ||
| while (this.maskIndex < this.masks.length && | ||
| ot_glyphs_1.OtGlyph.PointRef.compare(this.masks[this.maskIndex].at, this.maskPr) <= 0) { | ||
| while (this.maskIndex < this.masks.length | ||
| && ot_glyphs_1.OtGlyph.PointRef.compare(this.masks[this.maskIndex].at, this.maskPr) <= 0) { | ||
| const mask = this.masks[this.maskIndex]; | ||
@@ -74,7 +74,7 @@ this.maskIndex += 1; | ||
| addMask(mask) { | ||
| if (this.rawDrawCalls.length && | ||
| (this.rawDrawCalls[this.rawDrawCalls.length - 1].operator === | ||
| operator_1.CharStringOperator.VStem || | ||
| this.rawDrawCalls[this.rawDrawCalls.length - 1].operator === | ||
| operator_1.CharStringOperator.VStemHM)) { | ||
| if (this.rawDrawCalls.length | ||
| && (this.rawDrawCalls[this.rawDrawCalls.length - 1].operator | ||
| === operator_1.CharStringOperator.VStem | ||
| || this.rawDrawCalls[this.rawDrawCalls.length - 1].operator | ||
| === operator_1.CharStringOperator.VStemHM)) { | ||
| this.rawDrawCalls[this.rawDrawCalls.length - 1] = { | ||
@@ -81,0 +81,0 @@ args: this.rawDrawCalls[this.rawDrawCalls.length - 1].args, |
@@ -1,3 +0,3 @@ | ||
| import { CffWriteContext } from "../../../context/write"; | ||
| import { CffBlendPrimitive, CffDrawCall } from "../draw-call"; | ||
| import type { CffWriteContext } from "../../../context/write"; | ||
| import type { CffBlendPrimitive, CffDrawCall } from "../draw-call"; | ||
| export declare function argIsZero(x: number | CffBlendPrimitive): boolean; | ||
@@ -4,0 +4,0 @@ export declare abstract class DrawCallOptimizationPass<State> { |
@@ -1,5 +0,5 @@ | ||
| import { CffWriteContext } from "../../../context/write"; | ||
| import { DrawCallOptimizationPass } from "./general"; | ||
| import type { CffWriteContext } from "../../../context/write"; | ||
| import type { DrawCallOptimizationPass } from "./general"; | ||
| export declare function StandardDrawCallOptimizers(ctx: CffWriteContext): DrawCallOptimizationPass<unknown>[]; | ||
| export declare function MinimalDrawCallOptimizers(ctx: CffWriteContext): DrawCallOptimizationPass<unknown>[]; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,4 +0,4 @@ | ||
| import { WriteTimeIVD } from "@ot-builder/var-store"; | ||
| import type { WriteTimeIVD } from "@ot-builder/var-store"; | ||
| import { OtVar } from "@ot-builder/variance"; | ||
| import { CffWriteContext } from "../../context/write"; | ||
| import type { CffWriteContext } from "../../context/write"; | ||
| import { Mir } from "./mir"; | ||
@@ -5,0 +5,0 @@ export declare class CffDrawCallRawT<X> { |
@@ -120,3 +120,3 @@ "use strict"; | ||
| }; | ||
| return this.seqFromRawSeqImpl(ctx, eo, from); | ||
| return CffDrawCall.seqFromRawSeqImpl(ctx, eo, from); | ||
| } | ||
@@ -130,3 +130,3 @@ static dictStringSeqFromRawSeq(ctx, from) { | ||
| }; | ||
| return this.seqFromRawSeqImpl(ctx, eo, from); | ||
| return CffDrawCall.seqFromRawSeqImpl(ctx, eo, from); | ||
| } | ||
@@ -194,9 +194,9 @@ // DC to Mir conversion | ||
| willOverflow(x) { | ||
| return (this.sp + | ||
| 1 + | ||
| this.pendingBlendDeltas.length + | ||
| this.pendingBlendOrigins.length + | ||
| 1 + | ||
| x.deltas.length >= | ||
| this.eo.maxStack); | ||
| return (this.sp | ||
| + 1 | ||
| + this.pendingBlendDeltas.length | ||
| + this.pendingBlendOrigins.length | ||
| + 1 | ||
| + x.deltas.length | ||
| >= this.eo.maxStack); | ||
| } | ||
@@ -215,4 +215,4 @@ flush() { | ||
| stackRidge: 0, | ||
| stackRise: this.pendingBlendOrigins.length - | ||
| (1 + this.pendingBlendOrigins.length + this.pendingBlendDeltas.length) | ||
| stackRise: this.pendingBlendOrigins.length | ||
| - (1 + this.pendingBlendOrigins.length + this.pendingBlendDeltas.length) | ||
| }); | ||
@@ -219,0 +219,0 @@ this.sp += this.pendingBlendOrigins.length; |
@@ -1,3 +0,3 @@ | ||
| import { Frag } from "@ot-builder/bin-util"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import type { Frag } from "@ot-builder/bin-util"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import * as CffInterp from "../../interp/ir"; | ||
@@ -4,0 +4,0 @@ export declare class CharStringEncoder extends CffInterp.Encoder<Frag> { |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.CharStringEncoder = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const primitive_1 = require("@ot-builder/primitive"); | ||
| const CffInterp = require("../../interp/ir"); | ||
| const CffInterp = tslib_1.__importStar(require("../../interp/ir")); | ||
| const EPSILON = 1 / 0x20000; | ||
@@ -7,0 +8,0 @@ class CharStringEncoder extends CffInterp.Encoder { |
@@ -1,3 +0,3 @@ | ||
| import { CharStringGlobalOptimizerFactory } from "./general"; | ||
| import type { CharStringGlobalOptimizerFactory } from "./general"; | ||
| export declare const CharStringGlobalOptEmptyImplFactory: CharStringGlobalOptimizerFactory; | ||
| //# sourceMappingURL=empty-impl.d.ts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.CharStringGlobalOptEmptyImplFactory = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const bin_util_1 = require("@ot-builder/bin-util"); | ||
| const CffInterp = require("../../../interp/ir"); | ||
| const CffInterp = tslib_1.__importStar(require("../../../interp/ir")); | ||
| const operator_1 = require("../../../interp/operator"); | ||
@@ -7,0 +8,0 @@ const encoder_1 = require("../encoder"); |
@@ -1,3 +0,3 @@ | ||
| import { CffWriteContext } from "../../../context/write"; | ||
| import { Mir } from "../mir"; | ||
| import type { CffWriteContext } from "../../../context/write"; | ||
| import type { Mir } from "../mir"; | ||
| export interface CharStringGlobalOptimizeResult { | ||
@@ -4,0 +4,0 @@ globalSubroutines: Buffer[]; |
@@ -1,6 +0,6 @@ | ||
| import { CffLimits } from "../../../../context/write"; | ||
| import { Mir, MirNonTerminal } from "../../mir"; | ||
| import { SubroutineAnalyzer, SubroutineAnalyzerFactory } from "../subr/general"; | ||
| import { NTRuleStub, Rule, RuleSet } from "../subr/rule-set"; | ||
| import { NonTerminalBuilder, RuleBuilder } from "./pairing"; | ||
| import type { CffLimits } from "../../../../context/write"; | ||
| import { Mir, type MirNonTerminal } from "../../mir"; | ||
| import type { SubroutineAnalyzer, SubroutineAnalyzerFactory } from "../subr/general"; | ||
| import { NTRuleStub, Rule, type RuleSet } from "../subr/rule-set"; | ||
| import { type NonTerminalBuilder, type RuleBuilder } from "./pairing"; | ||
| export declare class PairingAnalyzer implements NonTerminalBuilder<Mir>, RuleBuilder<Mir, NTRuleStub, Rule>, SubroutineAnalyzer { | ||
@@ -7,0 +7,0 @@ private pairSession; |
@@ -1,4 +0,4 @@ | ||
| import { Mir } from "../../mir"; | ||
| import { KeyProvider } from "./pairing"; | ||
| import { type Mir } from "../../mir"; | ||
| import type { KeyProvider } from "./pairing"; | ||
| export declare const MirKeyProvider: KeyProvider<Mir>; | ||
| //# sourceMappingURL=ir-key-provider.d.ts.map |
@@ -101,3 +101,3 @@ "use strict"; | ||
| const dig = this.digraphMap.get(digKey); | ||
| if (!dig || !dig.count) { | ||
| if (!(dig === null || dig === void 0 ? void 0 : dig.count)) { | ||
| // Create a new digraph link | ||
@@ -104,0 +104,0 @@ const dig = new Digraph(digKey, rFirst); |
@@ -1,4 +0,4 @@ | ||
| import { CffLimits } from "../../../../context/write"; | ||
| import { Mir } from "../../mir"; | ||
| import { RuleSet } from "./rule-set"; | ||
| import type { CffLimits } from "../../../../context/write"; | ||
| import type { Mir } from "../../mir"; | ||
| import type { RuleSet } from "./rule-set"; | ||
| export interface SubroutineAnalyzer { | ||
@@ -5,0 +5,0 @@ addInput(limits: CffLimits, mirSeq: Iterable<Mir>): void; |
@@ -1,3 +0,3 @@ | ||
| import { CffLimits } from "../../../../context/write"; | ||
| import { Mir, MirNonTerminal } from "../../mir"; | ||
| import type { CffLimits } from "../../../../context/write"; | ||
| import { type Mir, type MirNonTerminal } from "../../mir"; | ||
| export declare class Rule { | ||
@@ -4,0 +4,0 @@ parts: Mir[]; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.RuleSet = exports.NTRuleStub = exports.Rule = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const bin_util_1 = require("@ot-builder/bin-util"); | ||
| const errors_1 = require("@ot-builder/errors"); | ||
| const CffInterp = require("../../../../interp/ir"); | ||
| const CffInterp = tslib_1.__importStar(require("../../../../interp/ir")); | ||
| const operator_1 = require("../../../../interp/operator"); | ||
@@ -16,4 +17,4 @@ const interpreter_1 = require("../../../read/interpreter"); | ||
| const bias = (0, interpreter_1.computeSubroutineBias)(scEst); | ||
| const size = encoder_1.CharStringEncoder.measureOperator(operator_1.CharStringOperator.CallGSubr) + | ||
| Math.max(encoder_1.CharStringEncoder.measureInt(-bias), encoder_1.CharStringEncoder.measureInt(0), encoder_1.CharStringEncoder.measureInt(scEst - bias)); | ||
| const size = encoder_1.CharStringEncoder.measureOperator(operator_1.CharStringOperator.CallGSubr) | ||
| + Math.max(encoder_1.CharStringEncoder.measureInt(-bias), encoder_1.CharStringEncoder.measureInt(0), encoder_1.CharStringEncoder.measureInt(scEst - bias)); | ||
| callSizeCache[scEst] = size; | ||
@@ -151,6 +152,6 @@ return size; | ||
| const utility = rule.utility(limits, scEst, refCount); | ||
| if (sid < scEst * 2 && | ||
| sid < limits.maxSubrs && | ||
| depth < limits.maxRecursion && | ||
| utility >= 0) { | ||
| if (sid < scEst * 2 | ||
| && sid < limits.maxSubrs | ||
| && depth < limits.maxRecursion | ||
| && utility >= 0) { | ||
| rule.subrId = sid++; | ||
@@ -316,4 +317,4 @@ } | ||
| ruleHeaderStart(rule, header) { | ||
| return (`${header} :: DE ${rule.depth} ` + | ||
| `RC ${rule.refCount} SS ${rule.selfSize} XS ${rule.expandedSize} :: `); | ||
| return (`${header} :: DE ${rule.depth} ` | ||
| + `RC ${rule.refCount} SS ${rule.selfSize} XS ${rule.expandedSize} :: `); | ||
| } | ||
@@ -320,0 +321,0 @@ printPlan() { |
@@ -1,3 +0,3 @@ | ||
| import { CharStringGlobalOptimizerFactory } from "./general"; | ||
| import type { CharStringGlobalOptimizerFactory } from "./general"; | ||
| export declare const CharStringGlobalOptSubrFactory: CharStringGlobalOptimizerFactory; | ||
| //# sourceMappingURL=subroutine-analyze.d.ts.map |
@@ -1,2 +0,2 @@ | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import * as CffInterp from "../../interp/ir"; | ||
@@ -3,0 +3,0 @@ export declare enum MirType { |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Mir = exports.MirType = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const errors_1 = require("@ot-builder/errors"); | ||
| const CffInterp = require("../../interp/ir"); | ||
| const CffInterp = tslib_1.__importStar(require("../../interp/ir")); | ||
| const operator_1 = require("../../interp/operator"); | ||
@@ -7,0 +8,0 @@ var MirType; |
@@ -1,4 +0,4 @@ | ||
| import { CffWriteContext } from "../../context/write"; | ||
| import { CffDrawCallRaw } from "./draw-call"; | ||
| import { DrawCallOptimizationPass } from "./draw-call-optimize/general"; | ||
| import type { CffWriteContext } from "../../context/write"; | ||
| import { type CffDrawCallRaw } from "./draw-call"; | ||
| import { type DrawCallOptimizationPass } from "./draw-call-optimize/general"; | ||
| import { Mir } from "./mir"; | ||
@@ -5,0 +5,0 @@ export declare function TestRawDcOptimize(ctx: CffWriteContext, passes: DrawCallOptimizationPass<unknown>[], original: CffDrawCallRaw[], optimized: string): void; |
@@ -1,5 +0,5 @@ | ||
| import { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffCharSetSink } from "./io"; | ||
| import type { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffCharSetSink } from "./io"; | ||
| export declare class CffGlyphNaming<G extends OtGlyph> implements Data.Naming.Source<G> { | ||
@@ -6,0 +6,0 @@ private mapping; |
@@ -1,5 +0,5 @@ | ||
| import { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import { CffCharSetDataSource } from "./io"; | ||
| import type { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| import type { CffCharSetDataSource } from "./io"; | ||
| export declare class CffGlyphNameCharSetSource implements CffCharSetDataSource { | ||
@@ -12,8 +12,7 @@ private readonly ctx; | ||
| export declare class CffCidCharSetSource implements CffCharSetDataSource { | ||
| private readonly ctx; | ||
| private readonly gOrd; | ||
| private readonly cidMap; | ||
| constructor(ctx: CffWriteContext, gOrd: Data.Order<OtGlyph>, cidMap: Data.Maybe<Map<number, OtGlyph>>); | ||
| constructor(gOrd: Data.Order<OtGlyph>, cidMap: Data.Maybe<Map<number, OtGlyph>>); | ||
| getMappingList(): number[]; | ||
| } | ||
| //# sourceMappingURL=glyph-data-source.d.ts.map |
@@ -22,4 +22,3 @@ "use strict"; | ||
| class CffCidCharSetSource { | ||
| constructor(ctx, gOrd, cidMap) { | ||
| this.ctx = ctx; | ||
| constructor(gOrd, cidMap) { | ||
| this.gOrd = gOrd; | ||
@@ -26,0 +25,0 @@ this.cidMap = cidMap; |
| import { Frag } from "@ot-builder/bin-util"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| export interface CffCharSetDataSource { | ||
@@ -5,0 +5,0 @@ getMappingList(): readonly number[]; |
@@ -1,5 +0,5 @@ | ||
| import { BinaryView } from "@ot-builder/bin-util"; | ||
| import { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { ReadTimeIVS } from "@ot-builder/var-store"; | ||
| import type { BinaryView } from "@ot-builder/bin-util"; | ||
| import type { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { ReadTimeIVS } from "@ot-builder/var-store"; | ||
| import { CffGlyphNaming } from "../charset/glyph-data-sink"; | ||
@@ -6,0 +6,0 @@ import { CffStringSource } from "../strings/source"; |
| import { OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import { WriteTimeIVS } from "@ot-builder/var-store"; | ||
@@ -4,0 +4,0 @@ import { CffStringSink } from "../strings/sink"; |
@@ -1,5 +0,5 @@ | ||
| import { Frag } from "@ot-builder/bin-util"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { type Frag } from "@ot-builder/bin-util"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import * as CffInterp from "../interp/ir"; | ||
| import { CffOperator } from "../interp/operator"; | ||
| import type { CffOperator } from "../interp/operator"; | ||
| export declare class DictEncoder extends CffInterp.Encoder<Frag> { | ||
@@ -6,0 +6,0 @@ private frag; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.DictEncoder = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const bin_util_1 = require("@ot-builder/bin-util"); | ||
| const CffInterp = require("../interp/ir"); | ||
| const CffInterp = tslib_1.__importStar(require("../interp/ir")); | ||
| const EPSILON = 1e-8; | ||
@@ -7,0 +8,0 @@ const ZERO = "0".charCodeAt(0); |
| import { Frag } from "@ot-builder/bin-util"; | ||
| import { Cff } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import { CffDrawCallRaw } from "../char-string/write/draw-call"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import { DictEncoder } from "./encoder"; | ||
| import { CffDictDataCollector, CffDictInterpreter, CffDictInterpreterBase } from "./general"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| import type { DictEncoder } from "./encoder"; | ||
| import { CffDictDataCollector, type CffDictInterpreter, CffDictInterpreterBase } from "./general"; | ||
| export declare class CffFontDictInterpreterBase extends CffDictInterpreterBase { | ||
@@ -22,4 +22,4 @@ protected ctx: CffReadContext; | ||
| private emitString; | ||
| collectDrawCalls(pd: Cff.FontDict, ctx: CffWriteContext, rest: void): Generator<CffDrawCallRaw, void, unknown>; | ||
| processPointers(encoder: DictEncoder, fd: Cff.FontDict, ctx: CffWriteContext, rest: void): void; | ||
| collectDrawCalls(pd: Cff.FontDict, ctx: CffWriteContext, rest: undefined): Generator<CffDrawCallRaw, void, unknown>; | ||
| processPointers(encoder: DictEncoder, fd: Cff.FontDict, ctx: CffWriteContext, rest: undefined): void; | ||
| } | ||
@@ -26,0 +26,0 @@ export declare const CffFontDictIo: { |
@@ -26,4 +26,2 @@ "use strict"; | ||
| } | ||
| // Justification: This is a dispatch table and does not contain substantial complexity | ||
| // eslint-disable-next-line complexity | ||
| doOperator(opCode, flags) { | ||
@@ -30,0 +28,0 @@ switch (opCode) { |
@@ -1,7 +0,7 @@ | ||
| import { BinaryView, Read, Write } from "@ot-builder/bin-util"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { ReadTimeIVS } from "@ot-builder/var-store"; | ||
| import { CffDrawCallRaw } from "../char-string/write/draw-call"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import { type BinaryView, Read, Write } from "@ot-builder/bin-util"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { ReadTimeIVS } from "@ot-builder/var-store"; | ||
| import { type CffDrawCallRaw } from "../char-string/write/draw-call"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| import * as CffInterp from "../interp/ir"; | ||
@@ -8,0 +8,0 @@ import { CffStackMachine } from "../interp/stack-machine"; |
@@ -6,6 +6,7 @@ "use strict"; | ||
| exports.CffDictWriteT = CffDictWriteT; | ||
| const tslib_1 = require("tslib"); | ||
| const bin_util_1 = require("@ot-builder/bin-util"); | ||
| const draw_call_1 = require("../char-string/write/draw-call"); | ||
| const mir_1 = require("../char-string/write/mir"); | ||
| const CffInterp = require("../interp/ir"); | ||
| const CffInterp = tslib_1.__importStar(require("../interp/ir")); | ||
| const ir_source_1 = require("../interp/ir-source"); | ||
@@ -25,3 +26,3 @@ const stack_machine_1 = require("../interp/stack-machine"); | ||
| function CffDictReadT(interpFactory) { | ||
| return (0, bin_util_1.Read)(function (view, ctx, dictSize) { | ||
| return (0, bin_util_1.Read)((view, ctx, dictSize) => { | ||
| const interp = interpFactory(view, ctx); | ||
@@ -28,0 +29,0 @@ const irSource = new ir_source_1.CffDictIrSource(view, dictSize); |
@@ -1,5 +0,5 @@ | ||
| import { BinaryView, Frag } from "@ot-builder/bin-util"; | ||
| import { type BinaryView, Frag } from "@ot-builder/bin-util"; | ||
| import { Cff } from "@ot-builder/ot-glyphs"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| export declare const CffPrivateDictIo: { | ||
@@ -6,0 +6,0 @@ write(target: Frag, t: Cff.PrivateDict, ctx: CffWriteContext, rest: void): void; |
@@ -19,4 +19,2 @@ "use strict"; | ||
| } | ||
| // Justification: This is a dispatch table and does not contain substantial complexity | ||
| // eslint-disable-next-line complexity | ||
| doOperator(opCode, flags) { | ||
@@ -23,0 +21,0 @@ switch (opCode) { |
@@ -1,10 +0,10 @@ | ||
| import { BinaryView, Frag } from "@ot-builder/bin-util"; | ||
| import { type BinaryView, type Frag } from "@ot-builder/bin-util"; | ||
| import { Cff } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import { CffDrawCallRaw } from "../char-string/write/draw-call"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import { DictEncoder } from "./encoder"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| import type { DictEncoder } from "./encoder"; | ||
| import { CffFontDictDataCollector, CffFontDictInterpreterBase } from "./font-dict"; | ||
| import { CffDictDataCollector, CffDictInterpreter } from "./general"; | ||
| import { CffDictDataCollector, type CffDictInterpreter } from "./general"; | ||
| export declare class CffTopDictInterpreter extends CffFontDictInterpreterBase implements CffDictInterpreter<CffTopDictRead> { | ||
@@ -18,4 +18,4 @@ constructor(ctx: CffReadContext); | ||
| fdDC: CffFontDictDataCollector; | ||
| collectDrawCalls(td: CffTopDictWrite, ctx: CffWriteContext, rest: void): Generator<CffDrawCallRaw, void, unknown>; | ||
| processPointers(encoder: DictEncoder, td: CffTopDictWrite, ctx: CffWriteContext, rest: void): void; | ||
| collectDrawCalls(td: CffTopDictWrite, ctx: CffWriteContext, rest: undefined): Generator<CffDrawCallRaw, void, unknown>; | ||
| processPointers(encoder: DictEncoder, td: CffTopDictWrite, ctx: CffWriteContext, rest: undefined): void; | ||
| } | ||
@@ -44,3 +44,3 @@ export declare class CffTopDictRead { | ||
| export declare const CffTopDictIo: { | ||
| write(target: Frag, t: CffTopDictWrite, ctx: CffWriteContext, rest: void): void; | ||
| write(target: Frag, t: CffTopDictWrite, ctx: CffWriteContext, rest: undefined): void; | ||
| read(view: BinaryView, ctx: CffReadContext, dictSize: number): CffTopDictRead; | ||
@@ -47,0 +47,0 @@ }; |
@@ -1,3 +0,3 @@ | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { CffFdSelectSink } from "./io"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { CffFdSelectSink } from "./io"; | ||
| export declare class CffGlyphFdSelectSink<G> implements CffFdSelectSink { | ||
@@ -4,0 +4,0 @@ private glyphs; |
@@ -1,4 +0,4 @@ | ||
| import { Frag } from "@ot-builder/bin-util"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import { type Frag } from "@ot-builder/bin-util"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| export interface CffFdSelectSink { | ||
@@ -5,0 +5,0 @@ getGlyphCount(): number; |
@@ -1,2 +0,2 @@ | ||
| import { BinaryView } from "@ot-builder/bin-util"; | ||
| import type { BinaryView } from "@ot-builder/bin-util"; | ||
| import * as CffInterp from "./ir"; | ||
@@ -3,0 +3,0 @@ declare abstract class BinaryIrSource implements CffInterp.IrSource { |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.CharStringIrSource = exports.CffDictIrSource = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const errors_1 = require("@ot-builder/errors"); | ||
| const primitive_1 = require("@ot-builder/primitive"); | ||
| const CffInterp = require("./ir"); | ||
| const CffInterp = tslib_1.__importStar(require("./ir")); | ||
| class BinaryIrSource { | ||
@@ -49,3 +50,3 @@ constructor(rawView, size) { | ||
| let s = ""; | ||
| // prettier-ignore | ||
| // biome-ignore format: keep simple | ||
| const chars = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ".", "e", "e-", "reserved", "-", "endOfNumber"]; | ||
@@ -52,0 +53,0 @@ for (let nibIndex = 0; nibIndex < nibs.length; nibIndex++) { |
@@ -1,2 +0,2 @@ | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| export type Operator = { | ||
@@ -3,0 +3,0 @@ opCode: number; |
+0
-1
@@ -8,3 +8,2 @@ "use strict"; | ||
| function isOperator(ir) { | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| return ir.opCode !== undefined; | ||
@@ -11,0 +10,0 @@ } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.CharStringOperator = exports.CffOperator = void 0; | ||
| // prettier-ignore | ||
| // biome-ignore format: keep matrix layout | ||
| var CffOperator; | ||
@@ -68,3 +68,3 @@ (function (CffOperator) { | ||
| })(CffOperator || (exports.CffOperator = CffOperator = {})); | ||
| // prettier-ignore | ||
| // biome-ignore format: keep matrix layout | ||
| var CharStringOperator; | ||
@@ -71,0 +71,0 @@ (function (CharStringOperator) { |
@@ -1,3 +0,3 @@ | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { ReadTimeIVD, ReadTimeIVS } from "@ot-builder/var-store"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { ReadTimeIVD, ReadTimeIVS } from "@ot-builder/var-store"; | ||
| import { OtVar } from "@ot-builder/variance"; | ||
@@ -9,3 +9,2 @@ export declare class CffStackMachine { | ||
| vms: OtVar.MasterSet; | ||
| private varCreator; | ||
| constructor(ivs?: Data.Maybe<ReadTimeIVS>); | ||
@@ -12,0 +11,0 @@ stackHeight(): number; |
@@ -12,3 +12,2 @@ "use strict"; | ||
| this.vms = new variance_1.OtVar.MasterSet(); | ||
| this.varCreator = new variance_1.OtVar.ValueFactory(this.vms); | ||
| if (ivs) | ||
@@ -15,0 +14,0 @@ this.ivd = ivs.tryGetIVD(0); |
| import { Read } from "@ot-builder/bin-util"; | ||
| import { CffCoGlyphsWithNaming, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { CffCfg } from "../cfg"; | ||
| import { type CffCoGlyphsWithNaming, type OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { CffCfg } from "../cfg"; | ||
| export declare const ReadCff1: Read<CffCoGlyphsWithNaming, [cfg: CffCfg, gOrd: Data.Order<OtGlyph>, coStat?: Data.Maybe<OtGlyph.CoStat.Source>]>; | ||
| //# sourceMappingURL=read-cff1.d.ts.map |
| import { Read } from "@ot-builder/bin-util"; | ||
| import { CffCoGlyphsWithNaming, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { OtVar } from "@ot-builder/variance"; | ||
| import { CffCfg } from "../cfg"; | ||
| import { type CffCoGlyphsWithNaming, type OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { OtVar } from "@ot-builder/variance"; | ||
| import type { CffCfg } from "../cfg"; | ||
| export declare const ReadCff2: Read<CffCoGlyphsWithNaming, [cfg: CffCfg, gOrd: Data.Order<OtGlyph>, designSpace?: Data.Maybe<OtVar.DesignSpace>, coStat?: Data.Maybe<OtGlyph.CoStat.Source>]>; | ||
| //# sourceMappingURL=read-cff2.d.ts.map |
@@ -1,9 +0,9 @@ | ||
| import { Cff, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { OtVar } from "@ot-builder/variance"; | ||
| import { CffCfg } from "../cfg"; | ||
| import { CharStringGlobalOptimizeResult } from "../char-string/write/global-optimize/general"; | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import { CffTopDictRead } from "../dict/top"; | ||
| import { Cff, type OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { OtVar } from "@ot-builder/variance"; | ||
| import type { CffCfg } from "../cfg"; | ||
| import type { CharStringGlobalOptimizeResult } from "../char-string/write/global-optimize/general"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| import type { CffTopDictRead } from "../dict/top"; | ||
| export declare function readCffCommon(cff: Cff.Table, gOrd: Data.Order<OtGlyph>, topDict: CffTopDictRead, ctx: CffReadContext, gSubrs: Buffer[], designSpace?: Data.Maybe<OtVar.DesignSpace>): void; | ||
@@ -10,0 +10,0 @@ export declare function cffCleanupUnusedData(cff: Cff.Table): void; |
@@ -91,3 +91,4 @@ "use strict"; | ||
| function cffCleanupUnusedData(cff) { | ||
| if (cff.topDict && cff.topDict.privateDict) { | ||
| var _a; | ||
| if ((_a = cff.topDict) === null || _a === void 0 ? void 0 : _a.privateDict) { | ||
| cff.topDict.privateDict.localSubroutines = null; | ||
@@ -109,3 +110,4 @@ } | ||
| function applyBuildResults(cff, results) { | ||
| if (cff.fdArray && cff.fdArray.length) { | ||
| var _a; | ||
| if ((_a = cff.fdArray) === null || _a === void 0 ? void 0 : _a.length) { | ||
| for (let fdId = 0; fdId < cff.fdArray.length; fdId++) { | ||
@@ -112,0 +114,0 @@ const fd = cff.fdArray[fdId]; |
| import { Write } from "@ot-builder/bin-util"; | ||
| import { Cff, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Head } from "@ot-builder/ot-metadata"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { CffCfg } from "../cfg"; | ||
| import type { Cff, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Head } from "@ot-builder/ot-metadata"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { CffCfg } from "../cfg"; | ||
| export declare const WriteCff1: Write<Cff.Table, [gOrd: Data.Order<OtGlyph>, cfg: CffCfg, head: Head.Table, stat?: Data.Maybe<OtGlyph.Stat.Sink>]>; | ||
| //# sourceMappingURL=write-cff1.d.ts.map |
@@ -54,3 +54,3 @@ "use strict"; | ||
| if (cff.cid) { | ||
| td.fgCharSet = bin_util_1.Frag.from(io_1.CffCharSet, new glyph_data_source_1.CffCidCharSetSource(ctx, gOrd, cff.cid.mapping), ctx); | ||
| td.fgCharSet = bin_util_1.Frag.from(io_1.CffCharSet, new glyph_data_source_1.CffCidCharSetSource(gOrd, cff.cid.mapping), ctx); | ||
| } | ||
@@ -57,0 +57,0 @@ else { |
| import { Write } from "@ot-builder/bin-util"; | ||
| import { Cff, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import { Head } from "@ot-builder/ot-metadata"; | ||
| import { Data } from "@ot-builder/prelude"; | ||
| import { OtVar } from "@ot-builder/variance"; | ||
| import { CffCfg } from "../cfg"; | ||
| import type { Cff, OtGlyph } from "@ot-builder/ot-glyphs"; | ||
| import type { Head } from "@ot-builder/ot-metadata"; | ||
| import type { Data } from "@ot-builder/prelude"; | ||
| import type { OtVar } from "@ot-builder/variance"; | ||
| import type { CffCfg } from "../cfg"; | ||
| export declare const WriteCff2: Write<Cff.Table, [gOrd: Data.Order<OtGlyph>, cfg: CffCfg, head: Head.Table, designSpace?: Data.Maybe<OtVar.DesignSpace>, stat?: Data.Maybe<OtGlyph.Stat.Sink>]>; | ||
| //# sourceMappingURL=write-cff2.d.ts.map |
| "use strict"; | ||
| // Data comes from https://github.com/opentypejs/opentype.js/blob/master/src/encoding.js | ||
| // Data comes from https://github.com/opentypejs/opentype.js/blob/master/src/encoding.mjs | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.CffExpertEncoding = exports.CffStandardEncoding = exports.CffStandardStrings = void 0; | ||
| // prettier-ignore | ||
| // biome-ignore format: Keep string table compact | ||
| exports.CffStandardStrings = [ | ||
@@ -51,3 +51,3 @@ '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', | ||
| ]; | ||
| // prettier-ignore | ||
| // biome-ignore format: Keep string table compact | ||
| exports.CffStandardEncoding = [ | ||
@@ -72,3 +72,3 @@ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', | ||
| ]; | ||
| // prettier-ignore | ||
| // biome-ignore format: Keep string table compact | ||
| exports.CffExpertEncoding = [ | ||
@@ -75,0 +75,0 @@ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', |
@@ -1,3 +0,3 @@ | ||
| import { CffReadContext } from "../context/read"; | ||
| import { CffWriteContext } from "../context/write"; | ||
| import type { CffReadContext } from "../context/read"; | ||
| import type { CffWriteContext } from "../context/write"; | ||
| export declare const CffStringIndex: { | ||
@@ -4,0 +4,0 @@ write(target: import("@ot-builder/bin-util").Frag, t: string[], ctx: CffWriteContext): void; |
@@ -1,2 +0,2 @@ | ||
| import { UInt8 } from "@ot-builder/primitive"; | ||
| import type { UInt8 } from "@ot-builder/primitive"; | ||
| export type Cff1Header = { | ||
@@ -3,0 +3,0 @@ majorVersion: UInt8; |
@@ -1,2 +0,2 @@ | ||
| import { UInt16, UInt8 } from "@ot-builder/primitive"; | ||
| import type { UInt8, UInt16 } from "@ot-builder/primitive"; | ||
| export type Cff2Header = { | ||
@@ -3,0 +3,0 @@ majorVersion: UInt8; |
| import { Frag } from "@ot-builder/bin-util"; | ||
| import { WriteTimeIVS } from "@ot-builder/var-store"; | ||
| import { OtVar } from "@ot-builder/variance"; | ||
| import type { OtVar } from "@ot-builder/variance"; | ||
| export declare const Cff2IVS: { | ||
@@ -5,0 +5,0 @@ write(target: Frag, t: WriteTimeIVS, designSpace: OtVar.DesignSpace): void; |
+16
-16
| { | ||
| "name": "@ot-builder/io-bin-cff", | ||
| "description": "", | ||
| "version": "1.7.8", | ||
| "version": "1.8.0", | ||
| "license": "MIT", | ||
@@ -27,20 +27,20 @@ "repository": { | ||
| "dependencies": { | ||
| "@ot-builder/bin-composite-types": "1.7.8", | ||
| "@ot-builder/bin-util": "1.7.8", | ||
| "@ot-builder/common-impl": "1.7.7", | ||
| "@ot-builder/errors": "1.7.7", | ||
| "@ot-builder/ot-glyphs": "1.7.8", | ||
| "@ot-builder/ot-metadata": "1.7.8", | ||
| "@ot-builder/prelude": "1.7.7", | ||
| "@ot-builder/primitive": "1.7.8", | ||
| "@ot-builder/stat-glyphs": "1.7.8", | ||
| "@ot-builder/var-store": "1.7.8", | ||
| "@ot-builder/variance": "1.7.8", | ||
| "@ot-builder/bin-composite-types": "1.8.0", | ||
| "@ot-builder/bin-util": "1.8.0", | ||
| "@ot-builder/common-impl": "1.8.0", | ||
| "@ot-builder/errors": "1.8.0", | ||
| "@ot-builder/ot-glyphs": "1.8.0", | ||
| "@ot-builder/ot-metadata": "1.8.0", | ||
| "@ot-builder/prelude": "1.8.0", | ||
| "@ot-builder/primitive": "1.8.0", | ||
| "@ot-builder/stat-glyphs": "1.8.0", | ||
| "@ot-builder/var-store": "1.8.0", | ||
| "@ot-builder/variance": "1.8.0", | ||
| "tslib": "^2.8.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@ot-builder/ot-sfnt": "1.7.8", | ||
| "@ot-builder/io-bin-metadata": "1.7.8", | ||
| "@ot-builder/io-bin-sfnt": "1.7.8", | ||
| "@ot-builder/test-util": "1.7.8", | ||
| "@ot-builder/ot-sfnt": "1.8.0", | ||
| "@ot-builder/io-bin-metadata": "1.8.0", | ||
| "@ot-builder/io-bin-sfnt": "1.8.0", | ||
| "@ot-builder/test-util": "1.8.0", | ||
| "@types/jest": "^30.0.0", | ||
@@ -47,0 +47,0 @@ "jest": "^30.2.0" |
227880
0.31%5549
-0.05%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated