A second version with explanations.
authorKris Kowal <kris.kowal@cixar.com>
Sun, 18 Sep 2011 20:27:40 +0000 (13:27 -0700)
committerKris Kowal <kris.kowal@cixar.com>
Sun, 18 Sep 2011 20:27:40 +0000 (13:27 -0700)
Added tracking.
Added flourish glyphs to custom type family.
Added phonetic explanation tables.
Changed the default enscription to the one ring poem.
Refined the substitution and transcription tables for "q", "j", punctuation, &c.
Fixed collision between S-hooks and Y-tehta.

13 files changed:
about.html
combinations.html
custom-webfont.eot
custom-webfont.svg
custom-webfont.ttf
custom-webfont.woff
custom.sfd
custom.ttf
index.css
index.html
index.js
samples.html
tengwar.js

index c74e814..5e14800 100644 (file)
 
         <p><nobr>&mdash; Kris Kowal, 2011</nobr></p>
 
+        <script src="http://static.getclicky.com/js" type="text/javascript"></script> 
+        <script type="text/javascript">clicky.init(237383);</script> 
+        <noscript><p><img alt="Clicky" width="1" height="1" src="http://in.getclicky.com/237383ns.gif" /></p></noscript> 
     </body>
 </html>
index 5113c49..26447da 100644 (file)
@@ -7,5 +7,9 @@
     <body>
         <script src="tengwar.js" charset="utf-8"></script>
         <script>tengwar.displayTengwarTehtar()</script>
+
+        <script src="http://static.getclicky.com/js" type="text/javascript"></script> 
+        <script type="text/javascript">clicky.init(237383);</script> 
+        <noscript><p><img alt="Clicky" width="1" height="1" src="http://in.getclicky.com/237383ns.gif" /></p></noscript> 
     </body>
 </html>
index 60baebe..3bbd998 100644 (file)
Binary files a/custom-webfont.eot and b/custom-webfont.eot differ
index 8e98707..5f9dcf3 100644 (file)
@@ -224,6 +224,8 @@ Copyright   : Copyright c 20042005 by Johan Winge
 <glyph unicode="&#x11b;" horiz-adv-x="1253" d="M1506 3432q0 -45 36 -78q26 -22 60 -22q76 0 99 60q8 18 8 41q0 62 -52 89q-23 11 -50 11q-72 0 -95 -70q-6 -18 -6 -31zM1611 3067q0 -32 24 -64q28 -37 76 -37q64 0 91 52q11 22 11 49q0 60 -49 88q-23 12 -52 12q-62 0 -89 -51q-12 -23 -12 -49zM1715 2701 q0 -38 28 -70q27 -31 71 -31q63 0 91 49q12 23 12 52q0 64 -52 90q-22 11 -48 11q-73 0 -96 -71q-6 -17 -6 -30zM-35 -3q0 22 19 43q50 57 90 140q26 55 54 129q41 109 101 309l136 432q141 421 304 716q160 292 356 506q189 206 251 206q14 0 14 -13q0 -29 -68 -97 l-106 -105l-22 -25q-169 -193 -291 -431q-186 -362 -401 -1073l-43 -141q0 12 142 123q61 49 92 69q159 104 282 104q122 0 207 -82q84 -82 84 -206q0 -120 -87 -253q-64 -97 -166 -182q-5 -5 -5 -6q3 -3 78 -3q222 0 337 81l62 47q21 13 43 13h4q13 0 13 -14q0 -33 -65 -92 q-119 -106 -300 -152q-102 -26 -210 -26q-84 0 -272 20q-117 12 -200 12q-194 0 -380 -54q-29 -8 -38 -8q-15 0 -15 13zM170 147l117 24q109 18 226 18l177 -7q129 0 192 51q7 5 12 10q80 79 95 190q3 19 3 37q0 117 -83 192q-74 66 -184 66h-12q-83 0 -191 -84 q-159 -123 -284 -372q-42 -86 -65 -120q-3 -4 -3 -5z" />
 <glyph unicode="&#x11c;" d="M82 1870q0 45 36 78q26 22 60 22q76 0 99 -60q8 -18 8 -41q0 -62 -52 -89q-23 -11 -50 -11q-72 0 -95 70q-6 18 -6 31zM187 2235q0 32 24 64q28 37 76 37q64 0 91 -52q11 -22 11 -49q0 -60 -49 -88q-23 -12 -52 -12q-62 0 -89 51q-12 23 -12 49zM291 2601q0 38 28 70 q27 31 71 31q63 0 91 -49q12 -23 12 -52q0 -64 -52 -90q-22 -11 -48 -11q-73 0 -96 71q-6 17 -6 30zM-339 1301v3q107 278 152 325q18 18 39 18q34 0 43 -33q2 -8 2 -16q0 -37 -88 -164l-90 -126q-20 -32 -37 -32q-21 0 -21 25z" />
 <glyph unicode="&#x11d;" horiz-adv-x="1880" d="M2696 2651q0 45 36 78q26 22 60 22q76 0 99 -60q8 -18 8 -41q0 -62 -52 -89q-23 -11 -50 -11q-72 0 -95 70q-6 18 -6 31zM2801 3016q0 32 24 64q28 37 76 37q64 0 91 -52q11 -22 11 -49q0 -60 -49 -88q-23 -12 -52 -12q-62 0 -89 51q-12 23 -12 49zM2905 3382q0 38 28 70 q27 31 71 31q63 0 91 -49q12 -23 12 -52q0 -64 -52 -90q-22 -11 -48 -11q-73 0 -96 71q-6 17 -6 30zM102 310q0 211 188 405q128 133 264 165q23 6 49 8h13q151 0 166 -90q2 -11 2 -23q0 -66 -60 -108q-36 -25 -75 -25q-44 0 -77 35q-28 31 -38 38q-21 14 -52 14 q-87 0 -129 -54q-74 -105 -76 -232q0 -108 63 -197q72 -103 181 -103q103 0 190 79q82 74 119 199q49 167 184 303q134 136 276 160q26 5 51 5q129 0 153 -82q5 -15 5 -31q0 -68 -61 -110q-35 -24 -71 -24q-48 0 -81 36q-28 31 -38 37q-21 14 -52 14q-66 0 -107 -31 q-6 -4 -10 -9q-75 -83 -87 -217q-1 -16 -1 -29q0 -186 134 -264q59 -35 111 -35q106 0 207 119q23 27 42 57q42 65 111 204q60 121 123 192q21 24 45 47q60 53 100 58q15 0 15 -15q0 -19 -25 -48q-57 -65 -93 -139q-16 -35 -31 -75q-63 -165 -63 -353l3 -62q0 -41 -74 -99 q-57 -46 -84 -46q-14 0 -17 12q-2 10 -2 68q0 102 11 154l-1 1l-32 -29q-43 -42 -108 -91q-154 -115 -271 -115q-100 0 -178 75q-68 67 -90 173q-3 0 -28 -26q-48 -48 -122 -102q-166 -120 -297 -120q-99 0 -176 76q-70 68 -91 175q-8 34 -8 75z" />
