Render package font outlines in the shared Text primitive

This commit is contained in:
chasse20 committed 2026-11-23 07:14:50 -05:00
1 parent 7b33ade938
commit 3ac2f1b61f
12 files changed
+386 -14

No files matched your search

Generated
+71 -8
View File
@@ -863,6 +863,20 @@ dependencies = [
"rfd",
]
[[package]]
name = "craft-font-catalog"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=453b0da782ccef39be9a6dac8d27c80b553ef1cc#453b0da782ccef39be9a6dac8d27c80b553ef1cc"
dependencies = [
"harfrust 0.13.3",
"kurbo",
"skrifa 0.47.0",
"thiserror 2.0.21",
"unicode-bidi",
"unicode-segmentation",
"windows-registry",
]
[[package]]
name = "craft-fonts-build"
version = "0.1.0"
@@ -1055,7 +1069,7 @@ dependencies = [
"objc2-app-kit 0.3.2",
"objc2-foundation 0.3.2",
"serde",
"skrifa",
"skrifa 0.44.0",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
@@ -1576,14 +1590,14 @@ dependencies = [
"emath",
"epaint_default_fonts",
"font-types",
"harfrust",
"harfrust 0.12.0",
"log",
"nohash-hasher",
"parking_lot",
"profiling",
"self_cell",
"serde",
"skrifa",
"skrifa 0.44.0",
"smallvec",
"unicode-bidi",
"unicode-general-category",
@@ -2033,7 +2047,7 @@ dependencies = [
"hashbrown 0.17.1",
"log",
"peniko",
"skrifa",
"skrifa 0.44.0",
"smallvec",
"vello_common",
]
@@ -2159,7 +2173,20 @@ checksum = "c03d949a14aa089bbb282f7dd76a498a7f684428e4257202efc119ec010376f9"
dependencies = [
"bitflags 2.13.2",
"bytemuck",
"read-fonts",
"read-fonts 0.41.0",
"smallvec",
]
[[package]]
name = "harfrust"
version = "0.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "948d0741125ba89cd3e1c23e5642415b6ade7e1d29d67ba25fb925b533e989d6"
dependencies = [
"bitflags 2.13.2",
"bytemuck",
"once_cell",
"read-fonts 0.43.3",
"smallvec",
]
@@ -2919,10 +2946,14 @@ dependencies = [
name = "materialcraft-nodes"
version = "0.4.1"
dependencies = [
"craft-font-catalog",
"craft-texture",
"half",
"harfrust 0.13.3",
"materialcraft-core",
"rayon",
"unicode-bidi",
"vello_cpu",
]
[[package]]
@@ -4051,6 +4082,28 @@ dependencies = [
"once_cell",
]
[[package]]
name = "read-fonts"
version = "0.43.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "005c8acf251756c478b0bf402885bfd88a1476020c4c7e6060edc1aa68da38ea"
dependencies = [
"bytemuck",
"font-types",
"once_cell",
]
[[package]]
name = "read-fonts"
version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5a0cf4bb6cbce4c29756270d189a5e400ac05e91192161d83a0bcb6e68492e8"
dependencies = [
"bytemuck",
"font-types",
"once_cell",
]
[[package]]
name = "reborrow"
version = "0.5.5"
@@ -4635,7 +4688,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819ab7d62b1d3e72d9d9dea5650bac30424f9111364bb94928dbf5ecad1baa68"
dependencies = [
"bytemuck",
"read-fonts",
"read-fonts 0.41.0",
]
[[package]]
name = "skrifa"
version = "0.47.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "526e654b303ff4ad73a5a40b25de2b3ce3d039c5e3b6da5f89ae6e57004cb40f"
dependencies = [
"bytemuck",
"read-fonts 0.44.0",
]
[[package]]
@@ -5236,7 +5299,7 @@ dependencies = [
"base64 0.23.1",
"data-url",
"fontdb",
"harfrust",
"harfrust 0.12.0",
"imagesize",
"kurbo",
"log",
@@ -5244,7 +5307,7 @@ dependencies = [
"roxmltree 0.21.2",
"simplecss",
"siphasher",
"skrifa",
"skrifa 0.44.0",
"strict-num",
"svgtypes",
"tiny-skia-path",
+4
View File
@@ -88,6 +88,10 @@ getrandom = "0.3"
egui_kittest = "0.37"
craft-mcmat = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc" }
craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", features = ["serde"] }
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", default-features = false }
harfrust = "0.13"
unicode-bidi = "0.3.18"
vello_cpu = { version = "0.2", default-features = false, features = ["std", "u8_pipeline"] }
# Keyboard bindings (chords, dispatch and display text): storytold/craft-libs, MIT OR Apache-2.0
craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "453b0da782ccef39be9a6dac8d27c80b553ef1cc", features = ["egui"] }
# Native dialogs that do not block the event loop: storytold/craft-libs, MIT OR Apache-2.0
+12 -1
View File
@@ -50,6 +50,10 @@ pub(crate) fn graph_tree_hash(package: &Package, graph_index: usize) -> u64 {
graph_tree_hash_with_registry(package, package, graph_index)
}
pub(crate) fn resource_parameter(node: &Node) -> &'static str {
if node.def == "text" { "fontdata" } else { "resource" }
}
pub(crate) fn graph_tree_hash_with_registry(registry: &Package, package: &Package, graph_index: usize) -> u64 {
let mut hasher = DefaultHasher::new();
let mut pending = vec![(package, graph_index)];
@@ -79,7 +83,14 @@ pub(crate) fn graph_tree_hash_with_registry(registry: &Package, package: &Packag
}
for node in &graph.nodes {
if let Some(Value::Text(name)) = node.params.get("resource") {
let parameter = resource_parameter(node);
if node.bindings.contains_key(parameter) || node.functions.contains_key(parameter) {
// The caller may select another package resource when this instance runs.
for resource in &package.resources {
resource.name.hash(&mut hasher);
resource.bytes.content_hash().hash(&mut hasher);
}
} else if let Some(Value::Text(name)) = node.params.get(parameter) {
package.resource(name).map(|resource| resource.bytes.content_hash()).hash(&mut hasher);
}
if node.def == "graph_instance"
+6 -1
View File
@@ -200,7 +200,7 @@ pub(crate) fn cook_node(
Some((image, None, bitmap, false))
});
let wired = options.depth != 0 && input_image.as_ref().is_some_and(|(_, upstream, _, _)| upstream.is_some());
let resource_hash = match parameters.get("resource") {
let resource_hash = match parameters.get(crate::cache_key::resource_parameter(node)) {
Some(Value::Text(name)) => package.resource(name).map_or(0, |r| r.bytes.content_hash()),
_ => 0,
};
@@ -326,6 +326,11 @@ pub(crate) fn cook_node(
} else {
let result = if node.def == "fx_map" {
materialcraft_nodes::pattern::cook_with_base_level_inputs(&context, &base_level_only)
} else if node.def == "text"
&& !context.text("fontdata").is_empty()
&& let Some(font) = package.resource(context.text("fontdata"))
{
materialcraft_nodes::atomic::text_with_font(&context, font.bytes.as_slice())
} else if dynamic_blend_opacity {
materialcraft_nodes::atomic::blend_with_opacity(&context, true)
} else {
+2
View File
@@ -1,3 +1,5 @@
mod font_resource;
use crate::{cache_key::graph_tree_hash, graph_instance::instances_reach};
use craft_texture::{Image, Kind, Limits};
use materialcraft_core::{NodeId, Package, Value};
+93
View File
@@ -0,0 +1,93 @@
use super::*;
use materialcraft_core::{OutputFormat, Resource, ResourceBytes};
/// A two-glyph TrueType face. U+0041 is a rectangle with a variable cap height.
fn rectangle_font(height: i16) -> Vec<u8> {
fn words(values: &[i16]) -> Vec<u8> {
values.iter().flat_map(|value| value.to_be_bytes()).collect()
}
fn checksum(data: &[u8]) -> u32 {
data.chunks(4).fold(0u32, |sum, chunk| {
let mut word = [0; 4];
word[..chunk.len()].copy_from_slice(chunk);
sum.wrapping_add(u32::from_be_bytes(word))
})
}
let mut head = vec![0; 54];
head[..4].copy_from_slice(&0x10000u32.to_be_bytes());
head[12..16].copy_from_slice(&0x5f0f3cf5u32.to_be_bytes());
head[18..20].copy_from_slice(&1024i16.to_be_bytes());
head[40..44].copy_from_slice(&words(&[512, height]));
let mut hhea = vec![0; 36];
hhea[..4].copy_from_slice(&0x10000u32.to_be_bytes());
hhea[4..12].copy_from_slice(&words(&[768, -256, 0, 640]));
hhea[34..].copy_from_slice(&2i16.to_be_bytes());
let mut maxp = vec![0; 32];
maxp[..4].copy_from_slice(&0x10000u32.to_be_bytes());
maxp[4..10].copy_from_slice(&words(&[2, 4, 1]));
let mut cmap = words(&[0, 1, 3, 1, 0, 12]);
cmap.extend(words(&[4, 32, 0, 4, 4, 1, 0, 65, -1, 0, 65, -1, -64, 1, 0, 0]));
let mut glyf = words(&[1, 0, 0, 512, height, 3, 0]);
glyf.extend([1; 4]);
glyf.extend(words(&[0, 0, 512, 0, 0, height, 0, -height]));
let loca = words(&[0, 0, (glyf.len() / 2) as i16]);
let tables = [(b"cmap", cmap), (b"glyf", glyf), (b"head", head), (b"hhea", hhea), (b"hmtx", words(&[640, 0, 640, 0])), (b"loca", loca), (b"maxp", maxp)];
let mut font = words(&[1, 0, 7, 64, 2, 48]);
font.resize(12 + 16 * tables.len(), 0);
let mut head_start = 0;
for (index, (tag, data)) in tables.into_iter().enumerate() {
let offset = font.len();
if tag == b"head" {
head_start = offset;
}
let entry = &mut font[12 + 16 * index..12 + 16 * (index + 1)];
entry[..4].copy_from_slice(tag);
entry[4..8].copy_from_slice(&checksum(&data).to_be_bytes());
entry[8..12].copy_from_slice(&(offset as u32).to_be_bytes());
entry[12..].copy_from_slice(&(data.len() as u32).to_be_bytes());
font.extend(data);
font.resize(font.len().next_multiple_of(4), 0);
}
let adjustment = 0xb1b0_afba_u32.wrapping_sub(checksum(&font));
font[head_start + 8..head_start + 12].copy_from_slice(&adjustment.to_be_bytes());
font
}
#[test]
fn package_font_outlines_render_and_invalidate_the_parent_instance() {
let (mut parent, instance) = instancing("Preview", "Letter");
parent.size = [6, 5];
parent.format = OutputFormat::F32;
let mut child = Graph::new("Letter");
child.size = [6, 5];
let text = child.add_node("text", [0.0; 2]);
child.node_mut(text).unwrap().params.extend([
("text".into(), Value::Text("A".into())),
("fontdata".into(), Value::Text("Ink".into())),
("fontsize".into(), Value::Float(0.5)),
]);
let output = child.add_node("output", [100.0, 0.0]);
child.connect(text, "output", output, "input").unwrap();
let mut package = Package::new("Original lettering");
package.graphs = vec![parent, child];
package.resources.push(Resource::new("Ink", "Ink.ttf", ResourceBytes::new(rectangle_font(512))));
let cache = Mutex::new(Cache::default());
let options = Options::new(&no_res);
for (height, first_row) in [(512, 8), (256, 12)] {
package.resources[0].bytes = ResourceBytes::new(rectangle_font(height));
let direct = cook(&package, 1, &options, &cache);
assert!(direct.nodes[&text].error.is_none(), "{:?}", direct.nodes[&text].error);
let nested = cook(&package, 0, &options, &cache);
assert!(!nested.nodes[&instance].cached);
let image = nested.image(instance, 0).unwrap();
assert_eq!((image.width(), image.height()), (64, 32));
for y in 0..32 {
for x in 0..64 {
let ink = (24..40).contains(&x) && (first_row..16).contains(&y);
assert_eq!(image.get_gray(x, y, false), f32::from(ink), "({x}, {y}) at cap height {height}");
}
}
assert!(cook(&package, 0, &options, &cache).nodes[&instance].cached);
}
}
+4
View File
@@ -10,6 +10,10 @@ workspace = true
[dependencies]
materialcraft-core = { workspace = true }
craft-font-catalog = { workspace = true }
craft-texture = { workspace = true }
harfrust = { workspace = true }
unicode-bidi = { workspace = true }
vello_cpu = { workspace = true }
half = { workspace = true }
rayon = { workspace = true }
+172
View File
@@ -0,0 +1,172 @@
//! Render package font outlines in normalized text coordinates.
use std::collections::BTreeMap;
use craft_font_catalog::{FontOutline, RunGlyph, RunInput, ShapePlanCache, shape_run};
use harfrust::{Direction, Shaper};
use vello_cpu::{
Pixmap, RenderContext, Resources,
color::palette::css::WHITE,
kurbo::{Affine, BezPath, Rect, Shape},
};
use crate::{CookContext, CookResult, raster::composite};
// A short string can repeat a complex glyph across many wrapping tiles. Bound the
// outline storage and submitted path elements independently of the character count.
const MAX_ELEMENTS: usize = 1_000_000;
struct Glyph {
path: BezPath,
bounds: Rect,
}
fn shape_line(line: &str, shaper: &Shaper<'_>, plans: &ShapePlanCache) -> Result<Vec<RunGlyph>, String> {
let bidi = unicode_bidi::BidiInfo::new(line, None);
let mut glyphs = Vec::new();
for paragraph in &bidi.paragraphs {
let (levels, runs) = bidi.visual_runs(paragraph, paragraph.range.clone());
for range in runs {
let (Some(text), Some(before), Some(after)) = (line.get(range.clone()), line.get(..range.start), line.get(range.end..)) else {
return Err("invalid text shaping range".into());
};
let direction = if levels.get(range.start).is_some_and(|level| level.is_rtl()) { Direction::RightToLeft } else { Direction::LeftToRight };
let input = RunInput {
text,
source_start: range.start,
pre_context: before,
post_context: after,
direction,
language: None,
features: &[],
character_clusters: false,
uppercase: false,
};
let run = shape_run(shaper, &input, |ch| ch, |face, dir, script, lang, features| plans.get_or_create(face, None, dir, script, lang, features))
.map_err(|e| e.to_string())?;
glyphs.extend(run);
}
}
Ok(glyphs)
}
fn copies(low: f64, high: f64, period: f64, tiled: bool) -> Result<std::ops::RangeInclusive<i32>, String> {
if !tiled {
return Ok(0..=0);
}
let first = (-high / period).ceil();
let last = ((period - low) / period).floor();
if first < f64::from(i32::MIN) || last > f64::from(i32::MAX) {
return Err("text transform exceeds the tile coordinate range".into());
}
Ok(first as i32..=last as i32)
}
struct Drawing {
context: RenderContext,
width: u16,
height: u16,
tiled: [bool; 2],
remaining: usize,
}
impl Drawing {
fn glyph(&mut self, ink: &Glyph, transform: Affine) -> Result<(), String> {
if ink.path.elements().is_empty() {
return Ok(());
}
let (width, height) = (f64::from(self.width), f64::from(self.height));
let bounds = transform.transform_rect_bbox(ink.bounds);
if !bounds.is_finite() {
return Err("non-finite text outline transform".into());
}
let columns = copies(bounds.x0, bounds.x1, width, self.tiled[0])?;
let rows = copies(bounds.y0, bounds.y1, height, self.tiled[1])?;
if (!self.tiled[0] && (bounds.x1 <= 0.0 || bounds.x0 >= width)) || (!self.tiled[1] && (bounds.y1 <= 0.0 || bounds.y0 >= height)) {
return Ok(());
}
for row in rows {
for column in columns.clone() {
self.remaining = self.remaining.checked_sub(ink.path.elements().len()).ok_or("text outlines exceed the drawing budget")?;
let offset = Affine::translate((f64::from(column) * width, f64::from(row) * height));
self.context.set_transform(offset * transform);
self.context.fill_path(&ink.path);
}
}
Ok(())
}
}
/// Draw a Text node with the bytes of its resolved package font.
pub fn text_with_font(context: &CookContext<'_>, bytes: &[u8]) -> CookResult {
let face = FontOutline::from_bytes(bytes, 0, &[]).map_err(|e| e.to_string())?;
let metrics = face.metrics();
if metrics.units_per_em == 0 {
return Err("font has no design units per em".into());
}
let font = harfrust::FontRef::from_index(bytes, 0).map_err(|e| e.to_string())?;
let data = harfrust::ShaperData::new(&font);
let shaper = data.shaper(&font).build();
let plans = ShapePlanCache::default();
let (w, h) = craft_texture::clamp_size(context.w, context.h);
let width = u16::try_from(w).map_err(|_| "text width exceeds the raster size")?;
let height = u16::try_from(h).map_err(|_| "text height exceeds the raster size")?;
let mut drawing = Drawing { context: RenderContext::new(width, height), width, height, tiled: context.tiling_axes(), remaining: MAX_ELEMENTS };
drawing.context.set_paint(WHITE);
let [a, b, c, d] = context.v4("matrix").map(f64::from);
let inverse = if a * d == b * c { Affine::IDENTITY } else { Affine::new([a, b, c, d, 0.0, 0.0]).inverse() };
let [x, y] = context.v2("position").map(f64::from);
let scale = f64::from(context.f("fontsize").max(0.0)) / f64::from(metrics.units_per_em);
let frame = Affine::scale_non_uniform(f64::from(width), f64::from(height))
* Affine::translate((0.5 + x, 0.5 + y))
* inverse
* Affine::scale_non_uniform(scale, -scale);
if !frame.as_coeffs().into_iter().all(f64::is_finite) {
return Err("non-finite text transform".into());
}
let pitch = f64::from(metrics.ascent - metrics.descent + metrics.leading);
let text = context.text("text").chars().take(super::text::MAX_CHARS).collect::<String>().replace("\\n", "\n");
let mut cache = BTreeMap::new();
let mut outline_budget = MAX_ELEMENTS;
for (line_index, line) in text.split('\n').enumerate() {
let glyphs = shape_line(line, &shaper, &plans)?;
let mut cursor = 0.0;
let mut positions = Vec::with_capacity(glyphs.len());
let baseline = -(line_index as f64) * pitch;
let mut left = 0.0;
let mut right = 0.0;
for glyph in glyphs {
if let std::collections::btree_map::Entry::Vacant(entry) = cache.entry(glyph.glyph_id) {
let path = face.outline(glyph.glyph_id).map_err(|e| e.to_string())?;
outline_budget = outline_budget.checked_sub(path.elements().len()).ok_or("font exceeds the outline storage budget")?;
entry.insert(Glyph { bounds: path.bounding_box(), path });
}
let ink = cache.get(&glyph.glyph_id).ok_or("missing glyph outline")?;
let x = cursor + f64::from(glyph.x_offset);
if positions.is_empty() {
left = x + ink.bounds.x0;
}
right = x + ink.bounds.x1;
positions.push((glyph.glyph_id, x, baseline + f64::from(glyph.y_offset)));
cursor += f64::from(glyph.x_advance);
}
let shift = match context.i("alignment") {
0 => 0.0,
2 => left - right,
_ => (left - right) * 0.5,
};
for (id, x, y) in positions {
if let Some(ink) = cache.get(&id) {
drawing.glyph(ink, frame * Affine::translate((x + shift, y)))?;
}
}
}
let mut target = Pixmap::new(width, height);
drawing.context.flush();
drawing.context.render(&mut target, &mut Resources::new());
Ok(vec![composite(context, |x, y| {
let index = y as usize * usize::from(width) + x as usize;
let alpha = target.data().get(index).map_or(0.0, |pixel| f32::from(pixel.a) / 255.0);
[1.0, 1.0, 1.0, alpha]
})])
}
+2
View File
@@ -9,6 +9,7 @@ mod directional_warp;
mod distance;
mod dot;
mod emboss;
mod font;
mod gradient_dynamic;
mod gradient_map;
mod grayscale_conversion;
@@ -40,6 +41,7 @@ pub const ATOMIC: &str = "Atomic nodes";
pub const GRAPH_ITEMS: &str = "Graph items";
pub use blend::{blend_selected_input, blend_with_opacity};
pub use font::text_with_font;
pub use levels::levels_fn;
pub use normal::height_to_normal;
pub use output::output_kind;
+3 -3
View File
@@ -108,11 +108,11 @@ fn strokes(s: &str) -> impl Iterator<Item = Vec<[f32; 2]>> + '_ {
}
/// Longest text drawn (an allocation cap)
const MAX_CHARS: usize = 10_000;
pub(super) const MAX_CHARS: usize = 10_000;
pub(super) fn definition() -> NodeDefinition {
node("text", "Text", ATOMIC)
.desc("Draws text with a built-in single-stroke font (A–Z, a–z, 0–9, punctuation). \\n starts a new line.")
.desc("Draws text with the selected package font or the built-in single-stroke font. \\n starts a new line.")
.atomic()
.generator()
.any_in("background", "Background")
@@ -173,7 +173,7 @@ fn layout(context: &CookContext, text: &str) -> Vec<CapsuleSegment> {
fn text(context: &CookContext) -> CookResult {
if !context.text("fontdata").is_empty() {
return Err("external fonts are not supported yet; clear Font reference to use the built-in stroke font".into());
return Err(format!("font resource `{}` is unavailable", context.text("fontdata")));
}
let text: String = context.text("text").replace("\\n", "\n").chars().take(MAX_CHARS).collect();
+16
View File
@@ -59,6 +59,22 @@ The first pass classifies all 546 roots: 166 Parity and 380 Too hard. These meas
## 2026-11-23 root comparisons
### Package font outlines and point preview
The Text primitive reads the selected package font. Shaping and outline drawing use the shared font catalog and the CPU rasterizer. Editing the font bytes invalidates both the Text node and its parent graph instance. The release regression constructs a two-glyph TrueType face in memory, halves the cap height and checks the complete 64 × 32 raster on both cooks.
For the independent reference comparison, generate two faces with 1,024 units per em, ascent 768, descent −256 and letter advance 640. Give A a 512 × 512 rectangle in one face and a triangle with vertices (0, 0), (256, 768), (512, 0) in the other. Give B a rectangle from (64, 64) to (256, 704) and space an advance of 256. Render white text on black at 64², 64 × 32 and 32 × 64. Start with size .5, centered alignment, zero offset and an identity transform. Vary text including empty strings, spaces and newlines, size, alignment, fractional translation, rotation, shear, reflection, singular matrices and tiling. Compare raw F32 readbacks from the one-worker reference renderer.
| Comparison | Renders | Exact pixels / total | Maximum absolute error |
|---|---:|---:|---:|
| All original Text graphs | 96 | 261,686/262,144 | .584313781 |
| Six ordinary SBS saves reopened in both applications | 18 | 48,980/49,152 | .584313781 |
| Reference output before and after those saves | 18 | 49,152/49,152 | 0 |
All three resolutions match for 28 of 32 settings. The sheared triangle differs by at most 5.97e−8. The triangle's diagonal coverage accounts for the other three differing settings. For the six reopens, use centered A in both fonts, AB, AB followed by a newline and A, shear, and tiling. A separate 64² triangle crosses U8, U16, F16 and F32 with grayscale or color output. With an opaque black background each matches 4,034/4,096 pixels, maximum normalized error .337281. With a constant background of (.1875, .4375, .625, .375), grayscale matches 154/4,096 per format and color matches 4,034/4,096 per format. The largest respective errors are .323980 and .458824.
Points Preview now cooks with its linked font present. Use a generated F32 point strip with two rows of offset ellipses. With the point-count bridge open, ten settings at 16², 32² and four rectangular sizes up to 64 × 32 and 32 × 64 give 10,496/10,496 exact pixels. With labels off, connect integers 4, 8 and 12, set the respective offsets to 0, 1 and 2 and point sizes to .03125, .0625 and .09375. Test 16² F32, 32² in four parent formats and 32 × 16 F32. The stored U8 results are 4,864/4,864, 4,760/4,864 and 4,631/4,864. The last two reach 255 codes of error. The root stays open for the differing nonempty cases and visible labels.
### Spline preprocessing with empty inputs and complete library saves
Use the [original circle, tangent and striped mask fields](#spline-preprocessing-with-wired-counts). Instantiate the unmodified preprocessing graph and expose either its RGBA image or its integer count. Compare the disconnected default, connected counts (0,1), (1,1) and (2,1), and a spacing-driven (2,1) case. For the first three connected cases choose side 3, amount mode 0 and one spline per spline. For the last choose side 1, amount mode 1 and spacing .09375. The counts were 0, 0, 1, 2 and 21. The images were 2048 × 16 except for the spacing-driven output at 2048 × 32.
+1 -1
View File
@@ -652,7 +652,7 @@ Creased matches 10,947,840/10,947,840 pixels across 100 distinct settings throug
| [spline_tools.sbs/internal_tools/get_spline_point_data](../assets/sbs/spline_tools.sbs) | 1 | Yes | [Parity: 4 cases](parity-fixes.md#verified-cases) |
| [spline_tools.sbs/internal_tools/modify_spline_property_sub](../assets/sbs/spline_tools.sbs) | 4 | Yes | [Parity · 28,928 exact pixels in 19 renders](parity-fixes.md#clamped-texture-reads-in-spline-graphs) |
| [spline_tools.sbs/internal_tools/normalize_spline_distance](../assets/sbs/spline_tools.sbs) | 1 | Yes | [Parity · 16 cases, 52,480 exact pixels](parity-fixes.md#tile-edge-masks-and-normalized-spline-distances) |
| [spline_tools.sbs/internal_tools/points_preview](../assets/sbs/spline_tools.sbs) | 3 | Yes | [In progress · 27,904 exact output pixels, text errors and wired cases open](parity-fixes.md#clamped-texture-reads-in-spline-graphs) |
| [spline_tools.sbs/internal_tools/points_preview](../assets/sbs/spline_tools.sbs) | 3 | Yes | [In progress · linked fonts cook, four points exact over 4,864 pixels, eight and twelve points differ](parity-fixes.md#package-font-outlines-and-point-preview) |
| [spline_tools.sbs/internal_tools/resample_spline_data](../assets/sbs/spline_tools.sbs) | 3 | Yes | [Parity · 29,952 exact pixels in 19 renders](parity-fixes.md#clamped-texture-reads-in-spline-graphs) |
| [spline_tools.sbs/internal_tools/scatter_splines_on_splines_preprocess](../assets/sbs/spline_tools.sbs) | 5 | Yes | [Parity · 622,592/622,592 pixels and 16/16 counts, both full-library saves exact](parity-fixes.md#spline-preprocessing-with-empty-inputs-and-complete-library-saves) · [Four output formats](parity-fixes.md#spline-preprocessing-with-wired-counts) |
| [spline_tools.sbs/internal_tools/select_spline_sub](../assets/sbs/spline_tools.sbs) | 3 | Yes | [Parity · 622,592 exact pixels in 19 renders](parity-fixes.md#clamped-texture-reads-in-spline-graphs) |