Text Layout
Resolves text into a reusable glyph layout without rasterizing it
intermediate
Since P00
Input Ports
Text
未接続時は `text` パラメータを使う
Output Ports
Layout
glyph 単位の位置・行情報・解決フォントを含む構造化テキストレイアウト
Character Count
生成したレイアウトの文字数。v1 では glyph 数 = ほぼ 1文字数
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| Text | `Text` | `PixPipeline` | `text` 入力未接続時の文字列 |
| Source Mode | `Enum` | `SystemFamily` | システムフォント参照か、フォントファイル参照か |
| Family Name | `Text` | `Segoe UI` | システムフォント名。FontFile 時は任意 override としても使える |
| Font File | `FilePath` | 空 | `FontFile` モード時のローカル TTF / OTF / TTC |
| Fallback Family | `Text` | `Arial` | 指定フォントが解決できない時に使う fallback |
| Pixel Size | `Int` | `24` | ピクセル単位のフォントサイズ |
| Tracking | `Int` | `0` | 文字間に追加するピクセル間隔 |
| Line Height | `Float` | `1.0` | フォントメトリクスに対する行送り倍率 |
| Align | `Enum` | `Left` | 自動計算した文字領域内の横方向揃え |
Technical Details
TextLayoutは wire-only formal type で、変数パネルから直接は作らない- フォントバイナリは保持せず、font reference + layout 結果のみを保存する
- glyph 単位は v1 では Rust
text.chars()ベースの Unicode scalar 単位 character_countは v1 ではglyphs.len()をそのままIntで出す- Colorやアンチエイリアスや padding は持たず、後段の
Text Rasterize v2側が担当する
デバッグ表示
- Inspector には
文字レイアウト(デバッグ)セクションが出ます - ここでは glyph ごとの index と bbox を確認できます
TextRevealByGlyphやTextAnimateByGlyphの結果も、同じTextLayout出力として同じ表示で確認できますtranslateやscaleはデバッグ用の近似 bbox で表示されます
Usage Examples
[Text Input] -> [Text Layout] -> [Text Rasterize v2][Text Input] -> [Text Layout] -> [Text Reveal By Glyph][Text Input] -> [Text Layout]
└-> [文字数] -> [割り算] -> [1文字刻み進行度]💡 Tips
- •`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` 側が担当する
Related Nodes
text-input
text-rasterize-v2
text-reveal-by-glyph