zoukankan      html  css  js  c++  java
  • 字体相关参数与数据集合

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

    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
  • 相关阅读:
    streamsets 集成 cratedb 测试
    streamsets k8s 部署试用
    streamsets rest api 转换 graphql
    StreamSets sdc rpc 测试
    StreamSets 相关文章
    StreamSets 多线程 Pipelines
    StreamSets SDC RPC Pipelines说明
    StreamSets 管理 SDC Edge上的pipeline
    StreamSets 部署 Pipelines 到 SDC Edge
    StreamSets 设计Edge pipeline
  • 原文地址:https://www.cnblogs.com/insus/p/13600932.html
Copyright © 2011-2022 走看看