---
title: "glyphFor"
description: "The character drawn in each cell, picked by how bright the cell is."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.stylize"
categorySlug: "effects-stylize"
categoryTitle: "Stylize"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/stylize.ts#L346"
---

# glyphFor

The character drawn in each cell, picked by how bright the cell is.

```ts
glyphFor(slots: {
    grid: FragmentStage
    cell: FragmentStage
    gamma: PropRef
    atlas: (params: GpuFragmentParams) => KitTexture
}): FragmentStage
```

Import `effects` from `shaders/std` and use `effects.stylize.glyphFor`.

`gamma` bends the brightness curve: below 1 favours the light characters, above 1 the dark ones. `atlas` is your function that draws the character set into a texture and returns it (the Ascii shader shows one). The definition needs three extra fields the atlas fills in: `_charCount`, `_atlasScale` and `_atlasSize`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `slots` | `{
    grid: FragmentStage
    cell: FragmentStage
    gamma: PropRef
    atlas: (params: GpuFragmentParams) => KitTexture
}` |  |

## Example

```ts
glyph: glyphFor({grid, cell, gamma: p('gamma'), atlas: setupGlyphAtlas})
```

## See also

- [`glyphTint`](/docs/primitives/effects-stylize/glyphtint) — The finished ASCII look: each character tinted with its cell's color, everything else transparent.
- [`cellSample`](/docs/primitives/effects-stylize/cellsample) — The color of the layer inside at the centre of each character cell.

## Used by

[Ascii](/docs/components/ascii)