svnno****@sourc*****
svnno****@sourc*****
2011年 8月 4日 (木) 20:14:11 JST
Revision: 2841 http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2841 Author: dhrname Date: 2011-08-04 20:14:11 +0900 (Thu, 04 Aug 2011) Log Message: ----------- SVGFontの文字の大きさがおかしくなるバグ(IE8のみで発生)を修正 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-01 13:08:34 UTC (rev 2840) +++ branches/08x/082/org/w3c/dom/svg.js 2011-08-04 11:14:11 UTC (rev 2841) @@ -6007,7 +6007,7 @@ //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).getAttribute("units-per-em") || 1000); + 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", @@ -6022,13 +6022,9 @@ "opacity", "cursor"]; if (isMSIE) { - var rand = "n" +Math.random(); - ti._tar.firstChild.setAttribute("id", rand); - var titf = ti.ownerDocument._document_.getElementById(rand); - /*IEのみ、font-sizeは自動で調整されている(つまり、DOMからよびだされた)ものを使った方がよい*/ - fontSize = parseFloat(titf.currentStyle.fontSize); + //fontSize *= + console.log(fe);//Math.sqrt(Math.abs(ti.getScreenCTM()._determinant()))); fe = fontSize / em; - rand = titf = null; } if (/a/[-1] === 'a') { //Firefoxならば ds = true;