Initial Commit
This commit is contained in:
21
packages/media/fonts/font-decompress/src/constants/index.ts
Normal file
21
packages/media/fonts/font-decompress/src/constants/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/** 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;
|
||||
Reference in New Issue
Block a user