728x90
728x170
■ Glyphs 엘리먼트의 Indices 속성을 사용하는 방법을 보여준다.
▶ MainWindow.xaml
<Window x:Class="TestProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="800"
Height="600"
Title="TestProject"
FontFamily="나눔고딕코딩"
FontSize="16">
<Canvas Background="PowderBlue">
<Glyphs
OriginX="50"
OriginY="75"
FontUri="C:\WINDOWS\Fonts\ARIAL.TTF"
FontRenderingEmSize="36"
StyleSimulations="ItalicSimulation"
Fill="SteelBlue"
UnicodeString="Hello World!" />
<Glyphs
OriginX="50"
OriginY="150"
FontUri="C:\WINDOWS\Fonts\ARIAL.TTF"
FontRenderingEmSize="36"
Fill="Maroon"
UnicodeString="Hello World!" />
<Glyphs
OriginX="50"
OriginY="225"
FontUri="C:\WINDOWS\Fonts\ARIAL.TTF"
FontRenderingEmSize="36"
Indices=",80;,80;,80;,80;,80;,80;,80;,80;,80;,80;,80"
Fill="Maroon"
UnicodeString="Hello World!" />
<Glyphs
OriginX="50"
OriginY="300"
FontUri="C:\WINDOWS\Fonts\COUR.TTF"
FontRenderingEmSize="36"
StyleSimulations="BoldSimulation"
Fill="Maroon"
UnicodeString="Hello World!" />
<Glyphs
OriginX="400"
OriginY="75"
FontUri="C:\WINDOWS\Fonts\TIMES.TTF"
FontRenderingEmSize="36"
StyleSimulations="BoldSimulation"
Fill="SlateGray"
UnicodeString="Open file" />
<Glyphs
OriginX="400"
OriginY="150"
FontUri="C:\WINDOWS\Fonts\TIMES.TTF"
FontRenderingEmSize="36"
StyleSimulations="BoldSimulation"
Indices=";;;;;(2:1)191"
Fill="SlateGray"
UnicodeString="Open file" />
</Canvas>
</Window>
728x90
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] TextBlock 엘리먼트 : RenderTransform 속성에서 TranslateTransform 객체를 사용해 텍스트 그림자 만들기 (0) | 2022.12.16 |
---|---|
[C#/WPF] TextBlock 엘리먼트 : RenderTransform 속성에서 SkewTransform 객체를 사용해 텍스트 기울이기 (0) | 2022.12.16 |
[C#/WPF] TextBlock 엘리먼트 : RenderTransform 속성에서 ScaleTransform 객체를 사용해 텍스트 크기 늘리기 (0) | 2022.12.16 |
[C#/WPF] TextBlock 엘리먼트 : RenderTransform 속성에서 RotateTransform 객체를 사용해 텍스트 회전시키기 (0) | 2022.12.16 |
[C#/WPF] Hyperlink 클래스 : MouseEnter/MouseLeave 이벤트를 사용해 마우스 진입시 밑줄 표시하기 (0) | 2022.12.16 |
[C#/WPF] Glyphs 엘리먼트 사용하기 (0) | 2022.12.15 |
[C#/WPF] FontSizeConverter 클래스 : ConvertFromString 메소드를 사용해 폰트 크기 구하기 (0) | 2022.12.15 |
[C#/WPF] 리소스 폰트 라이브러리 사용하기 (0) | 2022.12.15 |
[C#/WPF] Fonts 클래스 : GetTypefaces 정적 메소드를 사용해 리소스 타입페이스 나열하기 (0) | 2022.12.15 |
[C#/WPF] Fonts 클래스 : GetFontFamilies 정적 메소드를 사용해 리소스 폰트 나열하기 (0) | 2022.12.15 |