123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PDF_Master.Helper
- {
- public static class EditHelper
- {
- /// <summary>
- /// 字体更改失效:
- ///MT Extra
- ///Symbol
- ///HoloLens MDL2 Assets
- ///Wingdings
- ///Wingdings 2
- ///Wingdings 3
- ///Webdings
- ///ZWAdobeF
- ///Algerian
- ///Bookshelf Symbol 7
- ///Castellar
- ///Marlett
- ///MS Outlook(adobe、万兴没效果)
- ///MS Reference Specialty
- ///Segoe Fluent Icons(adobe、万兴没效果)
- ///Segoe MDL2 Assets(adobe、万兴没效果)
- ///Stencil
- /// 未选择 文本时候,暂时注释SDK 目前没有效果的字体
- /// </summary>
- public static List<string> FontFamily { get; set; } = new List<string>
- {
- "Adobe Devanagari",
- "Arial",
- "Arial Black",
- "Arvo",
- "Bahnschrift",
- "Bahnschrift Condensed",
- "Bahnschrift Light Condensed",
- "Bahnschrift Light SemiCondensed",
- "Bahnschrift SemiBold Condensed",
- "Bahnschrift SemiCondensed",
- "Bahnschrift SemiLight",
- "Bahnschrift SemiLight Condensed",
- "Calibri",
- "Cambria",
- "Cambria Math",
- "Candara",
- "Cascadia Code",
- "Cascadia Code SemiLight",
- "Cascadia Mono",
- "Cascadia Mono SemiLight",
- "Comic Sans MS",
- "Consolas",
- "Constantia",
- "Corbel",
- "Courier New",
- "DejaVu Math TeX Gyre",
- "Droid Serif",
- "Ebrima",
- "Franklin Gothic",
- "Gabriola",
- "Gadugi",
- "Georgia",
- //"HoloLens MDL2 Assets",
- "Impact",
- "Indie Flower",
- "Ink Free",
- "Javanese Text",
- "Leelawadee UI",
- "Leelawadee UI Semilight",
- "Lobster",
- "Lucida Console",
- "Lucida Sans Unicode",
- "MS Gothic",
- "MS PGothic",
- "MS UI Gothic",
- //"MT Extra",
- "MV Boli",
- "Malgun Gothic",
- "Malgun Gothic Semilight",
- //"Marlett",
- "Microsoft Himalaya",
- "Microsoft JhengHei",
- "Microsoft JhengHei UI",
- "Microsoft New Tai Lue",
- "Microsoft PhagsPa",
- "Microsoft Sans Serif",
- "Microsoft Tai Le",
- "Microsoft YaHei UI",
- "Microsoft Yi Baiti",
- "MingLiU-ExtB",
- "MingLiU_HKSCS-ExtB",
- "Mongolian Baiti",
- "Myanmar Text",
- "Nirmala UI",
- "Nirmala UI Semilight",
- "Open Sans",
- "PMingLiU-ExtB",
- "Palatino Linotype",
- "Poiret One",
- "Raleway",
- "Roboto",
- "Roboto Condensed",
- "Roboto Slab",
- "Sans Serif Collection",
- //"Segoe Fluent Icons",
- //"Segoe MDL2 Assets",
- "Segoe Print",
- "Segoe Script",
- "Segoe UI",
- "Segoe UI Black",
- "Segoe UI Emoji",
- "Segoe UI Historic",
- "Segoe UI Semilight",
- "Segoe UI Symbol",
- "Segoe UI Variable Display",
- "Segoe UI Variable Small",
- "Segoe UI Variable Text",
- "SimSun-ExtB",
- "Sitka Banner",
- "Sitka Display",
- "Sitka Heading",
- "Sitka Small",
- "Sitka Subheading",
- "Sitka Text",
- "Sylfaen",
- //"Symbol",
- "Tahoma",
- "Times New",
- "Trebuchet MS",
- "Verdana",
- //"Webdings",
- //"Wingdings",
- "Yu Gothic",
- "Yu Gothic UI",
- "Yu Gothic UI Semilight",
- //"ZWAdobeF",
- "等线",
- "仿宋",
- "黑体",
- "楷体",
- "宋体",
- "微软雅黑"
- };
- public static List<string> GetFontFamily()
- {
- return FontFamily.OrderBy(item => IsChinese(item)).ThenBy(item => item).ToList();
- }
- private static bool IsChinese(string str)
- {
- foreach (char c in str)
- {
- if (c >= 0x4E00 && c <= 0x9FFF)
- {
- return true;
- }
- }
- return false;
- }
- }
- }
|