+<glyph unicode="&#x11e;" horiz-adv-x="1914" d="M22 446q0 28 77 98q96 87 189 125q65 25 112 26q173 2 380 -136q56 -37 223 -167q170 -131 272 -176q90 -40 173 -40q31 0 56 5q-3 12 -3 26q0 65 50 92q22 11 51 11q65 0 90 -52q10 -22 10 -48q0 -62 -52 -89q-23 -12 -49 -12q-27 0 -54 15q-87 -58 -160 -68 q-24 -3 -51 -3q-100 0 -225 58q-102 48 -277 156q-158 98 -220 130q-202 105 -348 105q-106 0 -182 -45q-36 -22 -50 -22q-12 0 -12 11zM75 1420q0 29 79 102q119 108 241 153q60 22 108 22q180 0 362 -211q87 -101 237 -336q144 -226 211 -311q153 -191 292 -208 q14 -2 29 -2q44 0 44 6l-3 25q0 65 50 92q23 12 51 12q66 0 90 -54q10 -21 10 -47q0 -63 -51 -90q-22 -12 -49 -12q-26 0 -55 16q-63 -55 -167 -70q-19 -3 -34 -3q-149 0 -314 169q-78 80 -233 285q-139 185 -215 270q-193 217 -362 251q-35 7 -70 7q-93 0 -180 -50 q-45 -26 -59 -26q-12 0 -12 10z" />
+<glyph unicode="&#x11f;" horiz-adv-x="1914" d="M72 210q0 63 52 90q22 10 49 10q65 0 90 -52q11 -22 11 -48l-3 -29v-1q10 -9 90 -10q163 0 407 149q48 30 257 172q87 59 145 93q226 135 386 135q201 0 394 -189q63 -61 63 -84q0 -11 -11 -11q-13 0 -54 24q-93 55 -218 57h-15q-212 0 -550 -184l-216 -121 q-295 -155 -450 -165q-14 -1 -27 -1q-128 0 -224 66q-16 11 -20 13q-39 -15 -55 -15q-60 0 -87 47q-14 24 -14 54zM212 662q0 65 52 91q21 11 48 11q63 0 90 -53q11 -22 11 -49l-3 -27q0 -5 45 -5q147 0 307 191q75 91 220 318q147 231 225 326q170 205 331 213q7 1 14 1 q131 0 287 -111q95 -67 130 -122q9 -16 9 -26t-11 -10t-56 25q-88 50 -179 50q-172 0 -354 -184q-86 -88 -245 -299q-162 -217 -243 -306q-47 -51 -91 -91q-111 -100 -227 -100q-107 0 -197 66l-8 6q-24 -16 -56 -16q-42 0 -72 29q-27 27 -27 72z" />
 <glyph unicode="&#x120;" d="M-179 2113q0 185 153 346q124 129 287 186q82 28 153 28q151 0 238 -110q73 -93 73 -232q0 -187 -155 -350q-83 -86 -191 -144q-129 -68 -261 -68q-139 0 -223 109q-74 95 -74 235zM-5 2244q0 -139 84 -232q76 -84 183 -84q84 0 159 31q40 15 62 37q60 58 67 183 q1 11 1 20q0 146 -87 236q-75 78 -188 78q-73 0 -149 -29q-54 -21 -76 -52q-56 -76 -56 -188zM-339 1301v3q107 278 152 325q18 18 39 18q34 0 43 -33q2 -8 2 -16q0 -37 -88 -164l-90 -126q-20 -32 -37 -32q-21 0 -21 25z" />
 <glyph unicode="&#x121;" horiz-adv-x="1880" d="M2435 2894q0 185 153 346q124 129 287 186q82 28 153 28q151 0 238 -110q73 -93 73 -232q0 -187 -155 -350q-83 -86 -191 -144q-129 -68 -261 -68q-139 0 -223 109q-74 95 -74 235zM2609 3025q0 -139 84 -232q76 -84 183 -84q84 0 159 31q40 15 62 37q60 58 67 183 q1 11 1 20q0 146 -87 236q-75 78 -188 78q-73 0 -149 -29q-54 -21 -76 -52q-56 -76 -56 -188zM102 310q0 211 188 405q128 133 264 165q23 6 49 8h13q151 0 166 -90q2 -11 2 -23q0 -66 -60 -108q-36 -25 -75 -25q-44 0 -77 35q-28 31 -38 38q-21 14 -52 14q-87 0 -129 -54 q-74 -105 -76 -232q0 -108 63 -197q72 -103 181 -103q103 0 190 79q82 74 119 199q49 167 184 303q134 136 276 160q26 5 51 5q129 0 153 -82q5 -15 5 -31q0 -68 -61 -110q-35 -24 -71 -24q-48 0 -81 36q-28 31 -38 37q-21 14 -52 14q-66 0 -107 -31q-6 -4 -10 -9 q-75 -83 -87 -217q-1 -16 -1 -29q0 -186 134 -264q59 -35 111 -35q106 0 207 119q23 27 42 57q42 65 111 204q60 121 123 192q21 24 45 47q60 53 100 58q15 0 15 -15q0 -19 -25 -48q-57 -65 -93 -139q-16 -35 -31 -75q-63 -165 -63 -353l3 -62q0 -41 -74 -99 q-57 -46 -84 -46q-14 0 -17 12q-2 10 -2 68q0 102 11 154l-1 1l-32 -29q-43 -42 -108 -91q-154 -115 -271 -115q-100 0 -178 75q-68 67 -90 173q-3 0 -28 -26q-48 -48 -122 -102q-166 -120 -297 -120q-99 0 -176 76q-70 68 -91 175q-8 34 -8 75z" />
 <glyph unicode="&#x122;" d="M-2071 -1472q2 33 61 86q29 26 66 50q557 353 879 737q233 277 277 488q9 42 9 78q0 122 -78 197q-61 60 -147 60q-58 0 -101 -31q-41 -30 -63 -37l-14 -4q-18 0 -18 15q0 27 51 79q81 83 212 128q162 55 276 137q36 26 55 48q50 56 50 132q0 123 -84 210q-90 93 -232 93 q-107 0 -150 -8q-123 -21 -227 -115q-74 -65 -109 -65q-16 0 -16 13q0 39 107 131q101 87 199 136q112 57 258 66l31 2h61q49 0 80 -7q124 -27 197 -134q59 -86 59 -189q0 -136 -141 -284q-88 -93 -227 -180q139 -77 145 -246q1 -7 1 -14q0 -164 -145 -402 q-96 -160 -247 -330q-297 -333 -732 -649q-164 -119 -287 -192q-26 -14 -41 -14t-15 15zM-339 1301v3q107 278 152 325q18 18 39 18q34 0 43 -33q2 -8 2 -16q0 -37 -88 -164l-90 -126q-20 -32 -37 -32q-21 0 -21 25z" />
