UNPKG

unicode-shaper

Version:

Shape unicode text so that renderers like WebGL and WebGPU can properly display the glyphs.

59 lines 1.73 kB
export declare const MIRROR_CHAR: number[][]; /** * Mirror adjust string (things like parens, brackets, quotes, etc.) * @param s - input string */ export declare function mirrorAdjustString(s: number[]): void; export declare const RAND_AL_CAT: number[][]; /** * Check if a character is a "right-to-left" unicode character * @param c - input unicode character * @returns - True if right-to-left */ export declare function isRTL(c: number): boolean; export declare const NEUTRAL: number[][]; /** * Check if character is neutral * @param c - input unicode character * @returns - True if neutral */ export declare function isNeutral(c: number): boolean; export declare const WEAK: number[][]; /** * Check if a character is a "weak" unicode character * @param c - input unicode character * @returns - True if weak */ export declare function isWeak(c: number): boolean; /** Unicode character types */ export declare const Type: { /** Right to Left */ readonly Rtl: 0; /** Weak */ readonly Weak: 1; /** Neutral */ readonly Neutral: 2; /** Left to Right */ readonly Ltr: 3; }; /** * Enum representing the unicode character types * - 0 = Right to Left * - 1 = Weak * - 2 = Neutral * - 3 = Left to Right */ export type Type = (typeof Type)[keyof typeof Type]; /** * Get the type of a unicode character * @param c - input unicode character * @returns - The type */ export declare function getType(c: number): Type; /** * Find the dominant type in the string. skip past CtrChar until RTL or LTR is found. * @param str - Array of unicode characters * @returns - The dominant type */ export declare function findDominantType(str: number[]): Type; //# sourceMappingURL=internal.d.ts.map