markus / FinalServiceV3 / KCOM_FinalService / Markus.Fonts / FontHelper.cs @ faf998c6
이력 | 보기 | 이력해설 | 다운로드 (683 Bytes)
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 FontHelper |
12 |
{ |
13 |
public static System.Windows.Media.FontFamily GetFontFamily(string name) |
14 |
{ |
15 |
return new System.Windows.Media.FontFamily(new Uri("pack://application:,,,/resources/"), $"./#{name}"); |
16 |
} |
17 |
|
18 |
public static Stream GetFontStream(string fileName) |
19 |
{ |
20 |
Assembly asm = Assembly.GetExecutingAssembly(); |
21 |
|
22 |
return asm.GetManifestResourceStream($"Markus.Fonts.Resources.{fileName}"); |
23 |
} |
24 |
} |
25 |
} |