Layers

Text Layer

Text layers render text content with customizable font, size, color, and alignment. Text is rendered to canvas and displayed as a Three.js plane in the scene.

Example

text-layer.json
{
  "type": "text",
  "id": "text-1",
  "name": "Heading",
  "visible": true,
  "locked": false,
  "textType": "point",
  "content": "Hello World",
  "fontFamily": "DM Sans",
  "fontSize": 64,
  "fontWeight": "bold",
  "letterSpacing": 0,
  "lineHeight": 1.2,
  "color": "#ffffff",
  "textAlign": "center",
  "verticalAlign": "middle",
  "transform": {
    "x": 0,
    "y": 0,
    "width": 1,
    "height": 1,
    "rotation": 0,
    "opacity": 1
  }
}

Properties

PropertyTypeDefaultDescription
textTypestring"point""point" | "frame" (authoring mode)
contentstring""The text content to display
fontFamilystring"DM Sans"Font family name
fontSizenumber48Font size in pixels
fontWeightstring"normal""normal" | "medium" | "semibold" | "bold"
letterSpacingnumber0Letter spacing in pixels
lineHeightnumber1.2Line height multiplier
colorstring"#ffffff"Text color (hex)
textAlignstring"center""left" | "center" | "right"
verticalAlignstring"middle""top" | "middle" | "bottom"
textBoxWidthnumberundefinedWidth for text wrapping (legacy, use frameWidthPx instead)
frameWidthPxnumberundefinedFrame width in CSS pixels (frame text only). Resizing changes this, not fontSize.
frameHeightPxnumberundefinedFrame height in CSS pixels (frame text only)
autoSizestring"height""none" | "height" | "widthAndHeight"

Available Fonts

Use the fonts discovery API to get all available fonts:

fonts.sh
GET https://efecto.app/api/v1/fonts

Text Modes

Text layers support two authoring modes controlled by textType (with textTransformMode kept for backward compatibility):

  • point (default) - Text behaves like point text and grows naturally with content. Resizing changes fontSize.
  • frame - Text wraps within a fixed-width frame defined by frameWidthPx/frameHeightPx. Resizing changes the frame dimensions, NOT the font size.