码迷,mamicode.com
首页 > 其他好文 > 详细

字体相关参数与数据集合

时间:2020-09-15 21:20:52      阅读:53      评论:0      收藏:0      [点我收藏+]

标签:var   control   open   cti   rabl   display   mic   win   引用   

项目中,需要实现字体相关操作,收集了一些相关参数,可以引用的。

技术图片

 

技术图片
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace Insus.NET.APIs
{
    public class FontController : ApiController
    {
        [HttpPost]
        public IEnumerable<string> FontFamilys()
        {
            InstalledFontCollection fonts = new InstalledFontCollection();

            foreach (FontFamily font in fonts.Families)
            {
                yield return font.Name;
            }
        }

        [HttpPost]
        public IEnumerable<string> FontStyles()
        {
            return new List<string>() { "normal", "italic", "oblique", "inherit", "initial", "unset" };
        }

        [HttpPost]
        public IEnumerable<string> FontSizes()
        {
            return new List<string>() { "larger", "smaller", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "inherit", "initial", "unset" };
        }

        [HttpPost]
        public IEnumerable<string> FontWeights()
        {
            return new List<string>() { "normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "inherit", "initial", "unset" };
        }

        [HttpPost]
        public IEnumerable<string> FontVariants()
        {
            return new List<string>() { "normal", "small-caps", "inherit", "initial", "unset" };
        }

        [HttpPost]
        public IEnumerable<string> LineHeights()
        {
            return new List<string>() { "normal", "inherit", "initial", "unset" };
        }

        [HttpPost]
        public IEnumerable<string> FontUnits()
        {
            return new List<string>() { "%", "in", "cm", "mm", "em", "rem", "ex", "pt", "pc", "px" };
        }

    }
}
Source Code

 

字体相关参数与数据集合

标签:var   control   open   cti   rabl   display   mic   win   引用   

原文地址:https://www.cnblogs.com/insus/p/13600932.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!