# FontRegistry.shape Method

> FontRegistry.shape method in the TX Sheet Control TypeScript API for the browser: Shape text into glyphs using a CSS font string.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > FontRegistry > FontRegistry.shape Method
- **441 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/fontregistry/shape-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/fontregistry/shape-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/fontregistry/shape-method/llms-full.txt

---

Shape text into glyphs using a CSS font string.

Owner: [FontRegistry](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/fontregistry/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

### Syntax

```typescript
shape(text: string, css: string): GlyphRun
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `text` | `string` | No | Literal text; leading zeros and equals signs are preserved. |
| `css` | `string` | No | Operation-specific input; see the owning type for units and scope. |

### Return Value

`GlyphRun`.

A detached result or a handle bound to the same worksheet.

### Examples

Pass an existing FontRegistry from the owning document. Related handles and input bytes must belong to the intended document and application; the function applies the operation and inspects its result.

```typescript
import type { FontRegistry } from '@txtextcontrol/tx-sheet-control';

function applyFontRegistryShape(fontRegistry: FontRegistry) {
    const result = fontRegistry['shape']('Invoice total', '11px "Liberation Sans"');
    console.log(result);
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [FontRegistry Class](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/fontregistry/llms-full.txt)
- [Font Handling](https://docs.textcontrol.com/tx-sheet-control/deployment/fonts/llms-full.txt)

---

## Nearby

- **Previous:** [FontRegistry.revision Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/fontregistry/revision-property/llms-full.txt)
- **Next:** [FontRegistry.snapshot Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/fontregistry/snapshot-method/llms-full.txt)