index df93192..e267a3c 100644 (file)
Binary files a/custom-webfont.ttf and b/custom-webfont.ttf differ
index ddf2127..09a7e84 100644 (file)
Binary files a/custom-webfont.woff and b/custom-webfont.woff differ
index 756361f..5719c49 100644 (file)
@@ -20,7 +20,7 @@ OS2Version: 1
 OS2_WeightWidthSlopeOnly: 0
 OS2_UseTypoMetrics: 1
 CreationTime: 1284288122
-ModificationTime: 1316110880
+ModificationTime: 1316221631
 PfmFamily: 17
 TTFWeight: 400
 TTFWidth: 5
@@ -795,7 +795,7 @@ DisplaySize: -24
 AntiAlias: 1
 FitToEm: 1
 WinInfo: 32 32 21
-BeginChars: 65539 237
+BeginChars: 65539 239
 
 StartChar: .notdef
 Encoding: 65536 -1 0
@@ -28224,5 +28224,134 @@ SplineSet
  -640 741 -640 741 -640 751 c 0,0,1
 EndSplineSet
 EndChar
+
+StartChar: gbreve
+Encoding: 287 287 237
+Width: 1914
+Flags: HW
+LayerCount: 2
+Fore
+SplineSet
+72 210 m 0,0,1
+ 72 273 72 273 124 300 c 0,2,3
+ 146 310 146 310 173 310 c 0,4,5
+ 238 310 238 310 263 258 c 0,6,7
+ 274 236 274 236 274 210 c 0,8,-1
+ 271 181 l 0,9,-1
+ 271 180 l 0,10,11
+ 281 171 281 171 361 170 c 0,12,13
+ 524 170 524 170 768 319 c 0,14,15
+ 816 349 816 349 1025 491 c 0,16,17
+ 1112 550 1112 550 1170 584 c 0,18,19
+ 1396 719 1396 719 1556 719 c 0,20,21
+ 1757 719 1757 719 1950 530 c 0,22,23
+ 2013 469 2013 469 2013 446 c 0,24,25
+ 2013 435 2013 435 2002 435 c 0,26,27
+ 1989 435 1989 435 1948 459 c 0,28,29
+ 1855 514 1855 514 1730 516 c 0,30,-1
+ 1715 516 l 0,31,32
+ 1503 516 1503 516 1165 332 c 0,33,-1
+ 949 211 l 0,34,35
+ 654 56 654 56 499 46 c 0,36,37
+ 485 45 485 45 472 45 c 0,38,39
+ 344 45 344 45 248 111 c 0,40,41
+ 232 122 232 122 228 124 c 0,42,43
+ 189 109 189 109 173 109 c 0,44,45
+ 113 109 113 109 86 156 c 0,46,47
+ 72 180 72 180 72 210 c 0,0,1
+212 662 m 0,48,49
+ 212 727 212 727 264 753 c 0,50,51
+ 285 764 285 764 312 764 c 0,52,53
+ 375 764 375 764 402 711 c 0,54,55
+ 413 689 413 689 413 662 c 0,56,-1
+ 410 635 l 0,57,58
+ 410 630 410 630 455 630 c 0,59,60
+ 602 630 602 630 762 821 c 0,61,62
+ 837 912 837 912 982 1139 c 0,63,64
+ 1129 1370 1129 1370 1207 1465 c 0,65,66
+ 1377 1670 1377 1670 1538 1678 c 0,67,68
+ 1545 1679 1545 1679 1552 1679 c 0,69,70
+ 1683 1679 1683 1679 1839 1568 c 0,71,72
+ 1934 1501 1934 1501 1969 1446 c 0,73,74
+ 1978 1430 1978 1430 1978 1420 c 128,-1,75
+ 1978 1410 1978 1410 1967 1410 c 128,-1,76
+ 1956 1410 1956 1410 1911 1435 c 0,77,78
+ 1823 1485 1823 1485 1732 1485 c 0,79,80
+ 1560 1485 1560 1485 1378 1301 c 0,81,82
+ 1292 1213 1292 1213 1133 1002 c 0,83,84
+ 971 785 971 785 890 696 c 0,85,86
+ 843 645 843 645 799 605 c 0,87,88
+ 688 505 688 505 572 505 c 0,89,90
+ 465 505 465 505 375 571 c 0,91,-1
+ 367 577 l 0,92,93
+ 343 561 343 561 311 561 c 0,94,95
+ 269 561 269 561 239 590 c 0,96,97
+ 212 617 212 617 212 662 c 0,48,49
+EndSplineSet
+EndChar
+
+StartChar: Gbreve
+Encoding: 286 286 238
+Width: 1914
+Flags: HW
+LayerCount: 2
+Fore
+SplineSet
+22 446 m 0,0,1
+ 22 474 22 474 99 544 c 0,2,3
+ 195 631 195 631 288 669 c 0,4,5
+ 353 694 353 694 400 695 c 0,6,7
+ 573 697 573 697 780 559 c 0,8,9
+ 836 522 836 522 1003 392 c 0,10,11
+ 1173 261 1173 261 1275 216 c 0,12,13
+ 1365 176 1365 176 1448 176 c 0,14,15
+ 1479 176 1479 176 1504 181 c 0,16,17
+ 1501 193 1501 193 1501 207 c 0,18,19
+ 1501 272 1501 272 1551 299 c 0,20,21
+ 1573 310 1573 310 1602 310 c 0,22,23
+ 1667 310 1667 310 1692 258 c 0,24,25
+ 1702 236 1702 236 1702 210 c 0,26,27
+ 1702 148 1702 148 1650 121 c 0,28,29
+ 1627 109 1627 109 1601 109 c 0,30,31
+ 1574 109 1574 109 1547 124 c 0,32,33
+ 1460 66 1460 66 1387 56 c 0,34,35
+ 1363 53 1363 53 1336 53 c 0,36,37
+ 1236 53 1236 53 1111 111 c 0,38,39
+ 1009 159 1009 159 834 267 c 0,40,41
+ 676 365 676 365 614 397 c 0,42,43
+ 412 502 412 502 266 502 c 0,44,45
+ 160 502 160 502 84 457 c 0,46,47
+ 48 435 48 435 34 435 c 0,48,49
+ 22 435 22 435 22 446 c 0,0,1
+75 1420 m 0,50,51
+ 75 1449 75 1449 154 1522 c 0,52,53
+ 273 1630 273 1630 395 1675 c 0,54,55
+ 455 1697 455 1697 503 1697 c 0,56,57
+ 683 1697 683 1697 865 1486 c 0,58,59
+ 952 1385 952 1385 1102 1150 c 0,60,61
+ 1246 924 1246 924 1313 839 c 0,62,63
+ 1466 648 1466 648 1605 631 c 0,64,65
+ 1619 629 1619 629 1634 629 c 0,66,67
+ 1678 629 1678 629 1678 635 c 0,68,-1
+ 1675 660 l 0,69,70
+ 1675 725 1675 725 1725 752 c 0,71,72
+ 1748 764 1748 764 1776 764 c 0,73,74
+ 1842 764 1842 764 1866 710 c 0,75,76
+ 1876 689 1876 689 1876 663 c 0,77,78
+ 1876 600 1876 600 1825 573 c 0,79,80
+ 1803 561 1803 561 1776 561 c 0,81,82
+ 1750 561 1750 561 1721 577 c 0,83,84
+ 1658 522 1658 522 1554 507 c 0,85,86
+ 1535 504 1535 504 1520 504 c 0,87,88
+ 1371 504 1371 504 1206 673 c 0,89,90
+ 1128 753 1128 753 973 958 c 0,91,92
+ 834 1143 834 1143 758 1228 c 0,93,94
+ 565 1445 565 1445 396 1479 c 0,95,96
+ 361 1486 361 1486 326 1486 c 0,97,98
+ 233 1486 233 1486 146 1436 c 0,99,100
+ 101 1410 101 1410 87 1410 c 0,101,102
+ 75 1410 75 1410 75 1420 c 0,50,51
+EndSplineSet
+EndChar
 EndChars
 EndSplineFont
