Generator node

Text as Image

Renders a string into a GPU texture using any installed macOS font family and style, with nine-way anchor alignment, rotation, and live text input. The text content can be typed in the inspector or driven by a cable, so labels, readouts, and titles update in real time. Composite the result with a Canvas node to put it on screen.

Inputs

PortTypeDefault
EnableOff clears the image this node produces, leaving nothing for the canvas to composite.booltrue
TextThe string to draw. A connected number arrives formatted with two decimals, so counters and timers can be wired straight in.stringGrafit
SizeFont size in Grafit units — 0.1 is about a twentieth of the short edge. Not clamped, but the glyphs are rendered crisp only up to roughly 4.float0.1
XHorizontal position of the text block in Grafit units, 0 being screen centre. Not clamped.float0
YVertical position of the text block in Grafit units. Not clamped.float0
ScaleExtra multiplier on top of Size, handy for animating a word in. Not clamped; 0 collapses the text to nothing.float1.0
RotationTurns the text around its own centre, in degrees, positive being clockwise. Any value works — it just keeps rotating.float0
ColorColour and opacity of the glyphs. Alpha 0 renders nothing while still reserving the same size.color—
H AlignWhich part of the text sits at X — Left, Center or Right. Values outside the list fall back to Center.int1
V AlignWhich part of the text sits at Y — Top, Middle or Bottom. Values outside the list fall back to Middle.int1

Outputs

PortType
Imageimage
Widthfloat
Heightfloat

Live Preview

Interactive — Text rasterized to a texture — scale and rotate freely

How It Works

Text as Image rasterizes the string on the CPU using the macOS text engine (Core Text / CoreGraphics): the text is drawn into a high-resolution bitmap with subpixel positioning and high-quality antialiasing, uploaded once to a Metal texture (with mipmaps), and cached. On the GPU, each frame simply draws that texture onto a quad — positioned, scaled, and rotated in Grafit coordinates (origin at viewport center, shorter edge = [-1, +1], positive rotation = clockwise). The result is written to the node's offscreen texture with premultiplied alpha; near-transparent fringe pixels are discarded to keep edges clean on transparent backgrounds.

The bitmap's resolution adapts to the Size input: the internal render size is 256 px × clamp(Size, 0.5, 4.0), drawn at 2× for Retina. In practice text is sharp across the useful size range, but pushing Size (or Scale) far beyond 4.0 magnifies a capped-resolution bitmap and will soften — this is bitmap text, not a distance-field font.

Rasterized textures are cached by text + font + size bucket + color, so a static label costs nothing per frame; only a change to any of those triggers a re-render.

Font selection does not use ports: the font Family and Style (Light, Regular, Bold, Italic, …) are chosen in the node's Settings tab, listing every font installed on the system. The default is SF Pro. Changing the font re-rasterizes the texture immediately.

Alignment decides how the text block hangs off the X/Y anchor point:

H AlignMeaningV AlignMeaning
0 = LeftX is the left edge of the text0 = TopY is the top edge of the text
1 = CenterX is the horizontal center1 = MiddleY is the vertical center
2 = RightX is the right edge of the text2 = BottomY is the bottom edge of the text

The Width and Height outputs report the measured text-block size in Grafit units for the current string, font, and Size — perfect for sizing a background plate behind the text. When Enable is false (or the string is empty), the output texture is cleared to transparent.

Parameters in Depth

PortDefaultMeaning
EnabletrueMaster switch. Off clears the output texture.
Text"Grafit"The string to render. The inspector provides a live multi-line text editor (every keystroke updates the output). A connected Float value is auto-formatted with two decimals.
Size0.1Font size in Grafit units (0.1 ≈ 1/20 of the shorter viewport edge). Also controls the internal raster resolution (clamped ×0.5…×4).
X, Y0, 0Anchor position in Grafit units; how the text hangs off it depends on the alignment inputs.
Scale1.0Uniform multiplier on the rendered quad. Unlike Size, it does not re-rasterize the text — cheap to animate, but large values soften the bitmap.
Rotation0Rotation in degrees, positive = clockwise, around the aligned anchor.
ColorWhite (1,1,1,1)RGBA text color, baked into the rasterized texture (a color change re-renders it).
H Align10 = Left, 1 = Center, 2 = Right (segmented control in the inspector).
V Align10 = Top, 1 = Middle, 2 = Bottom.

Interactions: Size and Scale both make text bigger, but Size re-rasterizes at higher resolution (crisper, slightly more expensive on change) while Scale just stretches the existing texture (free, ideal for smooth animation). Alignment happens before rotation, so a right-aligned label rotates around its anchored edge-center, not the text center.

Use Cases

  • Live data readout — any float output → Text for an instant two-decimal display; or format first with String Combine ("BPM: " + value) for labeled telemetry.
  • Song/scene titles — String Splitter / Switch selecting from a set of strings → Text, with LFO → Color alpha for fade-in/fade-out title cards.
  • Clock or countdown — Timer → Math Expression → JSON Stringify or String Combine → Text for on-screen time displays.
  • Text on a plate — wire this node's Width/Height outputs (via Math, adding padding) into a Rectangle node's Width/Height to auto-size a background card that always fits the label.
  • Kinetic typography — LFO → Scale and Rotation for pulsing, swinging words; Audio Beat Detection → Enable to flash words on the beat.
  • Keyboard-driven captions — Keyboard → Switch → Text to punch different captions live during a performance.

Tips

  • Generators never draw directly to the viewport: connect Image to a Canvas node (which is also where opacity, blend modes, and 3D placement live).
  • Animate Scale, not Size, for smooth continuous zooms — every distinct Size/text/color combination rasterizes and caches a new texture, so rapidly sweeping Size churns the cache.
  • Fast-changing text (counters, timestamps) re-rasterizes on every new string; that is fine for readouts, but avoid feeding it high-frequency noise (smooth or quantize the value first, e.g. with Smooth or Math).
  • Font Family and Style live in the Settings tab of the node, not the inspector's parameter list — easy to miss.
  • Color is baked into the texture; for per-pixel effects (gradients across text, glows) run the Image output through Gradient-masked compositing, Gaussian Blur, or Invert Image.
  • Use the text as a stencil: feed Image into a Canvas node's Mask input to reveal video or generative visuals through the letterforms.
  • Newlines typed in the inspector's text box are passed straight to the macOS text engine, giving multi-line blocks.

Open Text as Image in the interactive catalog →

Text as Image is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Generator nodes