■ FontStretchConverter 클래스의 ConvertToString/ConvertFromString 메소드를 사용하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
FontStretchConverter converter = new FontStretchConverter(); string ultraCondensedString = converter.ConvertToString(FontStretches.UltraCondensed); string extraCondensedString = converter.ConvertToString(FontStretches.ExtraCondensed); string condensedString = converter.ConvertToString(FontStretches.Condensed ); string semiCondensedString = converter.ConvertToString(FontStretches.SemiCondensed ); string normalString = converter.ConvertToString(FontStretches.Normal ); string mediumString = converter.ConvertToString(FontStretches.Medium ); string semiExpandedString = converter.ConvertToString(FontStretches.SemiExpanded ); string expandedString = converter.ConvertToString(FontStretches.Expanded ); string extraExpandedString = converter.ConvertToString(FontStretches.ExtraExpanded ); string ultraExpandedString = converter.ConvertToString(FontStretches.UltraExpanded ); Console.WriteLine(ultraCondensedString); Console.WriteLine(extraCondensedString); Console.WriteLine(condensedString ); Console.WriteLine(semiCondensedString ); Console.WriteLine(normalString ); Console.WriteLine(mediumString ); Console.WriteLine(semiExpandedString ); Console.WriteLine(expandedString ); Console.WriteLine(extraExpandedString ); Console.WriteLine(ultraExpandedString ); Console.WriteLine(); FontStretch ultraCondensedFontStretch = (FontStretch)converter.ConvertFromString(ultraCondensedString); FontStretch extraCondensedFontStretch = (FontStretch)converter.ConvertFromString(extraCondensedString); FontStretch condensedFontStretch = (FontStretch)converter.ConvertFromString(condensedString ); FontStretch semiCondensedFontStretch = (FontStretch)converter.ConvertFromString(semiCondensedString ); FontStretch normalFontStretch = (FontStretch)converter.ConvertFromString(normalString ); FontStretch mediumFontStretch = (FontStretch)converter.ConvertFromString(mediumString ); FontStretch semiExpandedFontStretch = (FontStretch)converter.ConvertFromString(semiExpandedString ); FontStretch expandedFontStretch = (FontStretch)converter.ConvertFromString(expandedString ); FontStretch extraExpandedFontStretch = (FontStretch)converter.ConvertFromString(extraExpandedString ); FontStretch ultraExpandedFontStretch = (FontStretch)converter.ConvertFromString(ultraExpandedString ); Console.WriteLine(ultraCondensedFontStretch); Console.WriteLine(extraCondensedFontStretch); Console.WriteLine(condensedFontStretch ); Console.WriteLine(semiCondensedFontStretch ); Console.WriteLine(normalFontStretch ); Console.WriteLine(mediumFontStretch ); Console.WriteLine(semiExpandedFontStretch ); Console.WriteLine(expandedFontStretch ); Console.WriteLine(extraExpandedFontStretch ); Console.WriteLine(ultraExpandedFontStretch ); |