index 05cf2e6..334496f 100644 (file)
Binary files a/custom.ttf and b/custom.ttf differ
index b80c20d..e57957d 100644 (file)
--- a/index.css
+++ b/index.css
@@ -38,6 +38,23 @@ a:hover {
 a:focus {
 }
 
+#annotation table {
+    border-collapse: collapse;
+    margin-right: 1em;
+}
+
+#annotation td {
+    border: solid 1px;
+    width: 1em;
+    text-align: left;
+    font-size: 20px;
+    padding: 2px;
+    line-height: 100%;
+    text-shadow: 0px 0px 10px #730 ;
+    white-space: nowrap;
+    font-family: monospace;
+}
+
 #output {
     text-align: center;
     line-height: 150px;
index 906e2f5..118f30b 100644 (file)
@@ -6,30 +6,36 @@
     </head>
     <body>
 
+        <noscript>
+            <br>This transcriber makes extensive use
+            of JavaScript and very new CSS tricks.
+            You might try using the much older
+            <a href="http://tengwar.art.pl/tengwar/ott/start.php?l=en">
+                tengwar transcriber
+            </a> if your browser does not support
+            these features.
+        </noscript>
+
         <div class="vbox" style="height: 100%; width: 100%">
             <div class="vbox spring" id="output-box">
                 <div class="spring"></div>
                 <div id="output" class="strut">
