# FontRegistry Class

> FontRegistry class in the browser JavaScript API: Resolves document font faces and shapes glyph runs identically in browser and server rendering.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > JavaScript API > Browser Editor > FontRegistry Class
- **544 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/llms-full.txt

---

Resolves document font faces and shapes glyph runs identically in browser and server rendering.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

ES module import: `import { FontRegistry } from '@txtextcontrol/tx-sheet-control';`.

### Constructor

```javascript
new FontRegistry()
```

This overload has no parameters.

Returns: `FontRegistry`.

### Members

#### Properties

| Property | Description |
|---|---|
| [revision](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/revision-property/llms-full.txt) | Monotonic face-catalog revision, updated only when a face is registered. |

#### Methods

| Method | Description |
|---|---|
| [add](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/add-method/llms-full.txt) | Add/replace a TrueType-outline font face. |
| [has](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/has-method/llms-full.txt) | Check a family/weight/style face. |
| [measure](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/measure-method/llms-full.txt) | Read text width/ascent/descent. |
| [shape](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/shape-method/llms-full.txt) | Shape text into glyphs using a CSS font string. |
| [snapshot](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/snapshot-method/llms-full.txt) | Copy registered font faces. |

### Examples

Pass the FontRegistry value obtained from its owning control, collection, callback or operation. The function reads that value without constructing a replacement document object.

```javascript
function inspectFontRegistryRevision(fontRegistry) {
    const value = fontRegistry['revision'];
    console.log('FontRegistry.revision', value);
}
```

### See Also

- [JavaScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/llms-full.txt)
- [Font Handling](https://docs.textcontrol.com/tx-sheet-control/deployment/fonts/llms-full.txt)
- [alias](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/alias-method/llms-full.txt): Map an original family to a registered target without changing workbook styles. Unknown targets and cyclic substitutions throw.

---

## In This Section

- [FontRegistry.add Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/add-method/llms-full.txt): FontRegistry.add method in the TX Sheet Control JavaScript API for the browser: Add/replace a TrueType-outline font face.
- [FontRegistry.alias Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/alias-method/llms-full.txt): FontRegistry.alias method in the browser JavaScript API: Map an original family to a registered target without changing workbook styles.
- [FontRegistry.has Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/has-method/llms-full.txt): FontRegistry.has method in the TX Sheet Control JavaScript API for the browser: Check a family/weight/style face. Includes the syntax and a JavaScript example.
- [FontRegistry.measure Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/measure-method/llms-full.txt): FontRegistry.measure method in the TX Sheet Control JavaScript API for the browser: Read text width/ascent/descent. Shown with a JavaScript example.
- [FontRegistry.revision Property](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/revision-property/llms-full.txt): FontRegistry.revision property in the TX Sheet Control JavaScript API for the browser: Monotonic face-catalog revision, updated only when a face is registered.
- [FontRegistry.shape Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/shape-method/llms-full.txt): FontRegistry.shape method in the TX Sheet Control JavaScript API for the browser: Shape text into glyphs using a CSS font string.
- [FontRegistry.snapshot Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/snapshot-method/llms-full.txt): FontRegistry.snapshot method in the TX Sheet Control JavaScript API for the browser: Copy registered font faces. Includes the syntax and a JavaScript example.

---

## Nearby

- **Previous:** [FontManager.state Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontmanager/state-method/llms-full.txt)
- **Next:** [FontRegistry.add Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/browser/fontregistry/add-method/llms-full.txt)
