svnno****@sourc*****
svnno****@sourc*****
2011年 8月 4日 (木) 20:24:49 JST
Revision: 2842 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2842 Author: dhrname Date: 2011-08-04 20:24:49 +0900 (Thu, 04 Aug 2011) Log Message: ----------- SVGFontElementの変数などを整理 Modified Paths: -------------- branches/08x/082/org/w3c/dom/svg.js Modified: branches/08x/082/org/w3c/dom/svg.js =================================================================== --- branches/08x/082/org/w3c/dom/svg.js 2011-08-04 11:14:11 UTC (rev 2841) +++ branches/08x/082/org/w3c/dom/svg.js 2011-08-04 11:24:49 UTC (rev 2842) @@ -6003,14 +6003,19 @@ doc = data = null; }; NAIBU._noie_createFont = function(/*Element*/ ti, /*Element*/ font, /*boolean*/ isMSIE) { - var style = ti.ownerDocument.defaultView.getComputedStyle(ti, ''), svgns = "http://www.w3.org/2000/svg"; - //isTategakiは縦書きならば真 - var isTategaki = ti.getAttributeNS(null, "writing-mode") || ti.parentNode.getAttributeNS(null, "writing-mode"), horizOrVert = isTategaki ? "vert-adv-y" : "horiz-adv-x"; - var node = ti.firstChild, data, glyphs = font.getElementsByTagNameNS(svgns, "glyph"); - var em = parseFloat(font.getElementsByTagNameNS(svgns, "font-face").item(0).getAttributeNS(null, "units-per-em") || 1000); - var advX = parseFloat( (font.getAttributeNS(null, horizOrVert) || em) ); //字幅の設定 - var dx = parseFloat(ti.getAttributeNS(null, "x") || 0), fontSize = parseFloat(style.getPropertyValue("font-size")), dy = parseFloat(ti.getAttributeNS(null, "y") || 0), fe = fontSize / em; - var ds = false, npdlist = ["fill", + var style = ti.ownerDocument.defaultView.getComputedStyle(ti, ''), + svgns = "http://www.w3.org/2000/svg", + //isTategakiは縦書きならば真 + isTategaki = ti.getAttributeNS(null, "writing-mode") || ti.parentNode.getAttributeNS(null, "writing-mode"), + horizOrVert = isTategaki ? "vert-adv-y" : "horiz-adv-x", + node = ti.firstChild, data, glyphs = font.getElementsByTagNameNS(svgns, "glyph"), + em = parseFloat(font.getElementsByTagNameNS(svgns, "font-face").item(0).getAttributeNS(null, "units-per-em") || 1000), + advX = parseFloat( (font.getAttributeNS(null, horizOrVert) || em) ), //字幅の設定 + dx = parseFloat(ti.getAttributeNS(null, "x") || 0), + dy = parseFloat(ti.getAttributeNS(null, "y") || 0), + fontSize = parseFloat(style.getPropertyValue("font-size")), + fe = fontSize / em; + ds = false, npdlist = ["fill", "fill-opacity", "stroke", "stroke-width", @@ -6021,11 +6026,6 @@ "stroke-opacity", "opacity", "cursor"]; - if (isMSIE) { - //fontSize *= - console.log(fe);//Math.sqrt(Math.abs(ti.getScreenCTM()._determinant()))); - fe = fontSize / em; - } if (/a/[-1] === 'a') { //Firefoxならば ds = true; } else if (isMSIE || isTategaki) {