示例#1
0
        public override float getStrikethroughThickness()
        {
#if WINFX
            return(GetTypeface().StrikethroughThickness *factor);
#else
            return(mFont.getSize2D() / 18);
#endif
        }
示例#2
0
 public NetLineMetrics(java.awt.Font aFont, String aString)
 {
     mFont      = aFont;
     mString    = aString;
     fontFamily = J2C.CreateFontFamily(aFont.getName());
     style      = (FontStyle)mFont.getStyle();
     factor     = aFont.getSize2D() / fontFamily.GetEmHeight(style);
 }
示例#3
0
 internal static java.awt.Font ConvertFont(Font font)
 {
     float size = font.Size;
     if (font.Unit != GraphicsUnit.Pixel)
     {
         size = font.SizeInPoints * java.awt.Toolkit.getDefaultToolkit().getScreenResolution() / 72;
     }
     java.awt.Font jFont = new java.awt.Font(font.Name, (int)font.Style, (int)size);
     if (jFont.getSize2D() != size)
     {
         jFont = jFont.deriveFont(size);
     }
     //TODO performance we should set the .NET Font, we can do it with an aditional constructor.
     return jFont;
 }
示例#4
0
        internal static java.awt.Font ConvertFont(Font font)
        {
            float size = font.Size;

            if (font.Unit != GraphicsUnit.Pixel)
            {
                size = font.SizeInPoints * java.awt.Toolkit.getDefaultToolkit().getScreenResolution() / 72;
            }
            java.awt.Font jFont = new java.awt.Font(font.Name, (int)font.Style, (int)size);
            if (jFont.getSize2D() != size)
            {
                jFont = jFont.deriveFont(size);
            }
            //TODO performance we should set the .NET Font, we can do it with an aditional constructor.
            return(jFont);
        }