-                    Ennyn Durin Aran Moria:<br>
-                    pedo mellon a minno.
-                    <noscript>
-                        <br>This transcriber makes extensive use
-                        of JavaScript and very new CSS tricks.
-                        You might try using the much older
-                        <a href="http://tengwar.art.pl/tengwar/ott/start.php?l=en">
-                            tengwar transcriber
-                        </a> if your browser does not support
-                        these features.
-                    </noscript>
+                    Ash nazg durbatulûk, ash nazg gimbatul,<br>
+                    Ash nazg thrakatulûk agh burzum-ishi krimpatul.
                 </div>
                 <div class="spring"></div>
+                <div class="strut hbox">
+                    <div class="spring"></div>
+                    <div id="annotation"></div>
+                    <div class="spring"></div>
+                </div>
             </div>
             <div class="strut hbox">
                 <div class="strut" style="width: 30ex">
                 </div>
                 <div class="spring">
-                    <textarea id="input">Ennyn Durin Aran Moria:
-pedo mellon a minno.</textarea>
+                    <textarea id="input">&gt;Ash nazg durbatulûk, ash nazg gimbatul,&lt;
+Ash nazg thrakatulûk agh burzum-ishi krimpatul.</textarea>
                 </div>
                 <div class="strut hbox" style="width: 30ex">
                     <div class="spring"></div>
