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.

  • 相关阅读:
    多态_python的小窝_百度空间
    可直接下载空间客户端
    简明 Python 教程 / 面向对象的编程 / 类与对象的方法
    C++ 基础 woaidongmao C++博客 good 量产
    set has enumerate
    python invoke super parent method
    分享:常用汉字的unicode 编码
    数据库调整也可以遵循“开闭原则”
    Ninject超轻量级的依赖注入工具
    点某个链接进网站,会发这个链接的会员加积分,实现方法(有时间限制)
  • 原文地址:https://www.cnblogs.com/stone/p/120119.html
Copyright © 2011-2022 走看看