# @types/subset-font

> TypeScript definitions for subset-font

Latest version **2.3.0** (published 2024-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/subset-font
pnpm add @types/subset-font
yarn add @types/subset-font
bun add @types/subset-font
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2024-11-18 |
| First published | 2022-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/subset-font
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subset-font
- npm.io page: https://npm.io/package/@types/subset-font

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 2.3.0 (latest) — 2024-11-18
- 1.4.3 (ts4.5) — 2023-11-07
- 1.4.0 (ts4.0) — 2022-06-30
- 2.2.0 — 2024-11-18
- 1.4.2 — 2023-10-18
- 1.4.1 — 2023-09-25

## README

# Installation
> `npm install --save @types/subset-font`

# Summary
This package contains type definitions for subset-font (https://github.com/papandreou/subset-font).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subset-font.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/subset-font/index.d.ts)
````ts
/// <reference types="node" />

/**
 * Object for adjusting options on subset-font output.
 */
interface SubsetFontOptions {
    /**
     * The desired output format. Defaults to the format of the original font.
     */
    targetFormat?: "sfnt" | "woff" | "woff2" | "truetype";
    /**
     * An array of numbers specifying the extra name ids to preserve in the name table. See README for details.
     */
    preserveNameIds?: number[];
    /**
     * An object specifying a full or partial instancing of variation axes in the font.
     * Only works with variable fonts. See README's example for details.
     */
    variationAxes?: {
        [axeName: string]: number | { min: number; max: number; default?: number };
    };
    /**
     * Don't perform glyph closure for layout substitution (GSUB).
     * Equivalent to `hb-subset --no-layout-closure` and `pyftsubset --no-layout-closure`.
     */
    noLayoutClosure?: boolean;
}

/**
 * Create a subset font from an existing font in SFNT (TrueType/OpenType), WOFF, or WOFF2 format.
 *
 * @param buffer A buffer containing the original font to subset.
 * @param text A string of characters to subset the original font to.
 * @param options Additional options to configure the subsetter with.
 */
declare function subsetFont(buffer: Buffer, text: string, options?: SubsetFontOptions): Promise<Buffer>;

export = subsetFont;

````

### Additional Details
 * Last updated: Mon, 18 Nov 2024 14:36:19 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [Logan Graham](https://github.com/omacranger).

---
_Source: https://npm.io/package/@types/subset-font · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