@@ -43,6 +49,10 @@ pedo mellon a minno.</textarea>
         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
         <script src="tengwar.js" charset="utf-8"></script>
         <script src="index.js" charset="utf-8"></script>
+
+        <script src="http://static.getclicky.com/js" type="text/javascript"></script> 
+        <script type="text/javascript">clicky.init(237383);</script> 
+        <noscript><p><img alt="Clicky" width="1" height="1" src="http://in.getclicky.com/237383ns.gif" /></p></noscript> 
     </body>
 </html>
 
index b39670b..df51315 100644 (file)
--- a/index.js
+++ b/index.js
@@ -2,9 +2,11 @@
 
     var input = $("#input");
     var output = $("#output");
+    var annotation = $("#annotation");
 
-    function update() {
-        var val = input.val();
+    function update(event, val) {
+        val = val || input.val();
+        annotation.html(tengwar.annotateHtml(val));
         output.html(tengwar.transcribeHtml(val));
         location.hash = "#" + encodeURIComponent(val);
         input.css({
         })
     }
 
+    var val = ">Ash nazg durbatulûk, ash nazg gimbatul,<\nAsh nazg thrakatulûk agh burzum-ishi krimpatul.";
     if (location.hash) {
-        input.val(decodeURIComponent(location.hash.slice(1)));
+        input.val(val = decodeURIComponent(location.hash.slice(1)));
     }
 
     input.keyup(update);
     input.keydown(update);
     output.tengwar();
-    update();
-
     input.select();
+    update(null, val);
 
 })();
index f48413d..16a075e 100644 (file)
 
         <p>Sinome maruvan: <span class="tengwar">Sinome maruvan</span>. Quenya, not appropriate for this mode.</p>
 
+        <p>Allys: <span class="tengwar">Allys</span>. Not elvish. Lots of potential mis-interactions between the double-L, the Y-diacritic, and following-S.</p>
+
         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
-        <script src="hashchange.min.js"></script>
         <script src="tengwar.js" charset="utf-8"></script>
         <script>$(".tengwar").tengwar()</script>
+
+        <script src="http://static.getclicky.com/js" type="text/javascript"></script> 
+        <script type="text/javascript">clicky.init(237383);</script> 
+        <noscript><p><img alt="Clicky" width="1" height="1" src="http://in.getclicky.com/237383ns.gif" /></p></noscript> 
     </body>
 </html>
