개정판 78d91584
issue #1033: 폰트 목록 Text 수정 및 TopMenu 디자인 수정
Change-Id: I803173025fcfd626a5be04e389d77213f93c6c4f
KCOM/Common/InitData.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
1 |
using System.Collections.Generic; |
|
3 | 2 |
using System.Linq; |
4 |
using System.Net; |
|
5 |
using System.Windows; |
|
6 | 3 |
using System.Windows.Controls; |
7 |
using System.Windows.Documents; |
|
8 |
using System.Windows.Input; |
|
9 | 4 |
using System.Windows.Media; |
10 |
using System.Windows.Media.Animation; |
|
11 |
using System.Windows.Shapes; |
|
12 |
using Telerik.Windows.Controls; |
|
13 |
using System.IO; |
|
14 | 5 |
using System.Drawing.Text; |
15 | 6 |
|
16 | 7 |
namespace KCOM.Views |
17 | 8 |
{ |
18 |
|
|
19 | 9 |
public class DashStyle |
20 | 10 |
{ |
21 | 11 |
public DoubleCollection dashData { get; set; } |
22 | 12 |
} |
23 | 13 |
|
24 |
public class FontStyle |
|
25 |
{ |
|
26 |
public string fontData { get; set; } |
|
27 |
} |
|
28 |
|
|
29 | 14 |
public partial class TopMenu : UserControl |
30 | 15 |
{ |
31 | 16 |
public List<DashStyle> dashSet; |
32 |
public List<FontStyle> fontSet; |
|
33 | 17 |
|
34 | 18 |
public void InitDataSet() |
35 | 19 |
{ |
... | ... | |
47 | 31 |
}; |
48 | 32 |
cbDashStyle.ItemsSource = dashSet.ToList(); |
49 | 33 |
|
50 |
|
|
51 |
fontSet = new List<FontStyle>() |
|
34 |
List<string> fontList = new List<string>(); |
|
35 |
fontList.Add("Arial"); |
|
36 |
fontList.Add("Calibri (Body)"); |
|
37 |
fontList.Add("Tahoma"); |
|
38 |
fontList.Add("Verdana"); |
|
39 |
fontList.Add("Times New Roman"); |
|
40 |
fontList.Add("Cambria"); |
|
41 |
//fontList.Add("나눔바른펜"); |
|
42 |
List<string> fontSet = new List<string>(); |
|
43 |
foreach (var font in fontList) |
|
52 | 44 |
{ |
53 |
new FontStyle { fontData = "Arial"}, |
|
54 |
new FontStyle { fontData = "Calibri (Body)"}, |
|
55 |
new FontStyle { fontData = "Tahoma"}, |
|
56 |
new FontStyle { fontData = "Verdana"}, |
|
57 |
new FontStyle { fontData = "Times New Roman"}, |
|
58 |
new FontStyle { fontData = "Cambria"} |
|
59 |
}; |
|
45 |
if (IsFontInstalled(font)) |
|
46 |
{ |
|
47 |
fontSet.Add(font.ToString()); |
|
48 |
} |
|
49 |
} |
|
60 | 50 |
comboFontFamily.ItemsSource = fontSet.ToList(); |
61 |
} |
|
51 |
}
|
|
62 | 52 |
|
63 |
/* |
|
64 | 53 |
/// <summary> |
65 | 54 |
/// 폰트 설치 여부 구하기 |
66 | 55 |
/// </summary> |
67 |
/// <param name="fontName">폰트명</param> |
|
68 |
/// <returns>폰트 설치 여부</returns> |
|
69 | 56 |
public bool IsFontInstalled(string fontName) |
70 | 57 |
{ |
71 |
System.Windows.Media.font |
|
72 | 58 |
InstalledFontCollection collection = new InstalledFontCollection(); |
73 |
foreach (FontFamily fontFamily in collection.Families) |
|
59 |
foreach (System.Drawing.FontFamily fontFamily in collection.Families)
|
|
74 | 60 |
{ |
75 |
if (fontFamily.FamilyNames.Equals(fontName))
|
|
61 |
if (fontFamily.Name.Equals(fontName))
|
|
76 | 62 |
{ |
77 | 63 |
return true; |
78 | 64 |
} |
79 | 65 |
} |
80 | 66 |
return false; |
81 |
} |
|
82 |
*/ |
|
67 |
} |
|
83 | 68 |
} |
84 | 69 |
} |
내보내기 Unified diff