openpencil/tests/engine/render/canvas
Danila Poyarkov a2fc235131
fix(text): render variable font styles at their named instances (#773)
* fix(text): render variable font styles at their named instances

Installed variable fonts such as SF Pro list every named instance, but
font-kit loads each one at the default weight, so the desktop loader
rejected Medium and Bold and the canvas fell back to a substitute. Even
when a variable face was loaded, CanvasKit drew it at its default axes:
Medium rendered as Regular and Bold as a synthetic bold.

The desktop loader now falls back to a variable face whose wght axis
covers the requested weight. The renderer applies the coordinates of the
named instance matching the style, or the clamped weight when none
matches, beneath any explicit font variations on the text.

* fix(text): validate variable font tables and leave loading to the host

Check name-table records and string ranges, the fvar header size, and
axis and instance record sizes, so a malformed font falls back to the
style weight instead of throwing while text is shaped.

Drop the desktop loader's variable-face fallback; system font discovery
moves to fontique, which lists variable faces with their weight axes.
2026-09-26 11:25:01 +04:00
..
chunks ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
effects feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
guides feat(canvas): add Figma guide feedback parity 2026-08-20 14:02:33 +03:00
labels perf(canvas): reuse labels with shared font fallback 2026-09-15 23:08:53 +03:00
tiles ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
visual ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
arrow-heads-draw.test.ts feat(canvas): render arrow stroke caps on lines and open vectors 2026-08-31 21:25:38 +03:00
blend.test.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
boolean.test.ts refactor(canvas): adopt immutable CanvasKit paths (#554) 2026-08-18 23:09:45 +03:00
cache.test.ts Merge remote-tracking branch 'joey/feature-overlapping-element-analysis-tool' into pr352-local-merge 2026-06-30 09:47:07 +03:00
component-label-text.test.ts
corner-smoothing.test.ts refactor(canvas): adopt immutable CanvasKit paths (#554) 2026-08-18 23:09:45 +03:00
culling.test.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
derived-text.test.ts fix(canvas): preserve path text with loaded fonts 2026-09-16 00:59:26 +03:00
diamond-gradient.test.ts fix(canvas): preserve paint geometry and color fidelity 2026-09-16 02:57:56 +03:00
effect-raster-cache.test.ts refactor(canvas): share bounded resource cache bookkeeping 2026-09-15 21:28:16 +03:00
effect-raster-integration.test.ts refactor(canvas): share bounded resource cache bookkeeping 2026-09-15 21:28:16 +03:00
font-readiness.test.ts feat: split SceneGraph and Pen packages 2026-06-30 10:54:32 +03:00
gradient.test.ts
image-fill.test.ts fix(renderer): preserve proportions of FIT image fills 2026-09-13 13:48:11 +03:00
label-cache.test.ts test: align label cache contracts with component members 2026-09-16 16:14:12 +03:00
layout-grids.test.ts feat: split SceneGraph and Pen packages 2026-06-30 10:54:32 +03:00
line.test.ts
masks.test.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
measurement.test.ts feat(canvas): measure distances between layers (#515) 2026-08-14 18:18:55 +03:00
normalize-dash-pattern.test.ts fix(canvas): normalize imported dash patterns 2026-08-31 22:25:48 +03:00
painted-text.test.ts test(canvas): load painted-text font fixtures explicitly 2026-09-16 03:27:10 +03:00
picture-invalidation.test.ts refactor(canvas): share bounded resource cache bookkeeping 2026-09-15 21:28:16 +03:00
raster-export.test.ts fix(fig): preserve component instance rendering 2026-08-10 04:30:06 -03:00
renderer-lifecycle.test.ts refactor(canvas): share bounded resource cache bookkeeping 2026-09-15 21:28:16 +03:00
retained-backing-pixels.test.ts fix(canvas): discard stale zoom fallback pictures 2026-09-15 17:40:34 +03:00
retained-backing.test.ts fix(renderer): rasterize settled scenes at viewport origin 2026-09-15 13:25:43 +03:00
schema-fill-fallback.test.ts fix(fig): preserve multi-color vector fills 2026-07-28 11:45:58 +03:00
surface-replacement.test.ts perf(canvas): rebuild navigation rendering (#591) 2026-08-31 13:39:40 +03:00
text-font-variations.test.ts fix(text): render variable font styles at their named instances (#773) 2026-09-26 11:25:01 +04:00
text-preparation-cache.test.ts perf(text): preserve coverage across paragraph eviction 2026-09-15 16:32:07 +03:00
text.test.ts fix(fonts): explain PingFang substitution and draw its CJK text (#781) 2026-09-26 11:14:30 +04:00
variable-modes.test.ts fix(fig): honor node-scoped variable modes 2026-07-21 00:23:00 +03:00