Merge lp:~glyphobet/inkscape/alphabet_soup into lp:~inkscape.dev/inkscape/trunk

Proposed by Glyphobet on 2011-07-18
Status: Merged
Approved by: jazzynico on 2011-07-18
Approved revision: 10469
Merged at revision: 10473
Proposed branch: lp:~glyphobet/inkscape/alphabet_soup
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 528 lines (+121/-52)
32 files modified
share/extensions/alphabet_soup/Cblob.svg (+1/-1)
share/extensions/alphabet_soup/Chook.svg (+1/-1)
share/extensions/alphabet_soup/Eb.svg (+1/-1)
share/extensions/alphabet_soup/Et.svg (+1/-1)
share/extensions/alphabet_soup/G.svg (+1/-1)
share/extensions/alphabet_soup/IBSerif.svg (+1/-1)
share/extensions/alphabet_soup/ITSerif.svg (+1/-1)
share/extensions/alphabet_soup/Lb.svg (+1/-1)
share/extensions/alphabet_soup/Lt.svg (+1/-1)
share/extensions/alphabet_soup/Oterm.svg (+1/-1)
share/extensions/alphabet_soup/P.svg (+1/-1)
share/extensions/alphabet_soup/Q.svg (+1/-1)
share/extensions/alphabet_soup/Vser.svg (+1/-1)
share/extensions/alphabet_soup/Xvt.svg (+1/-1)
share/extensions/alphabet_soup/abase.svg (+1/-1)
share/extensions/alphabet_soup/barcap.svg (+1/-1)
share/extensions/alphabet_soup/gamma.svg (+1/-1)
share/extensions/alphabet_soup/h.svg (+1/-1)
share/extensions/alphabet_soup/hcap.svg (+1/-1)
share/extensions/alphabet_soup/j.svg (+1/-1)
share/extensions/alphabet_soup/lserif.svg (+1/-1)
share/extensions/alphabet_soup/m.svg (+1/-1)
share/extensions/alphabet_soup/mcap.svg (+1/-1)
share/extensions/alphabet_soup/o.svg (+1/-1)
share/extensions/alphabet_soup/ocap.svg (+1/-1)
share/extensions/alphabet_soup/question.svg (+1/-1)
share/extensions/alphabet_soup/rcap.svg (+1/-1)
share/extensions/alphabet_soup/tserif.svg (+2/-8)
share/extensions/alphabet_soup/vcap.svg (+1/-1)
share/extensions/alphabet_soup/vserl.svg (+1/-1)
share/extensions/render_alphabetsoup.inx (+1/-1)
share/extensions/render_alphabetsoup.py (+89/-14)
To merge this branch: bzr merge lp:~glyphobet/inkscape/alphabet_soup
Reviewer Review Type Date Requested Status
jazzynico (community) 2011-07-18 Approve on 2011-07-18
Review via email: mp+68203@code.launchpad.net

Description of the change

These changes fix some longstanding bugs in the Render -> Alphabet Soup extension. Bugs that are fixed:

* The components which are assembled into letters did not line up perfectly
* The extension did not expose Alphabet Soup's "randomize" mode, which generates random, letter-like symbols instead of weird letters.
* The assembly process reflected paths and thus generated counterclockwise paths, which sometimes caused white areas of overlap.

I'm the original author of Alphabet Soup, but Joel Holdsworth was the one who ported it to an Inkscape extension.

I haven't touched anything outside of the Alphabet Soup extension, so this should merge cleanly into any branch. I've tried to keep the changes as minimal as possible and in line with code formatting conventions. Please let me know if there's anything else I can do to get these changes merged into whatever branch you feel is appropriate.

To post a comment you must log in.
jazzynico (jazzynico) wrote :

Tested successfully on Windows XP, Inkscape trunk revision 10466.
Just a minor UI consistency fix needed in the INX file, _gui-text="Randomize:" should be _gui-text="Randomize" (no colon with boolean labels).
Thanks for the corrections!

review: Needs Fixing
lp:~glyphobet/inkscape/alphabet_soup updated on 2011-07-18
10469. By Glyphobet on 2011-07-18

boolean labels shouldn't have colons

Glyphobet (glyphobet) wrote :

> Tested successfully on Windows XP, Inkscape trunk revision 10466.
> Just a minor UI consistency fix needed in the INX file, _gui-text="Randomize:"
> should be _gui-text="Randomize" (no colon with boolean labels).
> Thanks for the corrections!

Label is fixed. Thanks for the speedy review! Do I need to propose it for merging again?

jazzynico (jazzynico) wrote :

> Do I need to propose it for merging again?

No, the diff is automatically updated.

review: Approve
jazzynico (jazzynico) wrote :