index 72c6739..8505623 100644 (file)
@@ -88,10 +88,12 @@ var mode = {
         // punctuation
         "comma": "=",
         "full-stop": "-",
-        "exclamation": "Á",
+        "exclamation-point": "Á",
         "question-mark": "À",
         "open-paren": "&#140;",
-        "close-paren": "&#156;"
+        "close-paren": "&#156;",
+        "flourish-left": "&#286;",
+        "flourish-right": "&#287;",
     },
     "tehtar": {
         "a": "#EDC",
@@ -146,13 +148,16 @@ var mode = {
             "quesse": "|",
             "short-carrier": "}",
         },
-        /*
         "s-inverse": {
             "special": true,
             "tinco": "¡",
             "calma": "&#162;", // cents
+            "quesse": "&#162;", // cents
+        },
+        "s-extended": {
+            "special": true,
+            "tinco": "&#199;"
         },
-        */
         "s-flourish": {
             "special": true,
             "tinco": "&#163;",
@@ -448,7 +453,8 @@ var mode = {
     "substitutions": {
         "k": "c",
         "x": "cs",
-        "q": "qu",
+        "qu": "cw",
+        "q": "cw",
         "ë": "e",
         "â": "á",
         "ê": "é",
@@ -502,10 +508,10 @@ var mode = {
         "l": "lambe",
         "ll": "lambe:tilde-below",
         "bb": "umbar:tilde-below",
-        "nl": "lambe:tilde-above",
         "s": "silme",
         "ss": "silme:tilde-below",
         "sh": "harma",
+        "j": "anca",
         "z": "esse",
         //"ld": "alda",
         "lh": "alda", // probably not
@@ -544,11 +550,11 @@ var mode = {
     },
     "words": {
         "iant": "yanta;tinco:tilde-above:a",
-        "iaur": "yanta;anna:a;ore",
+        "iaur": "yanta;vala:a;ore",
         "ioreth": "yanta;romen:o;thule:e",
         "noldo": "nwalme;lambe:o;ando;short-carrier:o",
         "noldor": "nwalme;lambe:o;ando;ore:o",
-        "is": "short-carrier:s"
+        "is": "short-carrier:i:s"
     },
     "punctuation": {
         "-": "comma",
@@ -556,10 +562,74 @@ var mode = {
         ":": "comma",
         ";": "full-stop",
         ".": "full-stop",
-        "!": "exclamation",
+        "!": "exclamation-point",
         "?": "question-mark",
         "(": "open-paren",
-        ")": "close-paren"
+        ")": "close-paren",
+        ">": "flourish-left",
+        "<": "flourish-right"
+    },
+    "annotations": {
+        "tinco": {"tengwa": "t"},
+        "parma": {"tengwa": "p"},
+        "calma": {"tengwa": "c"},
+        "quesse": {"tengwa": "c"},
+        "ando": {"tengwa": "d"},
+        "umbar": {"tengwa": "b"},
+        "ungwe": {"tengwa": "g"},
+        "thule": {"tengwa": "th"},
+        "formen": {"tengwa": "f"},
+        "hyarmen": {"tengwa": "h"},
+        "hwesta": {"tengwa": "ch"},
+        "unque": {"tengwa": "gh"},
+        "anto": {"tengwa": "dh"},
+        "anca": {"tengwa": "j"},
+        "ampa": {"tengwa": "v"},
+        "numen": {"tengwa": "n"},
+        "malta": {"tengwa": "m"},
+        "nwalme": {"tengwa": "ñ"},
+        "romen": {"tengwa": "r"},
+        "ore": {"tengwa": "-r"},
+        "lambe": {"tengwa": "l"},
+        "silme": {"tengwa": "s"},
+        "silme-nuquerna": {"tengwa": "s"},
+        "esse": {"tengwa": "z"},
+        "esse-nuquerna": {"tengwa": "z"},
+        "harma": {"tengwa": "sh"},
+        "alda": {"tengwa": "lh"},
+        "arda": {"tengwa": "rh"},
+        "wilya": {"tengwa": "a"},
+        "vala": {"tengwa": "w"},
+        "anna": {"tengwa": "i"},
+        "vala": {"tengwa": "w"},
+        "yanta": {"tengwa": "e"},
+        "hwesta-sindarinwa": {"tengwa": "wh"},
+        "s": {"following": "s"},
+        "s-inverse": {"following": "s<sub>2</sub>"},
+        "s-extended": {"following": "s<sub>3</sub>"},
+        "s-flourish": {"following": "s<sub>4</sub>"},
+        "long-carrier": {"tengwa": "´"},
+        "short-carrier": {},
+        "tilde-above": {"above": "nmñ-"},
+        "tilde-below": {"below": "2"},
+        "a": {"tehta-above": "a"},
+        "e": {"tehta-above": "e"},
+        "i": {"tehta-above": "i"},
+        "o": {"tehta-above": "o"},
+        "u": {"tehta-above": "u"},
+        "ó": {"tehta-above": "ó"},
+        "ú": {"tehta-above": "ú"},
+        "í": {"tehta-above": "y"},
+        "y": {"tehta-below": "y"},
+        "w": {"tehta-above": "w"},
+        "full-stop": {"tengwa": "."},
+        "exclamation-point": {"tengwa": "!"},
+        "question-mark": {"tengwa": "?"},
+        "comma": {"tengwa": "-"},
+        "open-paren": {"tengwa": "("},
+        "close-paren": {"tengwa": ")"},
+        "flourish-left": {"tengwa": "“"},
+        "flourish-right": {"tengwa": "”"}
     }
 };
 
@@ -627,7 +697,7 @@ var transcriptionsRe = new RegExp("^([aeiouóú]?)(" +
     Object.keys(mode.transcriptions).sort(function (a, b) {
         return b.length - a.length;
     }).join("|") +
-")(w?)(y?)(s?)", "ig");
+")(w?)(y?)(s?)('*)", "ig");
 var vowelTranscriptionsRe = new RegExp("^(" + 
     Object.keys(mode.vowelTranscriptions).join("|") +
 ")", "ig");
@@ -649,7 +719,7 @@ function transcribeWordToEncoding(latin) {
     while (latin.length) {
         length = latin.length;
         latin = latin
-        .replace(transcriptionsRe, function ($, vowel, tengwa, w, y, s) {
+        .replace(transcriptionsRe, function ($, vowel, tengwa, w, y, s, prime) {
             //console.log(latin, [vowel, tengwa, w, y, s]);
             w = w || ""; s = s || ""; y = y || "";
             var value = mode.transcriptions[tengwa];
@@ -678,17 +748,30 @@ function transcribeWordToEncoding(latin) {
                 w = "";
                 voweled = true;
             }
-            if (s) {
-                var tehta = tehtaForTengwa(tengwa, "s");
-                if (tehta !== null) {
-                    value += ":" + "s";
-                    s = "";
-                }
-            }
             if (y) {
                 value += ":y";
                 y = "";
             }
+            // must go last because it has a non-zero width
+            if (s) {
+                var length = prime.length;
+                var possibilities = [
+                    "s",
+                    "s-inverse",
+                    "s-extended",
+                    "s-flourish"
+                ].filter(function (tehta) {
+                    return tehtaForTengwa(tengwa, tehta);
+                });
+                while (possibilities.length && length) {
+                    possibilities.shift();
+                    length--;
+                }
+                if (possibilities.length) {
+                    value += ":" + possibilities.shift();
+                    s = "";
+                }
+            }
             parts.push(value);
             first = false;
             return w + s + y;
@@ -748,7 +831,7 @@ function transcribeToEncoding(latin) {
             return paragraph.split(/\n/).map(function (stanza) {
                 return stanza.split(/\s+/).map(function (word) {
                     var parts = []
-                    word.replace(/(\w+)|(\W+)/g, function ($, word, others) {
+                    word.replace(/([\wáéíóúÁÉÍÓÚëËâêîôûÂÊÎÔÛ']+)|(\W+)/g, function ($, word, others) {
                         if (word) {
                             parts.push(transcribeWordToEncoding(word));
                         } else {
@@ -804,6 +887,54 @@ function decodeToFont(transcription) {
     }).join("\n\n\n");
 }
 
+exports.annotate = annotate;
+function annotate(latin) {
+    return transcribeToEncoding(latin).split(/\s+/).map(function (word) {
+        return word.split(";").map(function (word) {
+            var form = {};
+            word.split(":").forEach(function (part) {
+                var annotation = mode.annotations[part];
+                for (var name in annotation) {
+                    form[name] = "<abbr title=\"" + part + " (" + name + ")\">" + annotation[name] + "</abbr>";
+                }
+            });
+            var middle = [];
+            if (form.tengwa) {
+                middle.push("<strong>" + form.tengwa + "</strong>");
+            }
+            if (form.following) {
+                middle.push(" -" + form.following);
+            }
+            return [
+                form['tehta-above'],
+                form['above'],
+                middle.join(""),
+                form['below'],
+                form['tehta-below']
+            ];
+        });
+    });
+}
+
+exports.annotateHtml = annotateHtml;
+function annotateHtml(latin) {
+    return annotate(latin).map(function (word) {
+        var table = [[], [], [], [], []];
+        var i = 0;
+        word.forEach(function (cluster) {
+            cluster.forEach(function (note, j) {
+                table[j][i] = note;
+            });
+            i++;
+        });
+        return "<table align=\"left\">" + table.map(function (row) {
+            return "<tr>" + row.map(function (cell) {
+                return "<td>" + (cell || "&nbsp;") + "</td>";
+            }).join("") + "</tr>";
+        }).join("") + "</table>";
+    }).join("");
+}
+
 exports.transcribe = transcribe;
 function transcribe(latin) {
     return decodeToFont(transcribeToEncoding(latin));