mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 06:51:01 +01:00
Some SVG glyph documents reuse the same referenced element multiple times. The vector subsetter treated a duplicate ref as a hard failure, which made hb-vector drop glyphs like U+270D from the handwriting picosvg test fonts entirely. Treat duplicate and empty refs as non-fatal while still uniquing the collected ids. Add regressions for the handwriting picosvg and picosvgz fonts, reusing a shared expected output for the pair. Fixes: https://github.com/harfbuzz/harfbuzz/issues/5829 Assisted-by: OpenAI Codex
22 lines
8.0 KiB
XML
22 lines
8.0 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-16 -966 1307 1232" width="1307" height="1232">
|
|
<defs>
|
|
|
|
<path d="M124,72.49 C124,69.49 121.57,67.03 118.48,66.88 C116,66.76 109.83,68.33 106.34,66.69 C97.73,62.64 62.24,43.96 62.24,43.96 C59.12,42.27 51.47,39.77 47.59,40.74 L19.29,52.02 C16.53,52.71 14.29,54.38 12.86,56.55 C11.82,57.73 10.68,65.93 9.12,73.38 C7.56,80.83 5.65,85.76 5.65,85.76 C4.11,91.44 8.6,95.25 12.59,95.93 C16.58,96.61 21.8,94.16 23.34,88.47 L26.62,72.73 C27.15,70.17 29.26,68.21 31.9,67.82 L41.87,68.18 L38.36,86.13 C38.36,86.13 56.12,108.86 81.23,114.25 C90.44,116.23 99.01,110.47 105.61,110.06 C108.66,109.87 115,110.54 117.79,111.35 C120.89,112.25 124.01,109.97 124.01,106.84 L124.01,72.49 Z" id="hbimg0_g_270d.0"/>
|
|
<radialGradient id="hbimg0_g1" cx="26.716" cy="51.096" r="49.865" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1 0 0 0.977 0 0)"><stop offset="0.353" stop-color="#FFCA28"/><stop offset="0.766" stop-color="#FFB300"/></radialGradient>
|
|
<path d="M87.7,115.75 C81.34,115.63 71.59,112.02 64.89,109.08 C59.94,106.91 54.31,106.69 49.2,108.5 L44.07,110.31 C39.2,112.03 33.74,110.41 30.7,106.34 L20.63,92.87 L104.68,92.7 C104.68,92.7 103.14,116.05 87.7,115.75 Z" id="hbimg0_g_270d.1"/>
|
|
<path d="M40.57,72.75 L55.59,47.91 L55.49,52.06 C55.39,56.3 58.16,60.11 62.32,61.46 L40.57,72.75 Z" id="hbimg0_g_270d.2"/>
|
|
<path d="M23.62,110.95 L6.44,123.65 C5.22,124.55 3.7,123.58 4.05,122.12 L8.78,102.38 C8.89,101.93 9.07,101.48 9.32,101.08 L66.28,6.22 C67.49,4.21 69.96,3.41 71.8,4.45 L80.57,9.4 C82.41,10.44 82.92,12.91 81.71,14.93 L24.85,109.58 C24.54,110.12 24.12,110.59 23.62,110.95 Z" id="hbimg0_g_270d.3"/>
|
|
<path d="M49.64,43.52 C53.06,43.52 58.45,45.31 60.85,46.61 C62.3,47.37 96.49,65.37 105.07,69.4 C106.56,70.1 108.4,70.44 110.7,70.44 C112.46,70.44 114.18,70.25 115.7,70.08 C116.69,69.97 117.63,69.87 118.2,69.87 L118.34,69.87 C119.83,69.94 121,71.09 121,72.48 L121,106.83 C121,107.86 120.05,108.54 119.17,108.54 C118.99,108.54 118.8,108.51 118.62,108.46 C115.7,107.61 110.04,107.02 106.79,107.02 C106.29,107.02 105.83,107.03 105.42,107.06 C102.58,107.24 99.65,108.19 96.55,109.21 L95.94,109.41 C95.53,109.54 95.15,109.77 94.83,110.06 C92.89,111.86 90.65,112.74 88,112.74 L87.76,112.74 C83.15,112.65 75.05,110.25 66.09,106.32 C62.99,104.96 59.7,104.27 56.3,104.27 C53.53,104.27 50.8,104.74 48.2,105.66 L43.07,107.47 C42.11,107.81 41.11,107.98 40.1,107.98 C37.33,107.98 34.72,106.69 33.1,104.54 L31.74,102.73 C31.17,101.97 30.28,101.53 29.34,101.53 C29.24,101.53 29.15,101.53 29.05,101.54 C28.75,101.57 28.45,101.58 28.17,101.58 C25.27,101.58 24.21,100.11 23.67,99 C22.9,97.45 22.81,95.85 23.38,94.27 C23.61,93.64 23.61,92.97 23.42,92.36 C24.07,92.28 24.69,91.98 25.18,91.49 C25.88,90.78 26.69,90.17 27.6,89.68 C27.64,89.66 27.67,89.64 27.7,89.62 L41.3,81.53 C42.03,81.09 42.55,80.37 42.71,79.53 L44.82,68.76 C45,67.83 44.74,66.87 44.1,66.17 C43.53,65.54 42.72,65.18 41.88,65.18 C41.79,65.18 41.69,65.18 41.6,65.19 L33.04,66 C32.99,66.01 32.93,66.01 32.88,66.02 C29.07,66.58 25.98,69.42 25.13,73.11 L20.48,87.55 C20.47,87.59 20.45,87.64 20.44,87.68 C20.39,87.88 20.32,88.09 20.22,88.36 C19.99,89 19.98,89.67 20.17,90.28 C19.54,90.36 18.94,90.64 18.46,91.1 C17.22,92.31 15.51,93.03 13.9,93.03 C13.62,93.03 13.34,93.01 13.08,92.96 C11.45,92.68 9.85,91.66 9.01,90.34 C8.33,89.27 8.15,88.03 8.5,86.66 C8.86,85.7 10.59,80.92 12.04,73.99 C12.54,71.59 12.99,69.19 13.42,66.86 C14.04,63.51 14.81,59.35 15.28,58.3 C15.3,58.27 15.33,58.23 15.35,58.2 C16.43,56.57 18.09,55.4 20.01,54.92 C20.14,54.89 20.27,54.85 20.39,54.8 L48.47,43.6 C48.73,43.57 49.11,43.52 49.64,43.52 M49.64,40.52 C48.89,40.52 48.2,40.59 47.6,40.74 L19.3,52.02 C16.54,52.71 14.3,54.38 12.87,56.55 C11.83,57.73 10.69,65.93 9.13,73.38 C7.57,80.84 5.66,85.75 5.66,85.75 C4.12,91.43 8.61,95.24 12.6,95.92 C13.03,95.99 13.47,96.03 13.92,96.03 C16.19,96.03 18.66,95.11 20.57,93.25 C19.77,95.47 19.82,97.93 21,100.32 C22.5,103.36 25.18,104.57 28.19,104.57 C28.58,104.57 28.97,104.55 29.36,104.51 L30.72,106.32 C32.95,109.3 36.48,110.97 40.12,110.97 C41.45,110.97 42.79,110.75 44.09,110.29 L49.22,108.48 C51.52,107.67 53.92,107.27 56.32,107.27 C59.25,107.27 62.18,107.87 64.91,109.07 C71.61,112.01 81.37,115.62 87.72,115.74 L88.01,115.74 C91.73,115.74 94.63,114.35 96.88,112.26 C100.05,111.23 102.99,110.22 105.62,110.05 C105.97,110.03 106.37,110.02 106.81,110.02 C110.1,110.02 115.34,110.63 117.8,111.34 C118.27,111.48 118.73,111.54 119.19,111.54 C121.77,111.54 124.02,109.49 124.02,106.83 L124.02,72.49 C124.02,69.49 121.59,67.03 118.5,66.88 C118.41,66.88 118.31,66.87 118.22,66.87 C116.53,66.87 113.54,67.44 110.72,67.44 C109.12,67.44 107.59,67.26 106.37,66.69 C97.76,62.64 62.27,43.96 62.27,43.96 C59.61,42.53 53.73,40.52 49.64,40.52 Z M23.04,89.39 C23.15,89.09 23.25,88.79 23.34,88.47 L28.04,73.9 C28.57,71.34 30.68,69.38 33.32,68.99 L41.87,68.19 L39.76,78.96 L26.16,87.05 C24.98,87.7 23.93,88.49 23.04,89.39 Z" id="hbimg0_g_270d.4"/>
|
|
<linearGradient id="hbimg0_g2" x1="67.412" y1="18.589" x2="15.176" y2="112.62" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#64B5F6"/><stop offset="1" stop-color="#2196F3"/></linearGradient>
|
|
<path d="M70.04,7 C70.15,7 70.25,7.02 70.33,7.07 L79.1,12.02 C79.14,12.04 79.27,12.12 79.34,12.36 C79.38,12.51 79.44,12.9 79.14,13.39 L22.28,108.05 C22.16,108.24 22.01,108.42 21.83,108.55 L7.92,118.83 L11.69,103.08 C11.73,102.92 11.79,102.77 11.88,102.62 L68.86,7.77 C69.17,7.24 69.68,7 70.04,7 M70.04,4 C68.6,4 67.13,4.81 66.28,6.22 L9.31,101.07 C9.06,101.48 8.88,101.92 8.77,102.37 L4.04,122.11 C3.79,123.19 4.54,124 5.44,124 C5.77,124 6.12,123.89 6.44,123.65 L23.62,110.95 C24.12,110.58 24.54,110.12 24.86,109.58 L81.72,14.93 C82.93,12.92 82.42,10.44 80.58,9.4 L71.81,4.45 C71.26,4.15 70.65,4 70.04,4 Z" id="hbimg0_g_270d.6" fill="#424242" opacity="0.2"/>
|
|
<path d="M78.69,64.46 C66.28,59.75 56.68,60.45 49.69,65.97 C44.85,69.8 27.32,82.28 19.63,90.47 C15.96,94.39 19.38,98.8 22.57,100.79 C28.82,104.71 35.07,104.4 48.65,96.16 C55.59,91.95 60.04,95.46 64.97,98.83 C64.97,98.83 72.68,105.22 79.47,107.61 C86.26,110 102.13,106.33 107.44,98.29 C113.31,89.4 103.81,74 78.69,64.46 Z" id="hbimg0_g_270d.7"/>
|
|
<radialGradient id="hbimg0_g4" cx="63.581" cy="87.541" r="36.481" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1 0 0 0.969 0 0)"><stop offset="0.353" stop-color="#FFCA28"/><stop offset="0.766" stop-color="#FFB300"/></radialGradient>
|
|
<path d="M63.72,64.34 C58.93,64.34 54.95,65.64 51.54,68.31 C50.46,69.16 48.81,70.4 46.73,71.96 C39.59,77.31 27.64,86.28 21.81,92.5 C21.03,93.33 20.99,93.94 21.05,94.37 C21.2,95.6 22.48,97.18 24.15,98.23 C26.33,99.6 28.27,100.21 30.42,100.21 C34.39,100.21 39.53,98.16 47.09,93.58 C49.71,91.99 52.22,91.22 54.76,91.22 C59.22,91.22 62.66,93.59 65.98,95.88 L66.66,96.35 C66.74,96.41 66.81,96.46 66.88,96.52 C66.95,96.58 74.27,102.6 80.46,104.78 C80.853,104.918 81.423,105.073 82.208,105.183 C84.695,106.724 87.443,107.654 90.468,107.71 L90.472,107.713 C86.199,108.54 82.146,108.539 79.48,107.6 C72.69,105.21 64.98,98.82 64.98,98.82 C64.746,98.66 64.513,98.5 64.281,98.34 C59.622,95.134 55.27,92.14 48.66,96.15 C35.08,104.39 28.83,104.7 22.58,100.78 C19.39,98.79 15.97,94.38 19.64,90.46 C27.33,82.27 44.86,69.79 49.7,65.96 C51.296,64.699 53.029,63.69 54.902,62.941 C57.559,61.88 60.495,61.34 63.72,61.34 C66.126,61.34 68.684,61.639 71.404,62.248 C72.507,62.495 73.634,62.792 74.79,63.14 C71.406,63.431 68.952,63.953 67.173,64.557 C65.979,64.413 64.827,64.34 63.72,64.34 Z" id="hbimg0_g_270d.8"/>
|
|
<g id="cg0">
|
|
<g id="hbimg0_glyph7" transform="matrix(9.375 0 0 9.375 37.5 -950)"><use xlink:href="#hbimg0_g_270d.0" fill="url(#hbimg0_g1)"/><use xlink:href="#hbimg0_g_270d.1" fill="#FFAA00"/><use xlink:href="#hbimg0_g_270d.2" fill="#EDA600"/><use xlink:href="#hbimg0_g_270d.3" fill="#1E88E5"/><use xlink:href="#hbimg0_g_270d.4" fill="#EDA600"/><use xlink:href="#hbimg0_g_270d.3" fill="url(#hbimg0_g2)"/><use xlink:href="#hbimg0_g_270d.6"/><use xlink:href="#hbimg0_g_270d.7" fill="url(#hbimg0_g4)"/><use xlink:href="#hbimg0_g_270d.8" fill="#EDA600"/></g>
|
|
</g>
|
|
</defs>
|
|
|
|
<use href="#cg0" transform="translate(0,0)"/>
|
|
</svg>
|