Files
harfbuzz/test/vector/data/expected/basic/cff1.svg
T
Behdad Esfahbod 7c54a401c0 [vector-draw] Add foreground/background color API
Add hb_vector_draw_set_{foreground,background}() and getters.

SVG: foreground wraps body in <g fill="rgb(...)">; background
emits a <rect> covering the viewBox before content.

PDF: foreground sets fill color via rg operator before glyph
content; background emits a filled rect at the start of the
content stream.

Default: foreground opaque black, background transparent.

Wire both into the hb-vector CLI util alongside the paint
equivalents.  Remove the old util-side emit_background_rect.

Regenerated vector test expected outputs.

Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 19:13:33 -06:00

14 lines
1.5 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="-16 -1000 1545 1289" width="1545" height="1289">
<defs>
<path id="p1" d="M12416,-768C16320,-768 19776,1280 22720,3712L22912,3712L23360,0L27712,0L27712,19072C27712,26816 24512,31872 16896,31872C11904,31872 7552,29696 4672,27840L6720,24192C9152,25856 12416,27520 16000,27520C21120,27520 22400,23680 22400,19712C9152,18240 3328,14848 3328,8064C3328,2496 7232,-768 12416,-768ZM13952,3456C10880,3456 8448,4928 8448,8448C8448,12416 12032,14976 22400,16256L22400,7616C19392,4928 16960,3456 13952,3456Z"/>
<path id="p2" d="M19008,-768C26112,-768 32448,5440 32448,16064C32448,25664 28160,31872 20096,31872C16640,31872 13184,30016 10368,27520L10496,33152L10496,45568L5248,45568L5248,0L9472,0L9920,3200L10112,3200C12864,704 16128,-768 19008,-768ZM18112,3648C16064,3648 13248,4544 10496,6912L10496,23232C13440,25984 16192,27456 18816,27456C24704,27456 27008,22848 27008,16000C27008,8320 23232,3648 18112,3648Z"/>
<path id="p3" d="M17536,-768C21248,-768 24768,704 27584,3200L25280,6720C23360,4992 20864,3584 17984,3584C12288,3584 8384,8384 8384,15488C8384,22656 12480,27520 18112,27520C20608,27520 22528,26368 24320,24768L27008,28224C24832,30208 22016,31872 17920,31872C9920,31872 2944,25920 2944,15488C2944,5184 9280,-768 17536,-768Z"/>
</defs>
<rect x="-16" y="-1000" width="1545" height="1289" fill="rgb(255,255,255)"/>
<use href="#p1" transform="translate(0,0) scale(0.015625,-0.015625)"/>
<use href="#p2" transform="translate(504,0) scale(0.015625,-0.015625)"/>
<use href="#p3" transform="translate(1057,0) scale(0.015625,-0.015625)"/>
</svg>