Alsing.Drawing.GDI.GDIFont.Init C# (CSharp) Method

Init() protected method

protected Init ( string fontname, float size, bool bold, bool italic, bool underline, bool strikethrough ) : void
fontname string
size float
bold bool
italic bool
underline bool
strikethrough bool
return void
        protected void Init(string fontname, float size, bool bold, bool italic, bool underline, bool strikethrough)
        {
            FontName = fontname;
            Size = size;
            Bold = bold;
            Italic = italic;
            Underline = underline;
            Strikethrough = strikethrough;

            var tFont = new LogFont
                        {
                            lfItalic = ((byte) (Italic ? 1 : 0)),
                            lfStrikeOut = ((byte) (Strikethrough ? 1 : 0)),
                            lfUnderline = ((byte) (Underline ? 1 : 0)),
                            lfWeight = (Bold ? 700 : 400),
                            lfWidth = 0,
                            lfHeight = ((int) (-Size*1.3333333333333)),
                            lfCharSet = 1,
                            lfFaceName = FontName
                        };


            hFont = NativeMethods.CreateFontIndirect(tFont);
        }