프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / Markus.Fonts / FontDictionary.cs @ 24c5e56c

이력 | 보기 | 이력해설 | 다운로드 (3.22 KB)

1
using System;
2
using System.Collections.Generic;
3
using System.IO;
4
using System.Linq;
5
using System.Reflection;
6
using System.Text;
7
using System.Threading.Tasks;
8

    
9
namespace Markus.Fonts
10
{
11
    public static class FontDictionary
12
    {
13
        public const string FONT_ARIAL = "NanumGothic.ttf";
14

    
15
        public const string FONT_CALIBRI_BODY = "NanumSquareRoundR.ttf";                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
16

    
17
        public const string FONT_TIMES_NEW_ROMAN = "NanumMyeongjo-Regular.ttf";
18

    
19
        public const string FONT_VERDANA = "Verdana.ttf";
20

    
21
        public static List<MarkusFont> GetMarkusFonts()
22
        {
23
            return new List<MarkusFont>
24
            {
25
                new MarkusFont
26
                {
27
                    ResourceName = FONT_ARIAL,
28
                    FontFamilyName = "NanumGothic",
29
                    FamilyNames = new [] {"Arial","NanumGothic","나눔고딕"},
30
                    IsDefault = true
31
                },
32
                 new MarkusFont
33
                {
34
                    ResourceName = FONT_CALIBRI_BODY,
35
                    FontFamilyName = "NanumSquareRoundR",
36
                    FamilyNames = new [] {"Calibri (Body)", "나눔스퀘어라운드 Regular","NanumSquareRound" , "NanumSquareRound Regular","NanumSquareRoundR" }
37
                 },
38
                new MarkusFont
39
                {
40
                    ResourceName = FONT_VERDANA,
41
                    FontFamilyName = "Verdana",
42
                    FamilyNames = new [] {"Verdana","Tahoma"}
43
                },
44
                new MarkusFont
45
                {
46
                    ResourceName = FONT_TIMES_NEW_ROMAN,
47
                    FontFamilyName = "NanumMyeongjo",
48
                    FamilyNames = new [] { "Times New Roman" ,"NanumMyeongjo"}
49
                }
50
            };
51
        }
52

    
53
        public static MarkusFont GetMarkusFont(System.Windows.Media.FontFamily fontFamily)
54
        {
55
            MarkusFont result = new MarkusFont
56
            {
57
                ResourceName = FONT_ARIAL,
58
                FamilyNames = new[] { "Arial" }
59
            };
60

    
61
            foreach (var item in GetMarkusFonts())
62
            {
63
               if(item.FamilyNames.Contains(fontFamily.Source.Replace("./#", "")))
64
                    //fontFamily.FamilyNames.Select(x => x.Value).Except(item.FamilyNames).Count() > 0)
65
                {
66
                    result = item;
67
                    break;
68
                }
69
            }
70

    
71
            return result;
72
        }
73
    }
74
}
클립보드 이미지 추가 (최대 크기: 500 MB)