Type: Kerning has an Optical option that spaces characters by their shapes

Squashed from #4825 onto main.
This commit is contained in:
dotCooCoo
2026-11-01 01:22:04 +07:00
committed by bflatastic
parent 012af4fd49
commit 9896f633da
47 changed files with 1165 additions and 69 deletions
+5 -1
View File
@@ -25,9 +25,12 @@ pub struct CharStyle {
/// Tracking in 1/1000 em.
#[serde(default)]
pub tracking: f64,
/// Kerning: None = Auto (metrics), Some(v) = manual in 1/1000 em.
/// Manual pair spacing in 1/1000 em; None uses the automatic mode.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub kerning: Option<f64>,
/// Use glyph shapes for automatic pair spacing; false uses font metrics.
#[serde(default, rename = "opticalKerning", skip_serializing_if = "crate::skip::is_default")]
pub optical_kerning: bool,
#[serde(default)]
pub baseline_shift: f64,
#[serde(default = "hundred")]
@@ -266,6 +269,7 @@ impl Default for CharStyle {
leading: None,
tracking: 0.0,
kerning: None,
optical_kerning: false,
baseline_shift: 0.0,
h_scale: 100.0,
v_scale: 100.0,
+1
View File
@@ -223,6 +223,7 @@ impl ParaList {
position: CharPosition::Normal,
tracking: 0.0,
kerning: None,
optical_kerning: first.optical_kerning,
tate_chu_yoko: false,
underline: false,
strikethrough: false,