[Sie-announce] SIEコード [1420] 同列の中の同じ文字が表示されなくなるバグを修正

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
2009年 11月 19日 (木) 19:59:21 JST


Revision: 1420
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1420
Author:   dhrname
Date:     2009-11-19 19:59:21 +0900 (Thu, 19 Nov 2009)

Log Message:
-----------
同列の中の同じ文字が表示されなくなるバグを修正

Modified Paths:
--------------
    branches/05x/054/sie.js

Modified: branches/05x/054/sie.js
===================================================================
--- branches/05x/054/sie.js	2009-11-18 13:54:24 UTC (rev 1419)
+++ branches/05x/054/sie.js	2009-11-19 10:59:21 UTC (rev 1420)
@@ -1982,11 +1982,13 @@
     if (data !== void 0) { //dataがある場合
       var advanceX = [], glyphData = [];
       for (var i=0,gli=glyphs.length;i<gli;++i) {
+        var glyph = glyphs[i], unicode = glyph.getAttribute("unicode") || "なし"; //unicode属性に指定がない場合、処理させないようにする
         //indexは該当する文字が何番目にあるかの数字
-        var index = data.indexOf(glyphs[i].getAttribute("unicode"));
-        if (index > -1) {
-          advanceX[index] = parseFloat(glyphs[i].getAttribute(horizOrVert) || advX); //字幅を収納
-          glyphData[index] = glyphs[i].getAttribute("d");
+        var index = data.indexOf(unicode);
+        while (index > -1) {
+          advanceX[index] = parseFloat(glyph.getAttribute(horizOrVert) || advX); //字幅を収納
+          glyphData[index] = glyph.getAttribute("d");
+          index = data.indexOf(unicode, index+1);
         }
       }
       for (var i=0,adv=0;i<data.length;++i) {
@@ -2077,11 +2079,13 @@
       if (data !== void 0) { //dataがある場合
         var advanceX = [], glyphData = [];
         for (var i=0,gli=glyphs.length;i<gli;++i) {
+        var glyph = glyphs[i], unicode = glyph.getAttributeNS(null, "unicode") || "なし"; //unicode属性に指定がない場合、処理させないようにする
           //indexは該当する文字が何番目にあるかの数字
-          var index = data.indexOf((glyphs[i].getAttributeNS(null, "unicode") || "なし")); //unicode属性に指定がない場合、処理させないようにする
-          if (index > -1) {
-            advanceX[index] = parseFloat(glyphs[i].getAttributeNS(null, horizOrVert) || advX); //字幅を収納
-            glyphData[index] = glyphs[i].getAttributeNS(null, "d");
+          var index = data.indexOf(unicode);
+          while (index > -1) {
+            advanceX[index] = parseFloat(glyph.getAttributeNS(null, horizOrVert) || advX); //字幅を収納
+            glyphData[index] = glyph.getAttributeNS(null, "d");
+            index = data.indexOf(unicode, index+1);
           }
         }
         for (var i=0,adv=0;i<data.length;++i) {




Sie-announce メーリングリストの案内
Zurück zum Archiv-Index