mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 06:51:01 +01:00
The vector util was creating a separate upem-scaled font clone, converting all shaping positions from font-scale to upem, and setting scale_factor to upem/font_size to undo that on emit. Simplify: use the caller's font directly. Positions from shaping are stored as-is (in font-scale = pixel * SCALE). scale_factor is just SCALE (= 1 << subpixel_bits), so the lib divides by SCALE on emit to produce pixel-space output. This removes ~40 lines: the upem_font creation, variation coord copying, scale_to_upem_x/y helpers, and the complex upem_per_pixel margin/stroke conversions. Margin conversion simplifies from margin * upem * SCALE / x_scale to just margin * SCALE. Regenerated vector test expected outputs for the new coordinate space. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
1.5 KiB
XML
13 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>
|
|
|
|
<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>
|