OSDN Git Service

フォントサイズの計算がおかしかったので修正した
authorkonekoneko <test2214@hotmail.co.jp>
Sat, 11 Apr 2015 09:45:14 +0000 (18:45 +0900)
committerkonekoneko <test2214@hotmail.co.jp>
Sat, 11 Apr 2015 09:45:14 +0000 (18:45 +0900)
Common/Direct2D/D2DRenderCommon.cs

index 7040b54..4378990 100644 (file)
@@ -217,8 +217,11 @@ namespace FooEditEngine
         {
             if(this.format != null)
                 this.format.Dispose();
-            
-            this.format = new DW.TextFormat(this.DWFactory, fontName,fontWeigth,fontStyle, fontSize / 72.0f * 96.0f);
+
+            float dpix, dpiy;
+            this.GetDpi(out dpix, out dpiy);
+
+            this.format = new DW.TextFormat(this.DWFactory, fontName, fontWeigth, fontStyle, fontSize * dpix / 72.0f);
             this.format.WordWrapping = DW.WordWrapping.NoWrap;
 
             if (this.HiddenChars == null)
@@ -230,8 +233,6 @@ namespace FooEditEngine
 
             this.hasCache = false;
 
-            float dpix, dpiy;
-            this.GetDpi(out dpix, out dpiy);
             MyTextLayout layout = new MyTextLayout(this.DWFactory, "0", this.format, float.MaxValue, float.MaxValue, dpix, false);
             layout.RightToLeft = false;
             this.emSize = new Size(layout.Width, layout.Height);