smart_scale
Resize glyphs with automatic stem width compensation to preserve stroke weight. Adjust width, height, or weight proportionally, keeping consistent visual density across masters.
Instructions
Scale glyphs with automatic stem weight compensation.
RECIPE: For multi-glyph scaling tasks, call get_recipe("scale_proportions") first — it includes pre/post stem verification and visual comparison steps.
Unlike simple affine transforms which distort stem weights, this tool:
Measures reference stems (H for UC, n for LC) before scaling
Applies the width/height transform
Uses GlyphsFilterOffsetCurve to compensate stem thickness changes
Reports before/after stem measurements for verification
All values are scale factors where 1.0 = no change.
Args: width: Horizontal scale factor. 0.97 = 3% narrower, 1.1 = 10% wider height: Vertical scale factor. 1.15 = 15% taller, 0.9 = 10% shorter weight: Target stem weight factor. 1.0 = maintain original stem thickness after scaling (compensate). 0.9 = make stems 10% thinner. 1.1 = 10% thicker. proportional: If true, height follows width (uniform scale with compensation) glyph_names: List of glyph names to process (empty = all exporting glyphs) master_id: Process only this master (empty = all masters) backup: Create backup layers before modifying (default true)
Examples: Condense 3% keeping weight: smart_scale(width=0.97, weight=1.0) Increase x-height 15% keeping weight: smart_scale(height=1.15, weight=1.0) Scale uniformly 90% with weight compensation: smart_scale(width=0.9, proportional=True) Make all stems 10% thicker: smart_scale(weight=1.1) Condense UC only: smart_scale(width=0.95, glyph_names=["A","B","C",...])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| backup | No | ||
| height | No | ||
| weight | No | ||
| master_id | No | ||
| glyph_names | No | ||
| proportional | No |