22 lines
633 B
TypeScript
22 lines
633 B
TypeScript
/** BTF command type byte values — paired with the packer in `@suaveplan/font-compress`. */
|
|
export const CMD_M = 0;
|
|
export const CMD_L = 1;
|
|
export const CMD_B = 2;
|
|
export const CMD_Q = 3;
|
|
export const CMD_Z = 4;
|
|
|
|
/** Reverse lookup from command byte to its single-character letter form. */
|
|
export const BYTE_TO_CMD: readonly string[] = ["m", "l", "b", "q", "z"];
|
|
|
|
/** Number of coordinate values per command letter. */
|
|
export const CMD_COORD_COUNTS: Readonly<Record<string, number>> = {
|
|
m: 2,
|
|
l: 2,
|
|
b: 6,
|
|
q: 4,
|
|
z: 0,
|
|
};
|
|
|
|
/** Number of metric values encoded in the BTF header. */
|
|
export const METRICS_COUNT = 9;
|