opentype.features.js
Version:
Library to list opentype fonts optional features.
148 lines (147 loc) • 5.15 kB
TypeScript
declare namespace _default {
export { getByte };
export { getByte as getCard8 };
export { getUShort };
export { getUShort as getCard16 };
export { getShort };
export { getULong };
export { getFixed };
export { getTag };
export { getOffset };
export { getBytes };
export { getVLUInt };
export { bytesToString };
export { Parser };
}
export default _default;
declare function getByte(dataView: any, offset: any): any;
declare function getUShort(dataView: any, offset: any): any;
declare function getShort(dataView: any, offset: any): any;
declare function getULong(dataView: any, offset: any): any;
declare function getFixed(dataView: any, offset: any): any;
declare function getTag(dataView: any, offset: any): string;
declare function getOffset(dataView: any, offset: any, offSize: any): number;
declare function getBytes(dataView: any, startOffset: any, endOffset: any): any[];
declare function getVLUInt(dataView: any, offset: any): {
val: number;
length: number;
} | null;
declare function bytesToString(bytes: any): string;
export function Parser(data: any, offset: any): void;
export class Parser {
constructor(data: any, offset: any);
data: any;
offset: any;
relativeOffset: number;
parseByte(): any;
parseChar(): any;
parseCard8: any;
parseUShort(): any;
parseCard16: any;
parseSID: any;
parseOffset16: any;
parseShort(): any;
parseF2Dot14(): number;
parseULong(): any;
parseOffset32: any;
parseFixed(): any;
parseString(length: any): string;
parseTag(): string;
parseLongDateTime(): any;
parseVersion(minorBase: any): any;
skip(type: any, amount: any): void;
parseULongList(count: any): any[];
parseOffset16List: (count: any) => any[];
parseUShortList(count: any): any[];
parseShortList(count: any): any[];
parseByteList(count: any): any[];
/**
* Parse a list of items.
* Record count is optional, if omitted it is read from the stream.
* itemCallback is one of the Parser methods.
*/
parseList(count: any, itemCallback: any): any[];
parseList32(count: any, itemCallback: any): any[];
/**
* Parse a list of records.
* Record count is optional, if omitted it is read from the stream.
* Example of recordDescription: { sequenceIndex: Parser.uShort, lookupListIndex: Parser.uShort }
*/
parseRecordList(count: any, recordDescription: any): any[];
parseRecordList32(count: any, recordDescription: any): any[];
parseStruct(description: any): any;
/**
* Parse a GPOS valueRecord
* https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record
* valueFormat is optional, if omitted it is read from the stream.
*/
parseValueRecord(valueFormat: any): {
xPlacement: any;
yPlacement: any;
xAdvance: any;
yAdvance: any;
xPlaDevice: any;
yPlaDevice: any;
xAdvDevice: any;
yAdvDevice: any;
} | undefined;
/**
* Parse a list of GPOS valueRecords
* https://docs.microsoft.com/en-us/typography/opentype/spec/gpos#value-record
* valueFormat and valueCount are read from the stream.
*/
parseValueRecordList(): any[];
parsePointer(description: any): any;
parsePointer32(description: any): any;
/**
* Parse a list of offsets to lists of 16-bit integers,
* or a list of offsets to lists of offsets to any kind of items.
* If itemCallback is not provided, a list of list of UShort is assumed.
* If provided, itemCallback is called on each item and must parse the item.
* See examples in tables/gsub.js
*/
parseListOfLists(itemCallback: any): any[];
parseCoverage(): {
format: number;
glyphs: any[];
ranges?: undefined;
} | {
format: number;
ranges: any[];
glyphs?: undefined;
};
parseClassDef(): {
format: number;
startGlyph: any;
classes: any[];
ranges?: undefined;
} | {
format: number;
ranges: any[];
startGlyph?: undefined;
classes?: undefined;
};
parseScriptList(): any;
parseFeatureList(): any;
parseLookupList(lookupTableParsers: any): any;
parseFeatureVariationsList(): any;
}
export namespace Parser {
function list(count: any, itemCallback: any): () => any;
function list32(count: any, itemCallback: any): () => any;
function recordList(count: any, recordDescription: any): () => any;
function recordList32(count: any, recordDescription: any): () => any;
function pointer(description: any): () => any;
function pointer32(description: any): () => any;
const tag: any;
const byte: any;
const uShort: any;
const offset16: any;
const uShortList: any;
const uLong: any;
const offset32: any;
const uLongList: any;
const struct: any;
const coverage: any;
const classDef: any;
}