• 获取 系统中所有可用的字体


    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.

  • 相关阅读:
    什么是模块化及其优点是什么
    oop的三大特性和传统dom如何渲染
    MVC和MVVM的差别
    SpringMVC实例及注解(二)
    Spring MVC实例创建(一)
    Mybatis联合查询(一)
    Mybatis参数传递及返回类型
    Mybatis实例增删改查(二)
    Mybatis实例及配置(一)
    SpringMVC
  • 原文地址:https://www.cnblogs.com/stone/p/120119.html
Copyright © 2020-2023  润新知