Branch merged, trunk revision 10473.
Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'share/extensions/alphabet_soup/Cblob.svg'
--- share/extensions/alphabet_soup/Cblob.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Cblob.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 432,432 C 483.35068,432.05187 514.50621,414.91209 547.74987,377.43357 C 553.86023,366.99152 553.90447,366.48196 549.10143,361.86677 C 542.63049,355.64891 540.54636,350.80909 540.54636,342 C 540.49227,326.31992 552.00549,316.34875 567,315.54636 C 590.16466,316.18468 595.48079,334.58161 593.06817,354.41343 C 585.62156,415.62493 522.34607,462.89212 443.42345,467.61056 C 439.61563,467.83821 435.80782,468.06586 432,468.29351 L 432,432 z"/>9 d="m 432,432 c 51.35068,0.0519 82.50621,-17.08791 115.74987,-54.56643 6.11036,-10.44205 6.1546,-10.95161 1.35156,-15.5668 -6.47094,-6.21786 -8.55507,-11.05768 -8.55507,-19.86677 -0.0541,-15.68008 11.45913,-25.65125 26.45364,-26.45364 23.16466,0.63832 28.48079,19.03525 26.06817,38.86707 C 571.0029,436.23549 512.75953,467.88531 432,468 l 0,-36 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Chook.svg'
--- share/extensions/alphabet_soup/Chook.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Chook.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 432,36 L 432,0.70648772 C 467.12642,1.1207235 500.19031,10.978322 531,27.408775 C 536.225,30.593268 542.17901,33.437152 544.23113,33.728519 C 551.95635,34.825369 558,29.837576 558,22.365141 L 558,18 L 576,18 L 576,126 L 558.27619,126 C 553.02167,64.41188 486.96487,36 432,36 z"/>9 d="m 432,36 0,-36 c 35.12642,0.15801183 68.19031,10.978322 99,27.408775 5.225,3.184493 11.17901,6.028377 13.23113,6.319744 C 551.95635,34.825369 558,29.837576 558,22.365141 L 558,18 l 18,0 0,108 -17.72381,0 C 553.02167,64.41188 486.96487,36 432,36 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Eb.svg'
--- share/extensions/alphabet_soup/Eb.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Eb.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 234,450.23743 C 244.37552,448.73762 249.81245,441.63048 252.23743,432 L 432,432 L 432,468 L 234,468 L 234,450.23743 z"/>9 d="M 234,450.23743 C 243.83007,450.1558 251.21138,441.4123 252,432 l 180,0 0,36 -198,0 0,-17.76257 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Et.svg'
--- share/extensions/alphabet_soup/Et.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Et.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 251.17613,31.368729 C 249.56512,25.345319 244.65468,20.434883 238.63127,18.823867 L 234,17.58519 L 234,9.2925952 L 234,1 L 333,1 L 432,1 L 432,18.5 L 432,36 L 342.2074,36 L 252.41481,36 L 251.17613,31.368729 z "/>9 d="M 234,17.58519 234,0 432,0 432,36 252,36 C 251.9603,23.895333 246.34816,17.721488 234,17.58519 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/G.svg'
--- share/extensions/alphabet_soup/G.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/G.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 432,432.25825 C 474.76518,430.45997 516.4134,399.01191 521.0448,354.62003 L 521.0448,299.42692 C 520.54691,291.3582 511.0076,289.45944 504,287.58519 L 504,270 L 612,270 L 612,287.58519 C 604.95991,288.94718 599.47776,292.02235 595.89633,298.4214 L 595.89633,397.21641 C 557.61928,448.03031 492.7847,465.36976 432,468.30395 L 432,432.25825 z"/>9 d="m 432,432 c 40.73753,0.0266 88.26593,-36.02956 89.0448,-77.37997 l 0,-48.62003 C 520.74967,296.51193 512.02142,287.43179 504,287.58519 L 504,270 l 108,0 0,17.58519 C 603.54056,287.1223 595.2197,296.35671 595.89633,306 l 0,91.21641 C 557.61928,448.03031 481.8354,468.10728 432,468 l 0,-36 z" />
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/IBSerif.svg'
--- share/extensions/alphabet_soup/IBSerif.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/IBSerif.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 234,450.41481 C 244.50437,448.78945 249.81733,441.71165 252.41481,432 L 341.58519,432 C 343.21055,442.50437 350.28835,447.81733 360,450.41481 L 360,468 L 234,468 L 234,450.41481 z"/>9 d="m 234,450.41481 c 10.36553,-0.16751 18.17938,-8.842 18,-18.41481 l 90,0 c 0.30635,10.08784 8.28835,17.76285 18,18 l 0,18 -126,0 0,-17.58519 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/ITSerif.svg'
--- share/extensions/alphabet_soup/ITSerif.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/ITSerif.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 216,17.58519 L 216,1 L 342,1 L 342,17.58519 C 331.49563,19.210548 326.18267,26.288348 323.58519,36 L 234.41481,36 C 232.78945,25.495637 225.71166,20.182664 216,17.58519 z" />9 d="m 216,18 0,-18 126,0 0,18 c -9.949,0.167507 -17.90169,8.010662 -18,18 l -90,0 C 233.69365,25.703901 225.43397,18.167722 216,18 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Lb.svg'
--- share/extensions/alphabet_soup/Lb.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Lb.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 432,432 L 557.34775,432 C 572.03193,431.57641 575.48665,419.42011 576,406.53212 L 576,396 L 594,396 L 594,468 L 432,468 L 432,432 z"/>9 d="m 432,432 117,0 c 14.59492,-0.0666 26.75442,-13.39796 27,-27 l 0,-9 18,0 0,72 -162,0 0,-36 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Lt.svg'
--- share/extensions/alphabet_soup/Lt.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Lt.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 576,61.467881 C 577.08469,43.108337 568.04996,36.667214 551.79944,36 L 432,36 L 432,1 L 594,1 L 594,72 L 576,72 L 576,61.467881 z"/>9 d="M 576,61.467881 C 575.8351,48.463709 564.09019,35.953164 549,36 l -117,0 0,-36 162,0 0,72 -18,0 0,-10.532119 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Oterm.svg'
--- share/extensions/alphabet_soup/Oterm.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Oterm.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 432,432.28491 C 519.05219,420.92031 539.41198,305.43476 539.90939,235.96367 C 540.39442,168.22112 519.19629,44.828918 432,35.715087 L 432,0 C 560.22504,1.9563018 630.31985,120.47734 629.90669,235.8117 C 629.50331,348.41772 555.79773,468 432,468 L 432,432.28491 z" />9 d="M 432,432.28491 C 520.9663,433.84056 539.41817,304.57049 539.90939,235.96367 540.40061,167.35685 519.19629,35.736893 432,35.715087 L 432,0 C 560.70357,0.52071898 630.31496,121.84151 629.90669,235.8117 629.49842,349.78189 555.79773,468 432,468 l 0,-35.71509 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/P.svg'
--- share/extensions/alphabet_soup/P.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/P.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 432,216 C 479.35472,215.49184 502.54401,167.21061 503.44374,126 C 504.34347,84.789388 477.64109,36 432,36 C 432,24.235496 432,12.470992 432,0.70648772 C 504.20013,1.905354 593.35821,43.100442 593.33321,126.5 C 593.30821,209.89956 505.7797,247.8826 432,252.29351 C 432,240.19567 432,228.09784 432,216 z"/>9 d="m 432,216 c 47.35472,-0.50816 70.54401,-48.78939 71.44374,-90 C 504.34347,84.789389 477.64109,36 432,36 432,24.235496 432,11.764504 432,0 503.94288,0.16988052 593.35821,43.100441 593.33321,126.5 593.30821,209.89956 504.23622,251.96228 432,252 c 0,-12.09784 0,-23.90216 0,-36 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Q.svg'
--- share/extensions/alphabet_soup/Q.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Q.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 526.32135,439.9524 C 498.13523,459.02351 465.23453,465.28151 432,468.30558 C 432.02713,456.20377 431.96306,444.10178 432,432 C 523.6997,415.67832 539.38316,302.39981 539.38316,234 C 539.38316,165.47354 516.9063,43.985213 432,36 L 432,-0.30557714 C 556.71815,4.8200503 628.82893,118.48894 629.44733,234 C 630.4116,299.68807 606.28121,362.36397 561.98439,410.7975 C 578.58768,433.83295 602.18706,447.65055 630,451.44316 L 630,469 C 592.94051,470.08844 559.04645,455.55561 526.32135,439.9524 z"/>9 d="M 526.32135,439.9524 C 498.13523,459.02351 460.91524,468.33538 432,468 c 0.0271,-12.10181 -0.0369,-23.89822 0,-36 C 505.94261,431.996 539.38316,302.46313 539.38316,234 539.38316,165.53687 513.54685,35.82655 432,36 l 0,-36 c 120.87878,0.32641387 196.43844,118.49285 197.44733,234 0.57378,65.69198 -23.16612,128.36397 -67.46294,176.7975 C 578.58768,433.83295 602.18706,446.20739 630,450 l 0,18 c -37.05949,1.08844 -70.95355,-12.44439 -103.67865,-28.0476 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Vser.svg'
--- share/extensions/alphabet_soup/Vser.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Vser.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 234,18 L 234,0 L 328,0 L 328,18 L 321.42308,18 C 315.4772,17.537933 309.60446,20.486336 309,26.923077 L 309,30 L 306,30 L 306,18 L 270,18 L 270,33 L 257.02684,33 C 253.75659,21.992194 245.07284,18.057219 234,18 z M 594,18 L 522,18 L 522,30 L 519.13647,30 C 519.04442,29.519594 519,27.355241 519,26.636364 C 518.70573,19.373435 512.35553,18.083131 506.36364,18 L 499,18 L 499,0 L 630,0 L 630,18 L 625.5651,18 C 616.691,17.782578 608.53626,24.060156 607.3906,33 L 594,33 L 594,18 z"/>9 d="m 234,18 0,-18 94,0 0,18 -6.57692,0 c -5.94588,-0.462067 -11.16407,6.690532 -8.71399,14 L 309,32 l -3,0 0,-14 -36,0 0.43636,14 -15.80952,0 C 251.35659,20.992194 245.07284,18.057219 234,18 z m 360,0 -72,0 0,14 -2.86353,0 c -0.0921,-0.480406 -3.84556,0.500695 -3.84556,-0.218182 C 517.61482,24.518889 512.35553,18.083131 506.36364,18 L 499,18 l 0,-18 131,0 0,18 -4.4349,0 c -8.8741,-0.217422 -13.97429,5.278338 -16.21086,14 L 594,32 594,18 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/Xvt.svg'
--- share/extensions/alphabet_soup/Xvt.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/Xvt.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 252,36.41384 C 252.29636,26.645119 244.96885,23.022186 238.47878,18.021962 L 342,18 L 342,234 L 252,234 L 252,36.41384 z"/>9 d="m 252,36 c 0.29636,-9.768721 -7.64197,-18.037114 -18,-18 l 108,0 0,216 -90,0 0,-198 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/abase.svg'
--- share/extensions/alphabet_soup/abase.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/abase.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 396.54555,271.5 C 403.73674,198.51344 458.75438,180.0647 522,179.73419 L 522,197.72815 C 488.98342,201.50437 470.83028,236.95708 470.83028,264.55678 L 467.86228,396 L 395.91491,396 L 396.54555,271.5 z"/>9 d="m 396,271.5 c 0.33614,-72.76543 62.75438,-91.16949 126,-91.5 l 0,18 c -33.67997,-0.42526 -54,38.9573 -54,66.557 l 0,131.443 -72,0 0,-124.5 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/barcap.svg'
--- share/extensions/alphabet_soup/barcap.svg 2008-03-18 23:02:45 +0000
+++ share/extensions/alphabet_soup/barcap.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 252.24192,36.664455 L 341.6763,36.664455 L 341.6763,431.93248 L 252.24192,431.93248 L 252.24192,36.664455 z"/>9 d="m 252,36 90,0 0,396 -90,0 0,-396 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/gamma.svg'
--- share/extensions/alphabet_soup/gamma.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/gamma.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 413.74236,645.64547 C 383.0319,635.17985 363.9313,598.29804 370.41198,561.97779 C 372.2609,551.61571 374.419,546.6985 395.41883,505 L 413.80063,468.5 L 450.19937,468.5 L 468.58117,505 C 489.581,546.6985 491.7391,551.61571 493.58802,561.97779 C 499.03048,592.47942 487.00637,623.14961 463.42158,638.92408 C 449.05594,648.48459 430.22428,650.72284 413.74236,645.64547 z M 441.26639,611.4249 C 453.76562,607.16598 466.11947,585.75784 461.95112,567 C 460.95667,562.52492 433.16738,505 432,505 C 430.83262,505 403.04333,562.52492 402.04888,567 C 398.82769,581.49556 403.43305,596.9298 413.66762,605.93863 C 421.31834,612.67306 428.76716,615.68381 441.26639,611.4249 z"/>9 d="M 413.74236,645.64547 C 383.0319,635.17985 363.9313,598.29804 370.41198,561.97779 372.2609,551.61571 374.419,546.6985 395.41883,505 l 18.3818,-37 36.39874,0 18.3818,37 c 20.99983,41.6985 23.15793,46.61571 25.00685,56.97779 5.44246,30.50163 -6.58165,61.17182 -30.16644,76.94629 -14.36564,9.56051 -33.1973,11.79876 -49.67922,6.72139 z M 441.26639,611.4249 C 453.76562,607.16598 466.11947,585.75784 461.95112,567 460.95667,562.52492 433.16738,505 432,505 c -1.16738,0 -28.95667,57.52492 -29.95112,62 -3.22119,14.49556 1.38417,29.9298 11.61874,38.93863 7.65072,6.73443 15.09954,9.74518 27.59877,5.48627 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/h.svg'
--- share/extensions/alphabet_soup/h.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/h.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 575.2219,287.78922 C 574.2749,253.72932 561.8497,203.19019 522,197.72815 L 522,179.73419 C 590.28223,178.93273 647.45445,205.07873 647.45445,271.5 L 648.08509,396 L 576.13772,396 L 575.2219,287.78922 z"/>9 d="M 575.2219,287.78922 C 575.1595,253.50817 561.4074,197.88262 522,197.72815 l 0,-17.99396 c 68.28223,0.0831 125.45445,25.34454 125.45445,91.76581 l 0.63064,124.5 -71.94737,0 -0.91582,-108.21078 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/hcap.svg'
--- share/extensions/alphabet_soup/hcap.svg 2008-03-18 23:02:45 +0000
+++ share/extensions/alphabet_soup/hcap.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 340,214 L 434,214 L 434,254 L 340,254 L 340,214 z"/>9 d="m 342,216 90,0 0,36 -90,0 0,-36 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/j.svg'
--- share/extensions/alphabet_soup/j.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/j.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 522,1 L 522,17.742339 C 481.28616,23.49216 468.03999,72.416193 468,108 L 395.76701,108 C 400.36091,43.138368 460.53099,1.2823612 522,1 z" />9 d="m 522,0 0,18 c -40.93265,-0.04875 -53.96001,54.416193 -54,90 l -72,0 C 396.21762,44.123031 460.42158,0.17295425 522,0 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/lserif.svg'
--- share/extensions/alphabet_soup/lserif.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/lserif.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 377.93068,432.20912 L 377.93068,414.43335 C 388.46323,412.80461 393.80806,405.7463 396.41481,396 L 468,396 L 468,467.95278 L 377.93068,432.20912 z"/>9 d="m 377.93068,432.20912 0,-17.77577 C 387.72752,413.90818 396.04182,405.2313 396,396 l 72,0 0,71.95278 -90.06932,-35.74366 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/m.svg'
--- share/extensions/alphabet_soup/m.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/m.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 576.13772,280.98105 C 572.44938,248.84942 559.30603,202.84155 522,197.72815 L 522,179.73419 C 565.19741,177.92174 604.08134,192.77489 630.21232,227.91572 C 647.33056,203.82949 672.66121,186.57085 702,182.25038 L 702,197.74234 C 662.1276,207.18202 650.05284,246.25281 648,282.69287 L 648,396 L 576.13772,396 L 576.13772,280.98105 z"/>9 d="M 576.13772,280.98105 C 576.87501,248.84942 559.52731,198.85849 522,197.72815 L 522,180 c 43.19741,0.40036 82.08134,12.77489 108.21232,47.91572 C 647.33056,203.82949 664.91637,180.11613 702,180 l 0,17.74234 c -31.68499,-0.0754 -53.93869,48.95303 -54,84.95053 L 648,396 l -71.86228,0 0,-115.01895 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/mcap.svg'
--- share/extensions/alphabet_soup/mcap.svg 2008-03-18 23:02:45 +0000
+++ share/extensions/alphabet_soup/mcap.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 195.07094,35.141836 C 192.93943,26.618646 186.69352,21 178,21 L 178,0 L 300,0 C 304.92852,4.0636792 307.05515,13.545636 308.01012,20 L 290,20 L 290,434 L 196,434 C 194.50054,301.07612 198.17114,168.04946 195.07094,35.141836 z M 574,56 L 556,56 L 556,20 L 520,20 C 520.33022,13.651854 521.21314,4.0134453 526.71404,1.1368684e-13 L 686,1.1368684e-13 L 686,21 C 676.96001,20.374092 671.60532,27.237265 668.92906,35.141836 L 668,434 L 574,434 L 574,56 z"/>9 d="M 198,36 C 197.9768,27.008298 190.09906,18 180,18 L 180,0 302.81899,0 308.4585,18.042372 288,18.042 288,432 l -90,0 0,-396 z m 378,20 -20,0 0,-38 -36,0 L 525.63278,0 686,0 l 0,18 c -9.03999,-0.625908 -20.60333,7.51861 -20,18 l 0,396 -90,0 0,-376 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/o.svg'
--- share/extensions/alphabet_soup/o.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/o.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 396.40448,322.99577 C 395.58905,253.10571 448.00479,180 522,180 L 522,197.5267 C 484.55576,207.67232 469.05389,282.8807 468.5,324 C 469.24734,364.1501 484.83088,440.79214 522,450.4733 L 522,468 C 445.49339,467.3577 397.16518,393.82612 396.40448,322.99577 z"/>9 d="M 396.40448,322.99577 C 395.61641,252.63556 448.00479,180 522,180 l 0,17.5267 c -37.73872,0.42783 -53.59673,85.8386 -53.5,126.4733 0.0967,40.6347 16.33088,126.80441 53.5,126.4733 L 522,468 C 445.49339,467.3577 397.19254,393.35597 396.40448,322.99577 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/ocap.svg'
--- share/extensions/alphabet_soup/ocap.svg 2008-03-18 23:02:45 +0000
+++ share/extensions/alphabet_soup/ocap.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 232,234 C 233.66926,111.97403 302.98118,0.35957946 434,0.35957946 L 434,39 C 349.8511,41.371236 327.49239,172.9012 327.43561,239.14817 C 326.36353,301.17293 356.5529,429 434,429 L 434,470 C 304.64047,469.72235 234.79031,354.23983 232,234 z"/>9 d="M 232,234 C 231.43948,112.8671 300.98118,0 432,0 l 0,36 C 347.8511,35.970211 328.00004,169.86413 327.43561,234 326.87118,298.13587 354.5529,432 432,432 l 0,36 C 302.64047,467.72235 232.56052,355.1329 232,234 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/question.svg'
--- share/extensions/alphabet_soup/question.svg 2008-03-18 23:02:45 +0000
+++ share/extensions/alphabet_soup/question.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 379.1115,243.87415 C 331.63948,221.02907 305.17158,177.44842 304,126 C 304.10942,71.362793 335.63742,26.535953 385.13135,5.8274636 C 400.59579,0.94927881 417.73322,-0.74582647 434,0.20129697 L 434,20.739895 C 389.42751,27.265011 381.35691,88.664883 381.52445,126 C 381.73345,172.57377 390.02396,229.93178 446.86385,231.99421 C 455.7306,232.31594 457.80064,232.32202 461.2119,234.23925 C 468.73163,238.58122 470,246.15478 470,254 L 393.04611,254 C 390.12737,248.74743 384.26569,246.43772 379.1115,243.87415 z"/>9 d="M 379.1115,243.87415 C 331.66919,220.96836 304.53108,179.04281 304,126 303.46892,72.957187 335.24929,25.47568 385.13135,5.8274636 400.20766,-0.11099414 416.03391,-0.18850556 432.68,0 l 0,18 c -44.57249,0.07686 -51.34382,66.045556 -51.15555,108 0.18827,41.95444 8.49951,103.93178 65.3394,105.99421 8.86675,0.32173 10.93679,0.32781 14.34805,2.24504 C 468.73163,238.58122 468,244.15478 468,252 l -72,0 c -2.91874,-5.25257 -11.7046,-5.62299 -16.8885,-8.12585 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/rcap.svg'
--- share/extensions/alphabet_soup/rcap.svg 2008-03-18 23:02:45 +0000
+++ share/extensions/alphabet_soup/rcap.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 499.24145,321.47832 C 491.28205,288.08485 466.98548,255 430,255 L 430,213.71285 C 506.29217,215.25336 571.222,243.91309 595.45778,321.5 L 596.09296,434 L 502.21668,434 C 499.28967,396.82866 505.98901,358.30974 499.24145,321.47832 z"/>9 d="M 499.24145,321.47832 C 491.28205,288.08485 468.98548,252 432,252 l 0,-36 c 79.22032,0.18906 162.09041,61.50434 162,124 l 0,92 -90,0 c 10e-4,-37.17134 1.98901,-73.69026 -4.75855,-110.52168 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/tserif.svg'
--- share/extensions/alphabet_soup/tserif.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/tserif.svg 2011-07-18 20:31:26 +0000
@@ -1,16 +1,10 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3<svg2<svg
4 xmlns:svg="http://www.w3.org/2000/svg"3 xmlns:svg="http://www.w3.org/2000/svg"
5 xmlns="http://www.w3.org/2000/svg"4 xmlns="http://www.w3.org/2000/svg"
6 version="1.0"5 version="1.0"
7 width="864"6 width="864"
8 height="648"7 height="648">
9 id="svg3109">
10 <defs
11 id="defs3112" />
12 <path8 <path
13 d="M 396,396 L 468.5424,396 C 471.23667,411.21933 478.03593,431.45141 496.28288,431.8016 C 507.19866,431.37331 510.32553,421.46179 516.756,415 L 532,427.78714 C 522.68412,452.69658 494.97645,467.13684 470.33388,468.03876 C 425.31789,469.68634 402.20226,438.60703 396,396 z"9 d="m 396,396 72,0 c -0.003,12.59674 10.03593,35.45141 28.28288,35.8016 C 507.19866,431.37331 510.32553,421.46179 516.756,415 L 532,427.78714 c -9.31588,24.90944 -37.02355,39.3497 -61.66612,40.25162 C 425.31789,469.68634 396.13284,433.43678 396,396 z"/>
14 id="path2615"
15 style="fill:#000000" />
16</svg>10</svg>
1711
=== modified file 'share/extensions/alphabet_soup/vcap.svg'
--- share/extensions/alphabet_soup/vcap.svg 2008-03-18 23:02:45 +0000
+++ share/extensions/alphabet_soup/vcap.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 250,16 L 308.5,16.013451 L 414,344 L 519.5,16.013451 L 614,16 L 470.5,469.98578 L 393.5,469.98578 L 250,16 z"/>9 d="m 250,18 58.5,0 105.5,326 106,-326 94,0 -143.5,450 -77,0 L 250,18 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/alphabet_soup/vserl.svg'
--- share/extensions/alphabet_soup/vserl.svg 2008-12-10 21:36:50 +0000
+++ share/extensions/alphabet_soup/vserl.svg 2011-07-18 20:31:26 +0000
@@ -6,5 +6,5 @@
6 width="864"6 width="864"
7 height="648">7 height="648">
8 <path8 <path
9 d="M 286.04853,213.28223 C 281.15258,203.54653 275.32901,198.99797 264.3185,198 L 261,198 L 261,180 L 342,180 L 342,198 L 334.42308,198 C 327.38192,198 326.63946,198.20669 323.92308,200.92308 C 318.67531,205.9855 322.92458,212.00136 323.5,217.98886 L 323.5,286.97955 L 286.04853,213.28223 z"/>9 d="M 286.04853,213.28223 C 281.1125,203.56679 275.32901,198.99797 264.3185,198 l -3.3185,0 0,-18 81,0 0,18 -7.57692,0 c -7.04116,0 -7.75193,0.23896 -10.5,2.92308 -5.21608,5.09469 -2.20175,11.07828 0.23324,15.75315 l -0.10939,71.39718 -37.9984,-74.79118 z"/>
10</svg>10</svg>
1111
=== modified file 'share/extensions/render_alphabetsoup.inx'
--- share/extensions/render_alphabetsoup.inx 2010-09-09 16:26:54 +0000
+++ share/extensions/render_alphabetsoup.inx 2011-07-18 20:31:26 +0000
@@ -7,7 +7,7 @@
7 <dependency type="executable" location="extensions">inkex.py</dependency>7 <dependency type="executable" location="extensions">inkex.py</dependency>
8 <param name="text" type="string" _gui-text="Text:">Inkscape</param>8 <param name="text" type="string" _gui-text="Text:">Inkscape</param>
9 <param name="zoom" type="float" min="0.0" max="1000.0" _gui-text="Scale:">8.0</param>9 <param name="zoom" type="float" min="0.0" max="1000.0" _gui-text="Scale:">8.0</param>
10 <param name="seed" type="int" min="0" max="65535" _gui-text="Random Seed:">0</param>10 <param name="randomize" type="boolean" _gui-text="Randomize">false</param>
11 <effect>11 <effect>
12 <object-type>all</object-type>12 <object-type>all</object-type>
13 <effects-menu>13 <effects-menu>
1414
=== modified file 'share/extensions/render_alphabetsoup.py'
--- share/extensions/render_alphabetsoup.py 2010-08-30 11:29:57 +0000
+++ share/extensions/render_alphabetsoup.py 2011-07-18 20:31:26 +0000
@@ -31,6 +31,7 @@
31import simplepath31import simplepath
32import os32import os
33import sys33import sys
34import re
34import gettext35import gettext
35_ = gettext.gettext36_ = gettext.gettext
3637
@@ -66,6 +67,33 @@
66 else:67 else:
67 return pathA + pathB68 return pathA + pathB
6869
70def reverseComponent(c):
71 nc = []
72 last = c.pop()
73 nc.append(['M', last[1][-2:]])
74 while c:
75 this = c.pop()
76 cmd = last[0]
77 if cmd == 'C':
78 nc.append([last[0], last[1][2:4] + last[1][:2] + this[1][-2:]])
79 else:
80 nc.append([last[0], this[1][-2:]])
81 last = this
82 return nc
83
84def reversePath(sp):
85 rp = []
86 component = []
87 for p in sp:
88 cmd, params = p
89 if cmd == 'Z':
90 rp.extend(reverseComponent(component))
91 rp.append(['Z', []])
92 component = []
93 else:
94 component.append(p)
95 return rp
96
69def flipLeftRight( sp, width ):97def flipLeftRight( sp, width ):
70 for cmd,params in sp:98 for cmd,params in sp:
71 defs = simplepath.pathdefs[cmd]99 defs = simplepath.pathdefs[cmd]
@@ -200,11 +228,13 @@
200 tbimage = image 228 tbimage = image
201 if ( stack[0] == "-" ): # top-bottom flip229 if ( stack[0] == "-" ): # top-bottom flip
202 flipTopBottom(tbimage, height)230 flipTopBottom(tbimage, height)
231 tbimage = reversePath(tbimage)
203 stack.pop( 0 )232 stack.pop( 0 )
204233
205 lrimage = tbimage234 lrimage = tbimage
206 if ( stack[0] == "|" ): # left-right flip235 if ( stack[0] == "|" ): # left-right flip
207 flipLeftRight(tbimage, width)236 flipLeftRight(tbimage, width)
237 lrimage = reversePath(lrimage)
208 stack.pop( 0 )238 stack.pop( 0 )
209 return lrimage239 return lrimage
210240
@@ -292,14 +322,14 @@
292 simplepath.scalePath(image, zoom/units, zoom/units)322 simplepath.scalePath(image, zoom/units, zoom/units)
293 return image, bbox[1] - bbox[0], bbox[3] - bbox[2]323 return image, bbox[1] - bbox[0], bbox[3] - bbox[2]
294324
295def randomize_input_string( str, zoom ): # generate list of images based on input string325def randomize_input_string(tokens, zoom ): # generate a glyph starting from each token in the input string
296 imagelist = []326 imagelist = []
297327
298 for i in range(0,len(str)):328 for i in range(0,len(tokens)):
299 char = str[i]329 char = tokens[i]
300 #if ( re.match("[a-zA-Z0-9?]", char)):330 #if ( re.match("[a-zA-Z0-9?]", char)):
301 if ( alphabet.has_key(char)):331 if ( alphabet.has_key(char)):
302 if ((i > 0) and (char == str[i-1])): # if this letter matches previous letter332 if ((i > 0) and (char == tokens[i-1])): # if this letter matches previous letter
303 imagelist.append(imagelist[len(stack)-1])# make them the same image333 imagelist.append(imagelist[len(stack)-1])# make them the same image
304 else: # generate image for letter334 else: # generate image for letter
305 stack = string.split( alphabet[char][random.randint(0,(len(alphabet[char])-1))] , "." )335 stack = string.split( alphabet[char][random.randint(0,(len(alphabet[char])-1))] , "." )
@@ -308,15 +338,33 @@
308 elif( char == " "): # add a " " space to the image list338 elif( char == " "): # add a " " space to the image list
309 imagelist.append( " " )339 imagelist.append( " " )
310 else: # this character is not in config.alphabet, skip it340 else: # this character is not in config.alphabet, skip it
311 inkex.errormsg(_("bad character") + " = 0x%x" % ord(char))341 sys.stderr.write('bad character "%s"\n' % char)
342 return imagelist
343
344def generate_random_string( tokens, zoom ): # generate a totally random glyph for each glyph in the input string
345 imagelist = []
346 for char in tokens:
347 if ( char == " "): # add a " " space to the image list
348 imagelist.append( " " )
349 else:
350 if ( re.match("[a-z]", char )): # generate lowercase letter
351 stack = generate("lc")
352 elif ( re.match("[A-Z]", char )): # generate uppercase letter
353 stack = generate("UC")
354 else: # this character is not in config.alphabet, skip it
355 sys.stderr.write('bad character"%s"\n' % char)
356 stack = generate("start")
357 imagelist.append( draw_crop_scale( stack, zoom ))
358
312 return imagelist359 return imagelist
313360
314def optikern( image, width, zoom ): # optical kerning algorithm361def optikern( image, width, zoom ): # optical kerning algorithm
315 left = []362 left = []
316 right = []363 right = []
317364
318 for i in range( 0, 36 ):365 resolution = 8
319 y = 0.5 * (i + 0.5) * zoom366 for i in range( 0, 18 * resolution ):
367 y = 1.0/resolution * (i + 0.5) * zoom
320 xmin = None368 xmin = None
321 xmax = None369 xmax = None
322370
@@ -425,6 +473,29 @@
425473
426 return workspace474 return workspace
427475
476def tokenize(text):
477 """Tokenize the string, looking for LaTeX style, multi-character tokens in the string, like \\yogh."""
478 tokens = []
479 i = 0
480 while i < len(text):
481 c = text[i]
482 i += 1
483 if c == '\\': # found the beginning of an escape
484 t = ''
485 while i < len(text): # gobble up content of the escape
486 c = text[i]
487 if c == '\\': # found another escape, stop this one
488 break
489 i += 1
490 if c == ' ': # a space terminates this escape
491 break
492 t += c # stick this character onto the token
493 if t:
494 tokens.append(t)
495 else:
496 tokens.append(c)
497 return tokens
498
428class AlphabetSoup(inkex.Effect):499class AlphabetSoup(inkex.Effect):
429 def __init__(self):500 def __init__(self):
430 inkex.Effect.__init__(self)501 inkex.Effect.__init__(self)
@@ -436,16 +507,20 @@
436 action="store", type="float", 507 action="store", type="float",
437 dest="zoom", default="8.0",508 dest="zoom", default="8.0",
438 help="The zoom on the output graphics")509 help="The zoom on the output graphics")
439 self.OptionParser.add_option("-s", "--seed",510 self.OptionParser.add_option("-r", "--randomize",
440 action="store", type="int", 511 action="store", type="inkbool",
441 dest="seed", default="0",512 dest="randomize", default=False,
442 help="The random seed for the soup")513 help="Generate random (unreadable) text")
443514
444 def effect(self):515 def effect(self):
445 zoom = self.options.zoom516 zoom = self.options.zoom
446 random.seed(self.options.seed)517
447518 if self.options.randomize:
448 imagelist = randomize_input_string(self.options.text, zoom)519 imagelist = generate_random_string(self.options.text, zoom)
520 else:
521 tokens = tokenize(self.options.text)
522 imagelist = randomize_input_string(tokens, zoom)
523
449 image = layoutstring( imagelist, zoom )524 image = layoutstring( imagelist, zoom )
450525
451 if image:526 if image: