Back to Node List

Text Layout

text_layout

Resolves text into a reusable glyph layout without rasterizing it

Draft
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
テキスト
text
Text
任意のテキスト入力。未接続時はテキストパラメータを使います。

Output Ports

NameTypeDescription
レイアウト
layout
TextLayout
後段の文字演出や画像化に使う構造化テキストレイアウト
文字数
character_count
Int
生成したレイアウトの文字数です(v1 では glyph 数)

Parameters

NameTypeDefaultRangeDescription / Options
テキスト
text
Text
PixPipeline

Text 入力が未接続の時に使う文字列

フォント参照
source_mode
Enum
SystemFamily

文字レイアウトに使うフォントの参照方法

  • システムフォントSystemFamily
    この PC で使えるシステムフォントを使います
  • フォントファイルFontFile
    ローカルの TTF/OTF/TTC を一時読み込みしてすぐレイアウトを生成します
ファミリ名
family_name
Text
Segoe UI

システムフォント名。フォントファイル使用時は任意のファミリ名上書きとしても使えます。

フォントファイル
font_path
FilePath

ローカルの TTF / OTF / TTC ファイルパス

フォールバック
fallback_family
Text
Arial

指定フォントを正確に解決できない時に使うフォールバックファミリ

文字サイズ
pixel_size
Int
244–256

ピクセル単位のフォントサイズ

字間
tracking
Int
0-16–64

文字ごとに追加する字間

行送り
line_height
Float
10.5–3 / step 0.05

フォントメトリクスに対する行送り倍率

揃え
align
Enum
Left

自動計算された文字領域内での横方向揃え

  • 左寄せLeft
  • 中央寄せCenter
  • 右寄せRight

技術詳細

  • TextLayout は wire-only formal type で、変数パネルから直接は作らない
  • フォントバイナリは保持せず、font reference + layout 結果のみを保存する
  • glyph 単位は v1 では Rust text.chars() ベースの Unicode scalar 単位
  • character_count は v1 では glyphs.len() をそのまま Int で出す
  • 色やアンチエイリアスや padding は持たず、後段の Text Rasterize v2 側が担当する

デバッグ表示

  • Inspector には 文字レイアウト(デバッグ) セクションが出ます
  • ここでは glyph ごとの index と bbox を確認できます
  • TextRevealByGlyphTextAnimateByGlyph の結果も、同じ TextLayout 出力として同じ表示で確認できます
  • translatescale はデバッグ用の近似 bbox で表示されます

使用例

[Text Input] -> [Text Layout] -> [Text Rasterize v2]
[Text Input] -> [Text Layout] -> [Text Reveal By Glyph]
[Text Input] -> [Text Layout]
                    └-> [文字数] -> [割り算] -> [1文字刻み進行度]
Back to Node List
Text Layout — PixPipeline Node Reference