{"id":2106,"date":"2012-02-01T14:57:07","date_gmt":"2012-02-01T14:57:07","guid":{"rendered":"http:\/\/www.readytext.co.uk\/?p=2106"},"modified":"2013-11-28T09:05:22","modified_gmt":"2013-11-28T09:05:22","slug":"from-typeset-arabic-directly-to-svg-with-luatex","status":"publish","type":"post","link":"https:\/\/www.readytext.co.uk\/?p=2106","title":{"rendered":"From typeset Arabic directly to SVG with LuaTeX"},"content":{"rendered":"<h1>Just a brief post<\/h1>\n<p>With the explosive growth of interest in &#8220;eBooks&#8221; and the use of SVG in EPUB3, I thought it would be worth experimenting to see how &#8220;easy&#8221; it was to produce SVG directly from typeset Arabic: using LuaTeX. Turns out it is certainly quite possible and an inline SVG example is shown below (OK, it should be displayed on the right-hand side, I know ;-)). This SVG was created using a point size of 100 for all calculations of the SVG &#8220;width&#8221; and &#8220;height&#8221; values. <em>No hand editing was done at all<\/em>, it is exactly as output. Need to finish kerning, vowel placement and cursive positioning in the SVG export functions but I think that should be OK. <\/p>\n<p>Very likely that full mathematical formulae could also be exported directly to SVG using LuaTeX&#8217;s node structures: but they are deeply nested and complex so it could be tricky. Quite possibly, LuaTeX offers excellent potential for fully automated eBook production and, of course, print PDF production, from a single TeX source file suitably marked-up.  <\/p>\n<p><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\"  width=\"115.381pt\" height=\"84.082pt\" viewBox=\"0 0 2363 1722\"><defs> <path id = \"uniFEB7\" d=\" M802 376 Q 818 343 824 319 Q 830 295 835 267 Q 840 239 840 217 Q 840 183 833 151 Q 826 119 813 94 Q 801 69 783 54 Q 766 39 746 39 Q 692 39 643 55 Q 594 72 562 95 Q 534 55 491 26 Q 449 -2 384 -2 Q 347 -2 314 3 Q 282 9 256 17 Q 230 26 211 36 Q 192 47 182 57 Q 142 28 92 14 Q 43 0 0 0 Q -18 0 -33 18 Q -48 36 -48 57 Q -48 78 -29 96 Q -11 114 34 114 Q 49 114 69 117 Q 90 120 112 126 Q 135 132 157 141 Q 179 150 197 162 Q 210 171 223 184 Q 236 197 247 208 Q 259 220 268 228 Q 277 237 283 237 Q 291 227 291 220 Q 290 198 282 178 Q 275 158 272 149 Q 284 135 313 125 Q 342 116 399 116 Q 456 116 490 138 Q 525 161 544 196 Q 553 212 562 235 Q 572 259 581 281 Q 591 304 600 320 Q 609 336 617 336 Q 626 318 626 307 Q 626 285 622 260 Q 618 235 609 203 Q 637 177 682 162 Q 727 148 769 148 Q 786 148 791 152 Q 797 156 797 173 Q 797 188 793 202 Q 789 217 783 229 Q 778 241 774 250 Q 770 259 770 264 Q 770 271 774 289 Q 778 308 783 327 Q 788 346 802 376Z M606 657 L 706 587 L 656 482 L 555 552 L 606 657Z M433 630 L 534 561 L 483 456 L 383 525 L 433 630Z M487 806 L 587 737 L 537 632 L 436 701 L 487 806 Z \"><\/path> <path id = \"uniFEDC\" d=\" M702 0 Q 677 0 656 7 Q 636 14 611 33 Q 586 53 551 87 Q 516 122 461 178 Q 431 208 397 243 Q 364 279 326 317 Q 331 296 334 273 Q 337 250 337 233 Q 337 201 326 170 Q 315 139 298 112 Q 282 86 263 66 Q 244 46 229 37 Q 206 23 172 15 Q 138 8 103 4 Q 69 1 40 0 Q 12 0 0 0 Q -20 0 -34 18 Q -48 36 -48 57 Q -48 78 -26 96 Q -5 114 34 114 Q 44 114 63 114 Q 83 115 105 116 Q 128 118 151 120 Q 174 123 192 128 Q 207 132 224 139 Q 242 146 257 154 Q 273 163 283 171 Q 294 180 294 188 Q 294 216 285 246 Q 277 276 256 313 Q 235 351 200 399 Q 165 448 113 513 Q 89 543 64 570 Q 40 597 19 620 Q -1 643 -14 660 Q -28 678 -29 689 Q -30 694 -30 698 Q -31 703 -31 708 Q -31 721 -29 735 Q -27 750 -24 764 Q -21 778 -17 790 Q -13 803 -9 812 Q 1 833 32 860 Q 64 888 112 920 Q 160 952 221 987 Q 283 1022 353 1060 Q 400 1085 453 1113 Q 506 1141 558 1168 Q 610 1195 658 1219 Q 707 1244 745 1262 Q 783 1281 836 1300 Q 836 1294 832 1280 Q 829 1267 824 1251 Q 820 1236 814 1222 Q 809 1209 805 1203 Q 762 1179 728 1161 Q 695 1144 651 1121 Q 608 1099 560 1074 Q 513 1049 464 1023 Q 416 998 373 975 Q 309 940 251 906 Q 193 873 147 844 Q 102 816 71 794 Q 41 772 32 759 Q 89 701 150 638 Q 211 576 271 514 Q 332 453 389 395 Q 447 337 496 288 Q 546 239 585 202 Q 624 165 648 145 Q 674 123 697 118 Q 720 114 736 114 L 702 0 Z \"><\/path> <path id = \"uniFEAE\" d=\" M666 0 L 607 -4 Q 602 -74 581 -132 Q 561 -190 529 -247 Q 511 -279 484 -310 Q 457 -341 426 -366 Q 396 -391 365 -406 Q 334 -422 308 -422 Q 255 -413 221 -406 Q 187 -399 148 -390 Q 109 -382 76 -373 Q 43 -365 0 -347 L 15 -343 Q 25 -343 39 -343 Q 54 -344 74 -344 Q 102 -344 136 -342 Q 171 -340 209 -332 Q 247 -325 287 -311 Q 327 -297 365 -273 Q 458 -215 506 -146 Q 554 -78 568 -5 Q 562 32 552 57 Q 542 83 532 99 Q 522 116 508 135 Q 508 142 512 163 Q 516 185 521 207 Q 527 230 543 265 Q 557 251 563 240 Q 569 230 574 216 Q 580 203 583 191 Q 589 168 597 156 Q 606 144 616 135 Q 629 123 648 118 Q 654 116 669 115 Q 684 114 700 114 L 666 0 Z \"><\/path> <path id = \"uniFE8D\" d=\" M247 51 Q 245 96 234 174 Q 224 253 205 359 Q 195 414 183 479 Q 171 544 160 610 Q 149 676 140 740 Q 132 804 129 858 Q 129 864 134 887 Q 140 910 147 935 Q 155 960 172 1000 Q 182 963 187 909 Q 200 777 217 665 Q 234 554 248 463 Q 254 424 260 378 Q 267 332 272 285 Q 277 239 280 196 Q 284 153 284 119 Q 284 104 281 83 Q 279 63 275 43 Q 272 24 266 10 Q 261 -3 255 -3 Q 249 -3 248 10 Q 247 24 247 37 L 247 51 Z \"><\/path><\/defs><use xlink:href=\"#uniFEB7\" transform=\"matrix(1,0,0,-1,1523,1300)\"  x=\"0\"  y=\"0\" width=\"2363\" height=\"1722\"\/><use xlink:href=\"#uniFEDC\" transform=\"matrix(1,0,0,-1,821,1300)\"  x=\"0\"  y=\"0\" width=\"2363\" height=\"1722\"\/><use xlink:href=\"#uniFEAE\" transform=\"matrix(1,0,0,-1,155,1300)\"  x=\"0\"  y=\"0\" width=\"2363\" height=\"1722\"\/><use xlink:href=\"#uniFE8D\" transform=\"matrix(1,0,0,-1,-129,1300)\"  x=\"0\"  y=\"0\" width=\"2363\" height=\"1722\"\/><\/svg><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a brief post With the explosive growth of interest in &#8220;eBooks&#8221; and the use of SVG in EPUB3, I thought it would be worth experimenting to see how &#8220;easy&#8221; it was to produce SVG directly from typeset Arabic: using LuaTeX. Turns out it is certainly quite possible and an inline SVG example is shown [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,18],"tags":[],"class_list":["post-2106","post","type-post","status-publish","format-standard","hentry","category-arabic","category-web-tools-and-technologies"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2106"}],"version-history":[{"count":9,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2106\/revisions"}],"predecessor-version":[{"id":3296,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2106\/revisions\/3296"}],"wp:attachment":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}