Skip to content

AI-native design editor. Open-source Figma alternative.

feat(design-jsx): font features, variations, and language (#1375)

Garvit Kaushik3b8e55f8e034
diff --git a/changes/1375/added.md b/changes/1375/added.md
new file mode 100644
index 000000000..ab827e11a
--- /dev/null
+++ b/changes/1375/added.md
@@ -0,0 +1 @@
+- Design JSX `<Text>` and `<Span>` take `fontFeatures`, `fontVariations`, and `lang`, and `<Text>` takes `fontOpticalSizing`; JSX export keeps OpenType features, variable-font axes, a fixed optical size, and language instead of dropping them.
diff --git a/packages/core/src/canvas/text/index.ts b/packages/core/src/canvas/text/index.ts
index b9575865d..db62066cb 100644
--- a/packages/core/src/canvas/text/index.ts
+++ b/packages/core/src/canvas/text/index.ts
@@ -56,7 +56,7 @@ function languageForCharacter(node: SceneNode, sourceIndex: number): string | nu
const run = node.styleRuns.find(
(item) => sourceIndex >= item.start && sourceIndex < item.start + item.length
)
- return run?.style.textLanguage ?? node.textLanguage
+ return run?.style.textLanguage !== undefined ? run.style.textLanguage : node.textLanguage
}
function transformedSourceOffsets(node: SceneNode): number[] {
diff --git a/packages/core/src/canvas/text/layout/build.ts b/packages/core/src/canvas/text/layout/build.ts
index aaee0b8c8..7e220e04a 100644
--- a/packages/core/src/canvas/text/layout/build.ts
+++ b/packages/core/src/canvas/text/layout/build.ts
@@ -184,7 +184,7 @@ function markerNode(node: ParagraphNode, item: TextListItem, style: ListStyle):
opticalSizeFromFontSize: override?.opticalSizeFromFontSize ?? node.opticalSizeFromFontSize,
fontFeatures:
item.listType === 'ORDERED' ? [...features, { tag: 'TNUM', enabled: true }] : features,
- textLanguage: override?.textLanguage ?? node.textLanguage,
+ textLanguage: override?.textLanguage !== undefined ? override.textLanguage : node.textLanguage,
styleRuns: override?.fills
? [{ start: 0, length: item.marker.length, style: { fills: override.fills } }]
: [],
diff --git a/packages/core/src/canvas/text/paragraph/index.ts b/packages/core/src/canvas/text/paragraph/index.ts
index 6e40ca086..caf715931 100644
--- a/packages/core/src/canvas/text/paragraph/index.ts
+++ b/packages/core/src/canvas/text/paragraph/index.ts
@@ -149,7 +149,7 @@ function styleRunLanguage(
style: SceneNode['styleRuns'][number]['style'],
node: Pick<ParagraphNode, 'textLanguage'>
): string | undefined {
- return style.textLanguage ?? node.textLanguage ?? undefined
+ return (style.textLanguage !== undefined ? style.textLanguage : node.textLanguage) ?? undefined
}
function pushStyleRun(
diff --git a/packages/core/src/text/coverage.ts b/packages/core/src/text/coverage.ts
index 5f03147c1..b5547b57d 100644
--- a/packages/core/src/text/coverage.ts
+++ b/packages/core/src/text/coverage.ts
@@ -50,7 +50,7 @@ function styleForCharacter(
family = run.style.fontFamily ?? family
weight = run.style.fontWeight ?? weight
italic = run.style.italic ?? italic
- language = run.style.textLanguage ?? language
+ if (run.style.textLanguage !== undefined) language = run.style.textLanguage
}
return { family, style: weightToStyle(weight, italic), language }
diff --git a/packages/core/src/text/requirements.ts b/packages/core/src/text/requirements.ts
index f97d6809d..122e4357b 100644
--- a/packages/core/src/text/requirements.ts
+++ b/packages/core/src/text/requirements.ts
@@ -50,7 +50,7 @@ export function collectGraphFontKeys(
function textLanguageAt(node: SceneNode, index: number): string | null {
const run = node.styleRuns.find((item) => index >= item.start && index < item.start + item.length)
- return run?.style.textLanguage ?? node.textLanguage
+ return run?.style.textLanguage !== undefined ? run.style.textLanguage : node.textLanguage
}
export interface GraphFontRequirements {
diff --git a/packages/core/tests/design-jsx/export-round-trip.test.ts b/packages/core/tests/design-jsx/export-round-trip.test.ts
index a1aace43b..12b398c34 100644
--- a/packages/core/tests/design-jsx/export-round-trip.test.ts
+++ b/packages/core/tests/design-jsx/export-round-trip.test.ts
@@ -136,7 +136,7 @@ describe('rich text round trip', () => {
<Paragraph spacing={12}>Hello <Span weight={700} color="#EE2222">bold <Span italic>world</Span></Span>!</Paragraph>
<Paragraph list="ordered">First <Span textDecoration="underline" letterSpacing={1}>item</Span></Paragraph>
<Paragraph list="ordered" level={2} listSpacing={4} indent={8}>Nested</Paragraph>
- <Paragraph list="unordered"><Span size={18} font="Roboto" lineHeight={28}>Dot</Span></Paragraph>
+ <Paragraph list="unordered"><Span size={18} font="Roboto" lineHeight={28}>Dot</Span> <Span fontFeatures={{ tnum: true, liga: false }} fontVariations={{ wght: 650 }} lang="de">0123</Span></Paragraph>
<Paragraph />
</Text>`
)
diff --git a/packages/core/tests/helpers/property-cases.ts b/packages/core/tests/helpers/property-cases.ts
index b98182a89..5bc589bc9 100644
--- a/packages/core/tests/helpers/property-cases.ts
+++ b/packages/core/tests/helpers/property-cases.ts
@@ -273,6 +273,19 @@ export const PROPERTY_CASES: RoundTripCase[] = [
textUnderlineOffset: 3,
textDecorationSkipInk: false
}),
+ leafCase('text font settings', 'TEXT', {
+ text: 'Numbers 0123',
+ fontFeatures: [
+ { tag: 'TNUM', enabled: true },
+ { tag: 'LIGA', enabled: false }
+ ],
+ fontVariations: [
+ { axis: 'wght', value: 650 },
+ { axis: 'opsz', value: 14 }
+ ],
+ opticalSizeFromFontSize: false,
+ textLanguage: 'de'
+ }),
leafCase('text paragraph spacing', 'TEXT', {
text: 'One\nTwo',
paragraphSpacing: 8,
diff --git a/packages/core/tests/text/fallbacks.test.ts b/packages/core/tests/text/fallbacks.test.ts
index 7e63e0993..5fe15cffa 100644
--- a/packages/core/tests/text/fallbacks.test.ts
+++ b/packages/core/tests/text/fallbacks.test.ts
@@ -29,4 +29,18 @@ describe('fallback scripts', () => {
// A Traditional-only character draws in the Traditional Chinese fallback, so that one loads.
expect(collectGraphFontRequirements(graph, [text.id]).scripts).toEqual(['cjk-tc'])
})
+
+ test('read characters a run clears the language of without the text language', () => {
+ const graph = new SceneGraph()
+ const text = graph.createNode('TEXT', graph.getPages()[0].id, {
+ text: '中中',
+ fontFamily: 'Inter',
+ textLanguage: 'ja',
+ styleRuns: [{ start: 1, length: 1, style: { textLanguage: null } }]
+ })
+ expect(collectGraphFontRequirements(graph, [text.id]).scripts.toSorted()).toEqual([
+ 'cjk-jp',
+ 'cjk-sc'
+ ])
+ })
})
diff --git a/packages/design-jsx/src/definitions.ts b/packages/design-jsx/src/definitions.ts
index 252356e59..d17a709d4 100644
--- a/packages/design-jsx/src/definitions.ts
+++ b/packages/design-jsx/src/definitions.ts
@@ -36,6 +36,9 @@ export const DESIGN_JSX_SPAN_PROPERTY_NAMES = [
'textDecorationThickness',
'textUnderlineOffset',
'textDecorationSkipInk',
+ 'fontFeatures',
+ 'fontVariations',
+ 'lang',
'textCase',
'href'
] as const
@@ -152,6 +155,10 @@ export const DESIGN_JSX_SUPPORTED_PROPERTY_NAMES = [
'textDecorationThickness',
'textUnderlineOffset',
'textDecorationSkipInk',
+ 'fontFeatures',
+ 'fontVariations',
+ 'lang',
+ 'fontOpticalSizing',
'textCase',
'paragraphSpacing',
'paragraphIndent',
diff --git a/packages/design-jsx/src/export/font.ts b/packages/design-jsx/src/export/font.ts
new file mode 100644
index 000000000..088c23d94
--- /dev/null
+++ b/packages/design-jsx/src/export/font.ts
@@ -0,0 +1,25 @@
+import type { CharacterStyleOverride } from '@open-pencil/scene-graph'
+
+import type { JSXProp } from './value'
+
+/** The font settings a `<Text>` or `<Span>` writes, by their scene fields. */
+export const FONT_SETTING_FIELDS = ['fontFeatures', 'fontVariations', 'textLanguage'] as const
+
+type FontSettings = Pick<CharacterStyleOverride, (typeof FONT_SETTING_FIELDS)[number]>
+
+/** The font settings set in `style`, as `<Text>` and `<Span>` write them. */
+export function collectFontSettingProps(style: FontSettings, props: JSXProp[]): void {
+ if (style.fontFeatures) {
+ props.push([
+ 'fontFeatures',
+ Object.fromEntries(style.fontFeatures.map(({ tag, enabled }) => [tag.toLowerCase(), enabled]))
+ ])
+ }
+ if (style.fontVariations) {
+ props.push([
+ 'fontVariations',
+ Object.fromEntries(style.fontVariations.map(({ axis, value }) => [axis, value]))
+ ])
+ }
+ if (style.textLanguage !== undefined) props.push(['lang', style.textLanguage])
+}
diff --git a/packages/design-jsx/src/export/props.ts b/packages/design-jsx/src/export/props.ts
index 63d828590..f35bffc9a 100644
--- a/packages/design-jsx/src/export/props.ts
+++ b/packages/design-jsx/src/export/props.ts
@@ -9,6 +9,7 @@ import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text/directio
import { BLEND_MODE, TEXT_ALIGN, TEXT_ALIGN_VERTICAL, TEXT_CASE, TEXT_DECORATION } from '../enums'
import { textLengthJSX } from '../overrides/text'
import { collectDecorationProps } from './decoration'
+import { collectFontSettingProps, FONT_SETTING_FIELDS } from './font'
import {
collectCornerRadii,
collectPadding,
@@ -230,9 +231,23 @@ const DECORATION_FIELDS = [
const TEXT_DEFAULTS = pick(
createDefaultNode(() => '', 'TEXT'),
- DECORATION_FIELDS
+ [...DECORATION_FIELDS, ...FONT_SETTING_FIELDS]
)
+/** The fields of `node` that differ from a new text's. */
+function ownTextFields<K extends keyof typeof TEXT_DEFAULTS>(
+ node: SceneNode,
+ fields: readonly K[]
+) {
+ return omitBy(pick(node, fields), (value, key) => isEqual(value, TEXT_DEFAULTS[key]))
+}
+
+/** A text's font settings, and whether its optical size follows the font size. */
+function collectTextFontSettingProps(node: SceneNode, props: JSXProp[]): void {
+ collectFontSettingProps(ownTextFields(node, FONT_SETTING_FIELDS), props)
+ if (!node.opticalSizeFromFontSize) props.push(['fontOpticalSizing', 'none'])
+}
+
/** A font weight as `weight` writes it, by name for the weights that have one. */
export function fontWeightValue(weight: number): string | number {
if (weight === 700) return 'bold'
@@ -260,11 +275,8 @@ function collectTextNodeProps(node: SceneNode, props: JSXProp[]): void {
}
if (node.textDecoration !== 'NONE')
props.push(['textDecoration', TEXT_DECORATION.print(node.textDecoration)])
- collectDecorationProps(
- omitBy(pick(node, DECORATION_FIELDS), (value, key) => isEqual(value, TEXT_DEFAULTS[key])),
- node,
- props
- )
+ collectDecorationProps(ownTextFields(node, DECORATION_FIELDS), node, props)
+ collectTextFontSettingProps(node, props)
if (node.textCase !== 'ORIGINAL') props.push(['textCase', TEXT_CASE.print(node.textCase)])
if (node.maxLines != null) props.push(['maxLines', node.maxLines])
if (node.textTruncation === 'ENDING' && node.maxLines == null) props.push(['truncate', true])
diff --git a/packages/design-jsx/src/export/text.ts b/packages/design-jsx/src/export/text.ts
index f57fb2a4f..717abe180 100644
--- a/packages/design-jsx/src/export/text.ts
+++ b/packages/design-jsx/src/export/text.ts
@@ -18,6 +18,7 @@ import { TEXT_CASE, TEXT_DECORATION } from '../enums'
import { AUTO, textLengthJSX } from '../overrides/text'
import { SPAN_STYLE_FIELDS, type SpanStyle } from '../text-content'
import { collectDecorationProps } from './decoration'
+import { collectFontSettingProps } from './font'
import { collectFillProps } from './paint'
import { fontWeightValue } from './props'
import { propAttribute, type JSXProp } from './value'
@@ -64,6 +65,7 @@ function spanProps(style: SpanStyle, node: SceneNode): JSXProp[] {
if (style.textDecoration !== undefined)
props.push(['textDecoration', TEXT_DECORATION.print(style.textDecoration)])
collectDecorationProps(style, node, props)
+ collectFontSettingProps(style, props)
if (style.textCase !== undefined) props.push(['textCase', TEXT_CASE.print(style.textCase)])
if (style.hyperlink) props.push(['href', style.hyperlink.value])
return props
diff --git a/packages/design-jsx/src/overrides/text.ts b/packages/design-jsx/src/overrides/text.ts
index e02d6d2f2..7888b575d 100644
--- a/packages/design-jsx/src/overrides/text.ts
+++ b/packages/design-jsx/src/overrides/text.ts
@@ -1,3 +1,4 @@
+import { uniqBy } from 'es-toolkit'
import * as v from 'valibot'
import type { Fill, SceneNode, TextLength } from '@open-pencil/scene-graph'
@@ -30,6 +31,11 @@ export function textLengthJSX(length: TextLength): number | `${number}%` {
const lengthSchema = v.pipe(v.number(), v.finite())
const autoLengthSchema = v.union([lengthSchema, v.literal(AUTO)])
+/** An OpenType feature or axis tag: four printable ASCII characters, such as `tnum` or `wght`. */
+const openTypeTagSchema = v.pipe(
+ v.string(),
+ v.regex(/^[\x20-\x7E]{4}$/, 'Expected a four-character tag')
+)
const textPropsSchema = v.object({
// Read by TEXT_DECORATION_STYLE, so an unknown style warns rather than failing the render.
@@ -40,6 +46,19 @@ const textPropsSchema = v.object({
textDecorationThickness: v.optional(autoLengthSchema),
textUnderlineOffset: v.optional(autoLengthSchema),
textDecorationSkipInk: v.optional(v.boolean()),
+ fontFeatures: v.optional(
+ v.pipe(
+ v.record(openTypeTagSchema, v.boolean()),
+ // Tags are stored in capitals, so `liga` and `LIGA` are the same feature.
+ v.check((features) => {
+ const tags = Object.keys(features)
+ return uniqBy(tags, (tag) => tag.toUpperCase()).length === tags.length
+ }, 'Expected each feature tag once, in any case')
+ )
+ ),
+ fontVariations: v.optional(v.record(openTypeTagSchema, lengthSchema)),
+ lang: v.optional(v.nullable(v.pipe(v.string(), v.trim(), v.nonEmpty()))),
+ fontOpticalSizing: v.optional(v.picklist([AUTO, 'none'])),
paragraphSpacing: v.optional(lengthSchema),
listSpacing: v.optional(lengthSchema),
paragraphIndent: v.optional(lengthSchema),
@@ -50,7 +69,10 @@ function autoLength(value: number | typeof AUTO): number | null {
return value === AUTO ? null : value
}
-/** The decoration details and text-wide paragraph spacing a `<Text>` or `<Span>` sets. */
+/**
+ * The decoration details, font settings, and text-wide paragraph spacing a `<Text>` or `<Span>`
+ * sets. Font settings replace the ones around them as a whole, as CSS's do.
+ */
export function applyTextDetailOverrides(
props: Record<string, unknown>,
o: Partial<SceneNode>
@@ -71,6 +93,22 @@ export function applyTextDetailOverrides(
o.textUnderlineOffset = autoLength(parsed.textUnderlineOffset)
if (parsed.textDecorationSkipInk !== undefined)
o.textDecorationSkipInk = parsed.textDecorationSkipInk
+ if (parsed.fontFeatures) {
+ // The scene keeps feature tags as Figma does, in capitals.
+ o.fontFeatures = Object.entries(parsed.fontFeatures).map(([tag, enabled]) => ({
+ tag: tag.toUpperCase(),
+ enabled
+ }))
+ }
+ if (parsed.fontVariations) {
+ o.fontVariations = Object.entries(parsed.fontVariations).map(([axis, value]) => ({
+ axis,
+ value
+ }))
+ }
+ if (parsed.lang !== undefined) o.textLanguage = parsed.lang
+ if (parsed.fontOpticalSizing !== undefined)
+ o.opticalSizeFromFontSize = parsed.fontOpticalSizing === AUTO
if (parsed.paragraphSpacing !== undefined) o.paragraphSpacing = parsed.paragraphSpacing
if (parsed.listSpacing !== undefined) o.listSpacing = parsed.listSpacing
if (parsed.paragraphIndent !== undefined) o.paragraphIndent = parsed.paragraphIndent
diff --git a/packages/design-jsx/src/reference/authoring.md b/packages/design-jsx/src/reference/authoring.md
index c04c0c349..b76634c2b 100644
--- a/packages/design-jsx/src/reference/authoring.md
+++ b/packages/design-jsx/src/reference/authoring.md
@@ -23,8 +23,8 @@ This reference describes scene creation, not React DOM output. Use the `render`
- `rounded` and `roundedTL`/`roundedTR`/`roundedBL`/`roundedBR` control corners. `strokeWidth`, `opacity`, `rotate`, and `blendMode` control appearance. `overflow="hidden"` clips content; do not hide accidental text overflow to make a broken layout appear correct.
- `rotate` turns a layer by degrees, and `flipX` and `flipY` reflect it across its centre before it turns, as the canvas places it. `Star` takes `points` and `innerRadius` (0–1, how deep its points go); `Polygon` takes `points`. `Ellipse` draws an arc or a donut with `startAngle` and `endAngle` in degrees, clockwise from three o'clock (0 to 360 by default), and `innerRadius` (0–1, the hole): `<Ellipse w={80} h={80} startAngle={0} endAngle={270} innerRadius={0.6} />`.
- `effects` accepts structured effects such as `dropShadow`, `innerShadow`, and `layerBlur`. `shadow` takes a CSS `box-shadow` list, such as `shadow="0 4 8 #0002, inset 0 1 0 #fff"`, and `blur` a layer blur radius; both are convenient shorthands. Effect helpers take `radius`, as Figma's effects do; when a JSX string is rendered, an option a paint or effect helper does not support is reported as a warning.
-- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.
-- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, and `textCase`. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.
+- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `fontFeatures` turns OpenType features on or off by tag (`fontFeatures={{ tnum: true, liga: false }}`), `fontVariations` sets variable-font axes by tag (`fontVariations={{ wght: 650 }}`), and `lang` names the text's language (`lang="de"`) for shaping and font fallback. A variable font's optical size follows the font size unless `fontOpticalSizing="none"`, as in CSS; only then does an `opsz` in `fontVariations` apply. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.
+- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, `fontFeatures`, `fontVariations`, `lang`, and `textCase`; a span's `fontFeatures` and `fontVariations` replace the text's rather than adding to them, and `fontOpticalSizing` is set on the `Text` for all of it. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.
- `Icon` uses an Iconify name, size, and color. Prefer icons to emoji when reliable vector output is needed. Image fills belong on appropriate leaf shapes, not containers whose children must remain visible.
- `Sticky` makes a FigJam sticky note whose text is its body: `<Sticky color="yellow" author="Ada">Ship it</Sticky>`. `color` takes a FigJam palette name (`white`, `gray`, `red`, `orange`, `yellow`, `green`, `teal`, `blue`, `violet`, `pink`) or any colour, `author` signs it (`authorVisible={false}` hides the line), `wide` makes it 416 wide instead of 240, `textSize` is `small`, `medium`, `large`, `extraLarge`, or `huge`, `typeface` is `simple`, `bookish`, `technical`, or `scribbled`, and `scale` scales the whole note. A note sizes itself; it takes no `w`, `h`, fills, or layout props.
- `Shape` makes a FigJam shape with text whose text is its label: `<Shape kind="diamond" bg="#FFC943">Valid?</Shape>`. `kind` is `square` (default), `ellipse`, `diamond`, `rounded_rectangle`, `parallelogram_right`, `eng_database`, or another FigJam shape, written in lowercase. `w` and `h` are the size it is given (176 by default); it grows taller to fit its label, never wider, so a word too long for it breaks. `truncate` keeps its height and cuts the label off with "…" instead, as FigJam does once a shape's height is set. `bg`, `stroke`, `strokeWidth`, `rounded` (6 by default), and `rotate` style it as any layer; the label is centred in the shape and takes the same `textSize` and `typeface` as `Sticky`.
diff --git a/packages/design-jsx/src/text-content.ts b/packages/design-jsx/src/text-content.ts
index bbc04c237..1f15cb751 100644
--- a/packages/design-jsx/src/text-content.ts
+++ b/packages/design-jsx/src/text-content.ts
@@ -44,6 +44,9 @@ export const SPAN_STYLE_FIELDS = [
'textDecorationThickness',
'textUnderlineOffset',
'textDecorationSkipInk',
+ 'fontFeatures',
+ 'fontVariations',
+ 'textLanguage',
'textCase'
] as const satisfies readonly (keyof CharacterStyleOverride & keyof SceneNode)[]
diff --git a/packages/design-jsx/src/tree.ts b/packages/design-jsx/src/tree.ts
index 53b7da12d..3c2daa3b9 100644
--- a/packages/design-jsx/src/tree.ts
+++ b/packages/design-jsx/src/tree.ts
@@ -175,6 +175,17 @@ export type StyleProps = {
lineHeight?: number | `${number}%` | 'auto' | DesignVariable
/** Pixels, or a percent of the font size such as `'5%'`. */
letterSpacing?: number | `${number}%` | DesignVariable
+ /** OpenType features on or off by tag, as CSS's `font-feature-settings`: `{ tnum: true }`. */
+ fontFeatures?: Record<string, boolean>
+ /** Variable-font axis values by tag, as CSS's `font-variation-settings`: `{ wght: 650 }`. */
+ fontVariations?: Record<string, number>
+ /** The language the text is in, as a BCP 47 tag such as `de` or `sr-Latn`. */
+ lang?: string | null
+ /**
+ * Whether a variable font's optical size follows the font size (`auto`, the default) or takes
+ * the `opsz` in `fontVariations` (`none`), as CSS's `font-optical-sizing`.
+ */
+ fontOpticalSizing?: 'auto' | 'none'
font?: string
fontFamily?: string
weight?: number | 'bold' | 'medium' | 'normal'
@@ -226,6 +237,9 @@ export type SpanProps = Pick<
| 'fills'
| 'lineHeight'
| 'letterSpacing'
+ | 'fontFeatures'
+ | 'fontVariations'
+ | 'lang'
> & {
key?: string | number
style?: Record<string, unknown>
diff --git a/packages/design-jsx/tests/export/text.test.ts b/packages/design-jsx/tests/export/text.test.ts
index 7880370f4..9248ab571 100644
--- a/packages/design-jsx/tests/export/text.test.ts
+++ b/packages/design-jsx/tests/export/text.test.ts
@@ -114,6 +114,40 @@ describe('rich text export', () => {
)
})
+ test('writes font settings on the text and on spans', () => {
+ const code = exportText({
+ text: 'ab',
+ fontFeatures: [{ tag: 'LIGA', enabled: false }],
+ fontVariations: [{ axis: 'wght', value: 450 }],
+ textLanguage: 'en',
+ styleRuns: [
+ {
+ start: 1,
+ length: 1,
+ style: {
+ fontFeatures: [{ tag: 'TNUM', enabled: true }],
+ fontVariations: [{ axis: 'wght', value: 650 }],
+ textLanguage: 'de'
+ }
+ }
+ ]
+ })
+ expect(code).toBe(
+ '<Text name="Note" color="#000000" fontFeatures={{ liga: false }} fontVariations={{ wght: 450 }} lang="en">a<Span fontFeatures={{ tnum: true }} fontVariations={{ wght: 650 }} lang="de">b</Span></Text>'
+ )
+ })
+
+ test('writes an optical size that does not follow the font size', () => {
+ const code = exportText({
+ text: 'a',
+ fontVariations: [{ axis: 'opsz', value: 14 }],
+ opticalSizeFromFontSize: false
+ })
+ expect(code).toBe(
+ '<Text name="Note" color="#000000" fontVariations={{ opsz: 14 }} fontOpticalSizing="none">a</Text>'
+ )
+ })
+
test('writes a percent of the font size as a percent string', () => {
const code = exportText({
text: 'ab',
diff --git a/packages/design-jsx/tests/text-content.test.ts b/packages/design-jsx/tests/text-content.test.ts
index 0057e33e6..facb393bd 100644
--- a/packages/design-jsx/tests/text-content.test.ts
+++ b/packages/design-jsx/tests/text-content.test.ts
@@ -112,6 +112,55 @@ describe('Span', () => {
expect(warnings).toEqual([])
})
+ test('takes font features, variations, and language', async () => {
+ const { node, warnings } = await renderText(
+ '<Text fontFeatures={{ liga: false }} fontVariations={{ wght: 450 }} lang="en">a<Span fontFeatures={{ tnum: true, liga: false }} fontVariations={{ wght: 650, wdth: 90 }} lang="de">b</Span></Text>'
+ )
+ expect(node.fontFeatures).toEqual([{ tag: 'LIGA', enabled: false }])
+ expect(node.fontVariations).toEqual([{ axis: 'wght', value: 450 }])
+ expect(node.textLanguage).toBe('en')
+ expect(node.styleRuns).toEqual([
+ {
+ start: 1,
+ length: 1,
+ style: {
+ fontFeatures: [
+ { tag: 'TNUM', enabled: true },
+ { tag: 'LIGA', enabled: false }
+ ],
+ fontVariations: [
+ { axis: 'wght', value: 650 },
+ { axis: 'wdth', value: 90 }
+ ],
+ textLanguage: 'de'
+ }
+ }
+ ])
+ expect(warnings).toEqual([])
+ })
+
+ test('takes the optical size from fontVariations only with fontOpticalSizing none', async () => {
+ const { node } = await renderText(
+ '<Text fontOpticalSizing="none" fontVariations={{ opsz: 14 }}>a</Text>'
+ )
+ expect(node.opticalSizeFromFontSize).toBe(false)
+ expect(node.fontVariations).toEqual([{ axis: 'opsz', value: 14 }])
+ const auto = await renderText('<Text fontVariations={{ opsz: 14 }}>a</Text>')
+ expect(auto.node.opticalSizeFromFontSize).toBe(true)
+ })
+
+ test('rejects a feature tag given twice in different cases', async () => {
+ await expect(
+ renderText('<Text fontFeatures={{ liga: true, LIGA: false }}>a</Text>')
+ ).rejects.toThrow('Expected each feature tag once')
+ })
+
+ test('rejects a font setting tag that is not four characters', async () => {
+ await expect(renderText('<Text fontFeatures={{ tabular: true }}>a</Text>')).rejects.toThrow(
+ 'Invalid <Text> props'
+ )
+ })
+
test('warns about a decoration style it cannot draw', async () => {
const { node, warnings } = await renderText('<Text textDecorationStyle="dashed">a</Text>')
expect(node.textDecorationStyle).toBe('SOLID')
diff --git a/packages/docs/reference/design-authoring.md b/packages/docs/reference/design-authoring.md
index 2d63d6d75..90e010765 100644
--- a/packages/docs/reference/design-authoring.md
+++ b/packages/docs/reference/design-authoring.md
@@ -25,8 +25,8 @@ This reference describes scene creation, not React DOM output. Use the `render`
- `rounded` and `roundedTL`/`roundedTR`/`roundedBL`/`roundedBR` control corners. `strokeWidth`, `opacity`, `rotate`, and `blendMode` control appearance. `overflow="hidden"` clips content; do not hide accidental text overflow to make a broken layout appear correct.
- `rotate` turns a layer by degrees, and `flipX` and `flipY` reflect it across its centre before it turns, as the canvas places it. `Star` takes `points` and `innerRadius` (0–1, how deep its points go); `Polygon` takes `points`. `Ellipse` draws an arc or a donut with `startAngle` and `endAngle` in degrees, clockwise from three o'clock (0 to 360 by default), and `innerRadius` (0–1, the hole): `<Ellipse w={80} h={80} startAngle={0} endAngle={270} innerRadius={0.6} />`.
- `effects` accepts structured effects such as `dropShadow`, `innerShadow`, and `layerBlur`. `shadow` takes a CSS `box-shadow` list, such as `shadow="0 4 8 #0002, inset 0 1 0 #fff"`, and `blur` a layer blur radius; both are convenient shorthands. Effect helpers take `radius`, as Figma's effects do; when a JSX string is rendered, an option a paint or effect helper does not support is reported as a warning.
-- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.
-- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, and `textCase`. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.
+- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `fontFeatures` turns OpenType features on or off by tag (`fontFeatures={{ tnum: true, liga: false }}`), `fontVariations` sets variable-font axes by tag (`fontVariations={{ wght: 650 }}`), and `lang` names the text's language (`lang="de"`) for shaping and font fallback. A variable font's optical size follows the font size unless `fontOpticalSizing="none"`, as in CSS; only then does an `opsz` in `fontVariations` apply. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.
+- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, `fontFeatures`, `fontVariations`, `lang`, and `textCase`; a span's `fontFeatures` and `fontVariations` replace the text's rather than adding to them, and `fontOpticalSizing` is set on the `Text` for all of it. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.
- `Icon` uses an Iconify name, size, and color. Prefer icons to emoji when reliable vector output is needed. Image fills belong on appropriate leaf shapes, not containers whose children must remain visible.
- `Sticky` makes a FigJam sticky note whose text is its body: `<Sticky color="yellow" author="Ada">Ship it</Sticky>`. `color` takes a FigJam palette name (`white`, `gray`, `red`, `orange`, `yellow`, `green`, `teal`, `blue`, `violet`, `pink`) or any colour, `author` signs it (`authorVisible={false}` hides the line), `wide` makes it 416 wide instead of 240, `textSize` is `small`, `medium`, `large`, `extraLarge`, or `huge`, `typeface` is `simple`, `bookish`, `technical`, or `scribbled`, and `scale` scales the whole note. A note sizes itself; it takes no `w`, `h`, fills, or layout props.
- `Shape` makes a FigJam shape with text whose text is its label: `<Shape kind="diamond" bg="#FFC943">Valid?</Shape>`. `kind` is `square` (default), `ellipse`, `diamond`, `rounded_rectangle`, `parallelogram_right`, `eng_database`, or another FigJam shape, written in lowercase. `w` and `h` are the size it is given (176 by default); it grows taller to fit its label, never wider, so a word too long for it breaks. `truncate` keeps its height and cuts the label off with "…" instead, as FigJam does once a shape's height is set. `bg`, `stroke`, `strokeWidth`, `rounded` (6 by default), and `rotate` style it as any layer; the label is centred in the shape and takes the same `textSize` and `typeface` as `Sticky`.
@@ -132,4 +132,4 @@ Generated from the renderer metadata. This inventory lists accepted names, not a
**Helpers:** `solid`, `gradient`, `linearGradient`, `radialGradient`, `angularGradient`, `diamondGradient`, `shader`, `dropShadow`, `innerShadow`, `layerBlur`, `backgroundBlur`, `foregroundBlur`, `defineVars`, `defineMode`, `designVar`, `designMode`, `property`, `ref`.
-**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `flipX`, `flipY`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `startAngle`, `endAngle`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `of`, `exposed`, `mode`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.
\ No newline at end of file
+**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `flipX`, `flipY`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `fontFeatures`, `fontVariations`, `lang`, `fontOpticalSizing`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `startAngle`, `endAngle`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `of`, `exposed`, `mode`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.
\ No newline at end of file
diff --git a/skills/open-pencil/references/design-authoring.md b/skills/open-pencil/references/design-authoring.md
index 2d63d6d75..90e010765 100644
--- a/skills/open-pencil/references/design-authoring.md
+++ b/skills/open-pencil/references/design-authoring.md
@@ -25,8 +25,8 @@ This reference describes scene creation, not React DOM output. Use the `render`
- `rounded` and `roundedTL`/`roundedTR`/`roundedBL`/`roundedBR` control corners. `strokeWidth`, `opacity`, `rotate`, and `blendMode` control appearance. `overflow="hidden"` clips content; do not hide accidental text overflow to make a broken layout appear correct.
- `rotate` turns a layer by degrees, and `flipX` and `flipY` reflect it across its centre before it turns, as the canvas places it. `Star` takes `points` and `innerRadius` (0–1, how deep its points go); `Polygon` takes `points`. `Ellipse` draws an arc or a donut with `startAngle` and `endAngle` in degrees, clockwise from three o'clock (0 to 360 by default), and `innerRadius` (0–1, the hole): `<Ellipse w={80} h={80} startAngle={0} endAngle={270} innerRadius={0.6} />`.
- `effects` accepts structured effects such as `dropShadow`, `innerShadow`, and `layerBlur`. `shadow` takes a CSS `box-shadow` list, such as `shadow="0 4 8 #0002, inset 0 1 0 #fff"`, and `blur` a layer blur radius; both are convenient shorthands. Effect helpers take `radius`, as Figma's effects do; when a JSX string is rendered, an option a paint or effect helper does not support is reported as a warning.
-- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.
-- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, and `textCase`. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.
+- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `fontFeatures` turns OpenType features on or off by tag (`fontFeatures={{ tnum: true, liga: false }}`), `fontVariations` sets variable-font axes by tag (`fontVariations={{ wght: 650 }}`), and `lang` names the text's language (`lang="de"`) for shaping and font fallback. A variable font's optical size follows the font size unless `fontOpticalSizing="none"`, as in CSS; only then does an `opsz` in `fontVariations` apply. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.
+- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, `fontFeatures`, `fontVariations`, `lang`, and `textCase`; a span's `fontFeatures` and `fontVariations` replace the text's rather than adding to them, and `fontOpticalSizing` is set on the `Text` for all of it. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.
- `Icon` uses an Iconify name, size, and color. Prefer icons to emoji when reliable vector output is needed. Image fills belong on appropriate leaf shapes, not containers whose children must remain visible.
- `Sticky` makes a FigJam sticky note whose text is its body: `<Sticky color="yellow" author="Ada">Ship it</Sticky>`. `color` takes a FigJam palette name (`white`, `gray`, `red`, `orange`, `yellow`, `green`, `teal`, `blue`, `violet`, `pink`) or any colour, `author` signs it (`authorVisible={false}` hides the line), `wide` makes it 416 wide instead of 240, `textSize` is `small`, `medium`, `large`, `extraLarge`, or `huge`, `typeface` is `simple`, `bookish`, `technical`, or `scribbled`, and `scale` scales the whole note. A note sizes itself; it takes no `w`, `h`, fills, or layout props.
- `Shape` makes a FigJam shape with text whose text is its label: `<Shape kind="diamond" bg="#FFC943">Valid?</Shape>`. `kind` is `square` (default), `ellipse`, `diamond`, `rounded_rectangle`, `parallelogram_right`, `eng_database`, or another FigJam shape, written in lowercase. `w` and `h` are the size it is given (176 by default); it grows taller to fit its label, never wider, so a word too long for it breaks. `truncate` keeps its height and cuts the label off with "…" instead, as FigJam does once a shape's height is set. `bg`, `stroke`, `strokeWidth`, `rounded` (6 by default), and `rotate` style it as any layer; the label is centred in the shape and takes the same `textSize` and `typeface` as `Sticky`.
@@ -132,4 +132,4 @@ Generated from the renderer metadata. This inventory lists accepted names, not a
**Helpers:** `solid`, `gradient`, `linearGradient`, `radialGradient`, `angularGradient`, `diamondGradient`, `shader`, `dropShadow`, `innerShadow`, `layerBlur`, `backgroundBlur`, `foregroundBlur`, `defineVars`, `defineMode`, `designVar`, `designMode`, `property`, `ref`.
-**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `flipX`, `flipY`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `startAngle`, `endAngle`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `of`, `exposed`, `mode`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.
\ No newline at end of file
+**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `flipX`, `flipY`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `fontFeatures`, `fontVariations`, `lang`, `fontOpticalSizing`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `startAngle`, `endAngle`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `of`, `exposed`, `mode`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.
\ No newline at end of file