/** * gasp table - Grid-fitting And Scan-conversion Procedure * * This table controls when grid-fitting (hinting) and anti-aliasing * should be applied based on the rendering size (ppem). */ import type { Reader } from "../binary/reader.ts"; /** * Gasp behavior flags */ export declare const GaspFlag: { /** Use grid-fitting (hinting) */ readonly GridFit: 1; /** Use gray-scale rendering (anti-aliasing) */ readonly DoGray: 2; /** Use symmetric grid-fitting (ClearType) */ readonly SymmetricGridFit: 4; /** Use symmetric smoothing (ClearType) */ readonly SymmetricSmoothing: 8; }; /** * A ppem range with associated behavior */ export interface GaspRange { /** Maximum ppem for this range (inclusive) */ maxPPEM: number; /** Behavior flags for this range */ behavior: number; } /** * gasp table */ export interface GaspTable { /** Version (0 or 1) */ version: number; /** Ranges sorted by maxPPEM */ ranges: GaspRange[]; } /** * Parse gasp table */ export declare function parseGasp(reader: Reader): GaspTable; /** * Get behavior flags for a specific ppem */ export declare function getGaspBehavior(gasp: GaspTable, ppem: number): number; /** * Check if grid-fitting should be used */ export declare function shouldGridFit(gasp: GaspTable, ppem: number): boolean; /** * Check if gray-scale rendering should be used */ export declare function shouldDoGray(gasp: GaspTable, ppem: number): boolean;