zoukankan      html  css  js  c++  java
  • 获取 系统中所有可用的字体

    FontFamily[] ff = FontFamily.Families;

        // Loop and create a sample of each font.
        for (int x = 0; x < ff.Length; x++)
        {

            System.Drawing.Font font = null;

            // Create the font - based on the styles available.
            if (ff[x].IsStyleAvailable(FontStyle.Regular))
                font = new System.Drawing.Font(
                    ff[x].Name,
                    m_comboBox.Font.Size
                    );
            else if (ff[x].IsStyleAvailable(FontStyle.Bold))
                font = new System.Drawing.Font(
                    ff[x].Name,
                    m_comboBox.Font.Size,
                    FontStyle.Bold
                    );
            else if (ff[x].IsStyleAvailable(FontStyle.Italic))
                font = new System.Drawing.Font(
                    ff[x].Name,
                    m_comboBox.Font.Size,
                    FontStyle.Italic
                    );
            else if (ff[x].IsStyleAvailable(FontStyle.Strikeout))
                font = new System.Drawing.Font(
                    ff[x].Name,
                    m_comboBox.Font.Size,
                    FontStyle.Strikeout
                    );
            else if (ff[x].IsStyleAvailable(FontStyle.Underline))
                font = new System.Drawing.Font(
                    ff[x].Name,
                    m_comboBox.Font.Size,
                    FontStyle.Underline
                    );

            // Should we add the item?
            if (font != null)
                m_comboBox.Items.Add(font);

        } // End for all the fonts.

  • 相关阅读:
    [原]OpenSSL SSL连接初始化部分解析
    [转]C++日志系统log4cxx使用总结
    js打字效果
    抓取网页Email地址
    jQuery语法总结及注意事项
    Reporting Services中参数说明(因为在框架中要在新的窗口打开报表,所以这理主要是rc:LinkTarget)
    jQuery性能优化指南
    安装文件制作总结
    alert弹出层(待完善……)
    我的tab页面,Jquery方便扩展
  • 原文地址:https://www.cnblogs.com/stone/p/120119.html
Copyright © 2011-2022 走看看