svnno****@sourc*****
svnno****@sourc*****
2009年 11月 11日 (水) 23:24:00 JST
Revision: 1399 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1399 Author: dhrname Date: 2009-11-11 23:24:00 +0900 (Wed, 11 Nov 2009) Log Message: ----------- font-face要素とfont-face-uri要素の実装 Modified Paths: -------------- branches/05x/053/sie.js Modified: branches/05x/053/sie.js =================================================================== --- branches/05x/053/sie.js 2009-11-07 14:23:28 UTC (rev 1398) +++ branches/05x/053/sie.js 2009-11-11 14:24:00 UTC (rev 1399) @@ -94,8 +94,8 @@ } else { if (/a/[-1] === 'a'){ //Firefoxだったらtrueを返す NAIBU.STObject.ffnext(); + _noie_svgfont(); } - _noie_svgfont(); } } //他のページに移動する際に起動 @@ -1906,7 +1906,7 @@ } ti.style.visibility = "hidden"; }; -//IE以外のブラウザ用 +//IE以外のFirefox用 function _noie_svgfont() { var obj = document.getElementsByTagName("object"); for (var i=0;i<obj.length;++i) { @@ -1951,7 +1951,7 @@ var style = ti.ownerDocument.defaultView.getComputedStyle(ti, '') var node = ti.firstChild, data, glyphs = font.getElementsByTagNameNS(NAIBU.svgNameSpace, "glyph"), em = parseFloat(font.getElementsByTagNameNS(NAIBU.svgNameSpace, "font-face").item(0).getAttribute("units-per-em") || 0); var advX = parseFloat(font.getAttributeNS(null, "horiz-adv-x")), originX = parseFloat(font.getAttributeNS(null, "horiz-origin-x") || 0), originY = parseFloat(font.getAttributeNS(null, "horiz-origin-y") || 0); //字幅とフォントの原点の設定 - var dx = parseFloat(ti.getAttributeNS(null, "x")), fontSize = parseFloat(style.fontSize), dy = parseFloat(ti.getAttributeNS(null, "y")), fe = fontSize / em; + var dx = parseFloat(ti.getAttributeNS(null, "x") || 0), fontSize = parseFloat(style.fontSize), dy = parseFloat(ti.getAttributeNS(null, "y") || 0), fe = fontSize / em; while(node) { data = node.data; if (data !== void 0) { //dataがある場合 @@ -1980,7 +1980,7 @@ } node = node.nextSibling; } - ti.style.visibility = "hidden"; + ti.style.opacity = "0"; }; NAIBU.pathData = function(/*string*/ data, /*Element*/ p, /*boolean*/ t, /*float*/ w, h, /*Matrix*/ matrix) { //CTMでフォントを移動させておく @@ -1988,6 +1988,7 @@ var s = new STPath(p, matrix); s.d = data; s.set(w,h); + s = null; } else { p.setAttributeNS(null, "transform", "matrix(" +matrix.a+ "," +matrix.b+ "," +matrix.c+ "," +matrix.d+ "," +matrix.e+ "," +matrix.f+ ")"); p.setAttributeNS(null, "d", data);