svnno****@sourc*****
svnno****@sourc*****
2009年 10月 24日 (土) 19:36:50 JST
Revision: 1356 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1356 Author: dhrname Date: 2009-10-24 19:36:50 +0900 (Sat, 24 Oct 2009) Log Message: ----------- 0.52統合 Modified Paths: -------------- trunk/sie.js Property Changed: ---------------- trunk/sie.js Modified: trunk/sie.js =================================================================== --- trunk/sie.js 2009-10-21 13:40:22 UTC (rev 1355) +++ trunk/sie.js 2009-10-24 10:36:50 UTC (rev 1356) @@ -43,7 +43,7 @@ * ***** END LICENSE BLOCK ***** */ //これを頭に付けたら、内部処理用 -var NAIBU = {}; +var NAIBU = {}; //documentを速くするために /*@cc_on _d=document;eval('var document=_d')@*/ //bookmarkletから呼び出されたらtrue @@ -458,9 +458,9 @@ tancx = tancy = textLength / 2; } if (this.paint.writingMode.indexOf("tb") === 0) { //縦書きならば、x座標に影響を与えない - tancx = -fontSize * 0.04; //さらにディセンダの調整を行う + tancx = -fontSize * 0.25; //さらにディセンダの調整を行う } else { - tancy = -fontSize * 0.04; + tancy = -fontSize * 0.25; } tts.left = ptm.x - tancx; tts.top = ptm.y - tancy; @@ -1411,6 +1411,7 @@ this.writingMode = tts.writingMode; tts.marginTop = (this.writingMode === "tb-rl") ? "0px" : -parseFloat(tts.fontSize)+ "px"; tts.textIndent = "0px"; + tts.lineHeight = this.fontSize+ "px" } catch(e){stlog.add(e,1185);} } @@ -1765,6 +1766,7 @@ NAIBU.XLink = function( /*element*/ ele) { this.tar = ele; var href = ele.getAttribute("xlink:href"); + this.title = ele.getAttribute("xlink:title"); if (href) { //xlink:href属性が指定されたとき this.show = ele.getAttribute("xlink:show"); var base; @@ -1824,6 +1826,15 @@ } this.tar.setAttribute("href",uri); } + if (this.title) { + var node = this.tar.firstChild; + while(node) { + if (node.nodeType === 1) { + node.setAttribute("title", this.title); + } + node = node.nextSibling; + } + } } catch(e) {stlog.add(e,17155);} } @@ -1836,13 +1847,21 @@ //Text2SVG機能。SVGのソース(文章)をSVG画像に変換できる。(必須ではない) function textToSVG( /*string*/ source, /*float*/ w, /*float*/ h) { - var data = 'data:image/svg+xml,' + unescapeUTF16(escape(source)); - var ob = document.createElement("object"); - ob.setAttribute("data",data); - ob.setAttribute("width",w); - ob.setAttribute("height",h); - ob.setAttribute("type","image/svg+xml"); - return ob; + /*Safari3.xでは、DOMParser方式だと、文字が表示されないバグがあるため、 + *dataスキーム方式を採用する + */ + if (navigator.userAgent.indexOf('WebKit') > -1 || navigator.userAgent.indexOf('Safari') > -1) { //WebKit系ならば + var data = 'data:image/svg+xml;charset=utf-8,' + unescapeUTF16(escape(source)); + var ob = document.createElement("object"); + ob.setAttribute("data",data); + ob.setAttribute("width",w); + ob.setAttribute("height",h); + ob.setAttribute("type","image/svg+xml"); + return ob; + } else { + var doc = (new DOMParser()).parseFromString(source, "text/xml"); + return (document.importNode(doc.documentElement, true)); + } } //XMLHttpRequestオブジェクトの作成 Property changes on: trunk/sie.js ___________________________________________________________________ Modified: svn:mergeinfo - /branches/04x/040/sie.js:812-829 /branches/04x/041/sie.js:891-923 /branches/04x/042/sie.js:927-967 /branches/04x/043/sie.js:969-1013 /branches/04x/044/sie.js:1015-1067 /branches/04x/045/sie.js:1069-1078 /branches/04x/046/sie.js:1080-1129 /branches/04x/047/sie.js:1131-1164 /branches/04x/048/sie.js:1166-1180 /branches/04x/sie.js:830-1181 /branches/05x/050/sie.js:1183-1201 /branches/05x/051/sie.js:1207-1323 /branches/05x/sie.js:1183-1328 + /branches/04x/040/sie.js:812-829 /branches/04x/041/sie.js:891-923 /branches/04x/042/sie.js:927-967 /branches/04x/043/sie.js:969-1013 /branches/04x/044/sie.js:1015-1067 /branches/04x/045/sie.js:1069-1078 /branches/04x/046/sie.js:1080-1129 /branches/04x/047/sie.js:1131-1164 /branches/04x/048/sie.js:1166-1180 /branches/04x/sie.js:830-1181 /branches/05x/050/sie.js:1183-1201 /branches/05x/051/sie.js:1207-1323 /branches/05x/052/sie.js:1325-1352 /branches/05x/sie.js:1183-1355