Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-alter-the-typography-of-text.md
T

2.0 KiB

title, description, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title description ms.date dev_langs helpviewer_keywords ms.assetid
How to Alter the Typography of Text To alter the telegraphy of text, set the telegraphy attribute. You can set the typographic property of text programmatically. You can see how altered and default telegraphy properties of text render on screen each with an example. 03/30/2017
csharp
vb
setting Typography attributes [WPF]
Typography attribute [WPF], setting
19a3b49b-60a2-4c11-a786-e26b4c965588

How-to: Alter the Typography of Text

The following example shows how to set the xref:System.Windows.Documents.TextElement.Typography%2A attribute, using xref:System.Windows.Documents.Paragraph as the example element.

Example 1: To show how altered and default typographic properties of text render on screen

[!code-xamlTextElementSnippets#_TextElement_TypogXAML]

The following figure shows how this example renders.

Screenshot: Text element with altered typography

In contrast, the following figure shows how a similar example with default typographic properties renders.

Screenshot: Text element with default typography

Example 2: To show how to set typographic property of text programmatically

The following example shows how to set the xref:System.Windows.Controls.TextBox.Typography%2A property programmatically.

[!code-csharpTextElementSnippets#_TextElement_Typog] [!code-vbTextElementSnippets#_TextElement_Typog]

See also