Quadrille.textZoom
Sets the glyph size for string cells, as a fraction of cellLength. The default is Quadrille.textZoom, which is 0.78 — a little under the full cell, so a glyph does not crowd the tile stroke.
Passing textZoom to drawQuadrille overrides the global default for that call only.
Example
Note
Drag the left slider and only
q1changes: atextZoompassed todrawQuadrilleoverrides the global default for that call. Drag the right one andq2,q3andq4follow it whileq1stays put — an explicit value always wins.Push either past
1and the glyph outgrows its cell. Nothing is clipped: string cells are drawn unboxed, so a glyph overflows into its neighbours rather than vanishing.
Warning
A cell's glyph count is what divides the zoom, and it counts characters.
Compare
q4against the others. A one-character cell draws atcellLength × textZoom;q4holds two characters per cell, so each is drawn at half that. This is what keeps a whole word inside its cell.An emoji counts as one character even though JavaScript stores most of them as two UTF-16 code units —
'🎃'.lengthis2, yet it fills a cell exactly like'a'.q3mixes emoji that carry variation selectors, which are also folded into a single character.
Syntax
drawQuadrille(quadrille, { textZoom })
Parameters
| Param | Description |
|---|---|
textZoom |
Number: glyph size as a fraction of cellLength. Defaults to Quadrille.textZoom, which is 0.78 |
What this page's examples use
- p5.quadrille
drawQuadrillecreateQuadrillecellLengthtextZoom- p5.js
createCanvasbackgroundvaluepositioninputcreateSlider
Names the analysis can prove are called, and the line each one is documented on. Local variables and members of an unknown receiver are left out.