[Sie-announce] SIEコード [1813] text要素において、文字の大きさと位置の調整

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 5月 4日 (火) 22:33:14 JST


Revision: 1813
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1813
Author:   dhrname
Date:     2010-05-04 22:33:14 +0900 (Tue, 04 May 2010)

Log Message:
-----------
text要素において、文字の大きさと位置の調整

Modified Paths:
--------------
    branches/ufltima/dom/svg.js

Modified: branches/ufltima/dom/svg.js
===================================================================
--- branches/ufltima/dom/svg.js	2010-05-02 14:42:38 UTC (rev 1812)
+++ branches/ufltima/dom/svg.js	2010-05-04 13:33:14 UTC (rev 1813)
@@ -2663,7 +2663,7 @@
       } else {
         var ptx = pty = ptdx = ptdy = {numberOfItems : 0};
       }
-      var kern = "fijlt.,IJ:;1'", akern = "abcdeghknopqsuvxyz";
+      var kern = "fijlt.,IJ:;1'-", akern = "a bcdeghknopqsuvxyz";
 ;
       while (ti) {
         if (ti.nodeType === Node.TEXT_NODE) {
@@ -2693,12 +2693,15 @@
             if (isYokogaki) {
               var tdc = ti.data.charAt(i);
               if (kern.indexOf(tdc) > -1) { //カーニングを求める
-                alm = fontSize / 2;
-              } else if(tdc === "r"){
-                alm = fontSize * 0.2;
-              } else if(akern.indexOf(tdc) > -1){
+                alm = fontSize * 0.75;
+              } else if ((tdc === "r") || (tdc === "s")){
+                alm = fontSize * 0.65;
+              } else if ((tdc === "m") || (tdc === "w")){
+                alm = fontSize * 0.3;
+              } else if (akern.indexOf(tdc) > -1){
+                alm = fontSize * 0.55;
               } else {
-                alm = -fontSize * 0.4;
+                alm = fontSize * 0.17;
               }
             }
             tar._list[tar._list.length] = x;




Sie-announce メーリングリストの案内
Back to archive index