src/Misc/EFTools/DesignXmlCore/VisualStudio/VSHelpers.cs
/// <summary>
///     Convert UIDLGLOGFONT type to Font type.
///     The code is copied over from env\vscore\package\CommonIDEStatics.cs
/// </summary>
/// <param name="logFont"></param>
/// <returns></returns>
Convert UIDLGLOGFONT type to Font type.
The code is copied over from env\vscore\package\CommonIDEStatics.cs
Convert UIDLGLOGFONT type to Font type . The code is copied over from env \ vscore \ package \ CommonIDEStatics . cs
private static Font FontFromUIDLGLOGFONT(UIDLGLOGFONT logFont)
        {
            var conversion = new char[logFont.lfFaceName.Length];
            var i = 0;
            foreach (var convertChar in logFont.lfFaceName)
            {
                conversion[i++] = (char)convertChar;
            }
            var familyName = new String(conversion);
            Single emSize = 0 - logFont.lfHeight;
            var style = FontStyle.Regular;
            const int FW_NORMAL = 400;
            if (logFont.lfItalic > 0)
            {
                style |= FontStyle.Italic;
            }
            if (logFont.lfUnderline > 0)
            {
                style |= FontStyle.Underline;
            }
            if (logFont.lfStrikeOut > 0)
            {
                style |= FontStyle.Strikeout;
            }
            if (logFont.lfWeight > FW_NORMAL)
            {
                style |= FontStyle.Bold;
            }
            var unit = GraphicsUnit.Pixel;
            var gdiCharSet = logFont.lfCharSet;
            return new Font(familyName, emSize, style, unit, gdiCharSet);
        }
private static Font FontFromUIDLGLOGFONT ( UIDLGLOGFONT logFont ) { var conversion = new char [ logFont . lfFaceName . Length ] ; var i = 0 ; foreach ( var convertChar in logFont . lfFaceName ) { conversion [ i ++ ] = ( char ) convertChar ; } var familyName = new String ( conversion ) ; Single emSize = 0 - logFont . lfHeight ; var style = FontStyle . Regular ; const int FW_NORMAL = 400 ; if ( logFont . lfItalic > 0 ) { style |= FontStyle . Italic ; } if ( logFont . lfUnderline > 0 ) { style |= FontStyle . Underline ; } if ( logFont . lfStrikeOut > 0 ) { style |= FontStyle . Strikeout ; } if ( logFont . lfWeight > FW_NORMAL ) { style |= FontStyle . Bold ; } var unit = GraphicsUnit . Pixel ; var gdiCharSet = logFont . lfCharSet ; return new Font ( familyName , emSize , style , unit , gdiCharSet ) ; }
Convert UIDLGLOGFONT type to Font type.
Convert UIDLGLOGFONT type to Font type .
None
logFont
UIDLGLOGFONT
None