mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-29 09:34:05 +01:00
[vector] Fix linear-gradient anchor reduction
hb-vector-paint emitted (2*x1 - x2, 2*y1 - y2) as the SVG end point -- the reflection of P2 about P1, not the projection. For COLR linear gradients the SVG end should be P1 projected onto the line through P0 perpendicular to (P2 - P0); that's the gradient's actual axis (perpendicular to the rotation line). With the old formula, fonts with rotation references far from the color line ended up with massively over-scaled gradient axes -- e.g. BungeeSpice's ABC showed solid red where raster shows a full red->yellow gradient. Add hb_paint_reduce_linear_anchors() to hb-paint.hh as the shared canonical implementation (matches hb-raster-paint and hb-cairo) and use it from hb-vector-paint. Regenerate the two affected basic.tests expected SVGs; the new gradient endpoints are now consistent with the cairo / raster outputs. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7f6d75cd9e
commit
ce4199c303
4 files changed
+43
-6
No files matched your search
@@ -16,7 +16,7 @@
|
||||
<clipPath id="clip-g16"><use href="#p16"/></clipPath>
|
||||
<path id="p17" d="M503,542C535,542 585,525 608,513C622,506 942,337 1023,299C1037,293 1054,290 1075,290C1092,290 1108,291 1122,293C1131,294 1140,295 1146,295L1147,295C1161,294 1172,284 1172,270L1172,-52C1172,-61 1163,-68 1155,-68C1153,-68 1151,-67 1150,-67C1122,-59 1069,-53 1039,-53C1034,-53 1030,-53 1026,-54C999,-55 972,-64 943,-74L937,-76C933,-77 930,-79 927,-82C908,-99 887,-107 863,-107L860,-107C817,-106 741,-84 657,-47C628,-34 597,-28 565,-28C539,-28 514,-32 489,-41L441,-58C432,-61 423,-62 413,-62C387,-62 363,-50 348,-30L335,-13C330,-6 321,-2 313,-2C312,-2 311,-2 310,-2C307,-2 304,-2 302,-2C274,-2 264,11 259,22C252,36 251,51 257,66C259,72 259,78 257,84C263,85 269,88 274,92C280,99 288,105 296,109C297,109 297,110 297,110L425,186C432,190 436,197 438,204L458,305C459,314 457,323 451,330C446,336 438,339 430,339C429,339 428,339 428,339L347,331L346,331C310,326 281,299 273,265L230,129C229,129 229,128 229,128C229,126 228,124 227,122C225,116 225,109 227,104C221,103 215,100 211,96C199,85 183,78 168,78C165,78 163,78 160,79C145,81 130,91 122,103C116,113 114,125 117,138C121,147 137,191 150,256C155,279 159,301 163,323C169,355 176,394 181,403C181,404 181,404 181,404C192,420 207,431 225,435C226,435 228,436 229,436L492,541C494,542 498,542 503,542ZM503,570C496,570 489,569 484,568L218,462C193,456 172,440 158,420C148,409 138,332 123,262C108,192 91,146 91,146C76,93 118,57 156,51C160,50 164,50 168,50C189,50 212,58 230,76C223,55 223,32 234,10C248,-19 274,-30 302,-30C305,-30 309,-30 313,-30L326,-47C346,-75 380,-90 414,-90C426,-90 439,-88 451,-84L499,-67C521,-59 543,-56 566,-56C593,-56 620,-61 646,-73C709,-100 800,-134 860,-135L863,-135C897,-135 925,-122 946,-102C975,-93 1003,-83 1028,-82C1031,-82 1035,-81 1039,-81C1070,-81 1119,-87 1142,-94C1146,-95 1151,-96 1155,-96C1179,-96 1200,-76 1200,-52L1200,270C1200,299 1177,322 1148,323C1148,323 1147,323 1146,323C1130,323 1102,318 1076,318C1061,318 1046,319 1035,325C954,363 621,538 621,538C596,551 541,570 503,570ZM254,112C255,115 255,118 256,121L300,257C305,281 325,300 350,303L430,311L410,210L283,134C272,128 262,120 254,112Z"/>
|
||||
<clipPath id="clip-g17"><use href="#p17"/></clipPath>
|
||||
<linearGradient id="gr1" gradientUnits="userSpaceOnUse" x1="669" y1="776" x2="572" y2="-1477" spreadMethod="pad">
|
||||
<linearGradient id="gr1" gradientUnits="userSpaceOnUse" x1="669" y1="776" x2="179.58" y2="-105.76" spreadMethod="pad">
|
||||
<stop offset="0" stop-color="rgb(100,181,246)"/>
|
||||
<stop offset="1" stop-color="rgb(33,150,243)"/>
|
||||
</linearGradient>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
@@ -16,7 +16,7 @@
|
||||
<clipPath id="clip-g16"><use href="#p16"/></clipPath>
|
||||
<path id="p17" d="M503,542Q499,542 496.5,541.5Q494,541 492,541L229,436Q227,436 225,435Q197,428 181,404Q181,404 181,404Q181,404 181,403Q177,396 172.5,371.5Q168,347 163,323Q160,307 157,290Q154,273 150,256Q140,208 130,176Q120,144 117,138Q112,118 122,103Q135,83 160,79Q164,78 168,78Q192,78 211,96Q217,102 227,104Q224,113 227,122Q229,126 229,128Q229,128 229,128.5Q229,129 230,129L273,265Q279,291 299,309Q319,327 346,331Q346,331 346.5,331Q347,331 347,331L428,339Q428,339 430,339Q443,339 451,330Q460,319 458,305L438,204Q436,192 425,186L297,110Q297,109 296,109Q284,102 274,92Q267,85 257,84Q260,75 257,66Q249,44 259,22Q263,14 272,6Q281,-2 302,-2Q306,-2 310,-2Q311,-2 313,-2Q327,-2 335,-13L348,-30Q372,-62 413,-62Q428,-62 441,-58L489,-41Q526,-28 565,-28Q613,-28 657,-47Q720,-74 774,-90Q828,-106 860,-107L863,-107Q899,-107 927,-82Q931,-78 937,-76L943,-74Q964,-67 985,-61Q1006,-55 1026,-54Q1031,-53 1039,-53Q1062,-53 1095.5,-57Q1129,-61 1150,-67Q1152,-68 1155,-68Q1161,-68 1166.5,-63.5Q1172,-59 1172,-52L1172,270Q1172,280 1164.5,287Q1157,294 1147,295L1146,295Q1142,295 1135.5,294.5Q1129,294 1122,293Q1112,292 1100,291Q1088,290 1075,290Q1043,290 1023,299Q1002,309 965,327.5Q928,346 882.5,369.5Q837,393 790,417.5Q743,442 703,463Q663,484 637,497.5Q611,511 608,513Q591,522 559,532Q527,542 503,542L503,542ZM503,570Q532,570 567.5,559Q603,548 621,538Q621,538 645.5,525Q670,512 710,491Q750,470 797.5,445.5Q845,421 892,397Q939,373 977,353.5Q1015,334 1035,325Q1043,321 1053.5,319.5Q1064,318 1076,318Q1095,318 1114.5,320.5Q1134,323 1146,323Q1146,323 1147,323Q1148,323 1148,323Q1170,322 1185,307Q1200,292 1200,270L1200,-52Q1200,-70 1186.5,-83Q1173,-96 1155,-96Q1148,-96 1142,-94Q1125,-89 1093.5,-85Q1062,-81 1039,-81Q1033,-81 1028,-82Q1009,-83 988.5,-89Q968,-95 946,-102Q930,-117 909.5,-126Q889,-135 863,-135L860,-135Q830,-134 792,-124.5Q754,-115 715.5,-100.5Q677,-86 646,-73Q608,-56 566,-56Q531,-56 499,-67L451,-84Q433,-90 414,-90Q388,-90 364.5,-79Q341,-68 326,-47L313,-30Q307,-30 302,-30Q281,-30 263,-21Q245,-12 234,10Q218,42 230,76Q217,63 200.5,56.5Q184,50 168,50Q162,50 156,51Q137,54 119,66.5Q101,79 92,99Q83,119 91,146Q91,146 101.5,178Q112,210 123,262Q130,297 136.5,331Q143,365 148,389.5Q153,414 158,420Q180,453 218,462L484,568Q492,570 503,570ZM254,112Q266,125 283,134L410,210L430,311L350,303Q331,300 317.5,287.5Q304,275 300,257L256,121Q255,116 254,112Z"/>
|
||||
<clipPath id="clip-g17"><use href="#p17"/></clipPath>
|
||||
<linearGradient id="gr1" gradientUnits="userSpaceOnUse" x1="669" y1="776" x2="572" y2="-1477" spreadMethod="pad">
|
||||
<linearGradient id="gr1" gradientUnits="userSpaceOnUse" x1="669" y1="776" x2="179.58" y2="-105.76" spreadMethod="pad">
|
||||
<stop offset="0" stop-color="rgb(100,181,246)"/>
|
||||
<stop offset="1" stop-color="rgb(33,150,243)"/>
|
||||
</linearGradient>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Reference in new issue
Block a user