FlowDocument.FontStretch Property

Definition

Gets or sets the top-level font-stretching characteristics for the FlowDocument.

public:
 property System::Windows::FontStretch FontStretch { System::Windows::FontStretch get(); void set(System::Windows::FontStretch value); };
public System.Windows.FontStretch FontStretch { get; set; }
member this.FontStretch : System.Windows.FontStretch with get, set
Public Property FontStretch As FontStretch

Property Value

A member of the FontStretch class that specifies the desired font-stretching characteristics to use. The default is Normal.

Examples

The following example shows how to set the FontStretch attribute of a FlowDocument element.

<FlowDocumentReader>
  <FlowDocument
    FontFamily="Century Gothic"
    FontSize="12"
    FontStretch="UltraExpanded"
    FontStyle="Italic"
    FontWeight="UltraBold"
  >
    <Paragraph>
      Any font settings on this paragraph would override the font settings
      for the FlowDocument.
    </Paragraph>
  </FlowDocument>
</FlowDocumentReader>

The following example shows how to set the FontStretch property programmatically.

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
// Set the desired column gap to 10 device independend pixels.
flowDoc.FontFamily = new FontFamily("Century Gothic");
flowDoc.FontSize = 12.0;
flowDoc.FontStretch = FontStretches.UltraExpanded;
flowDoc.FontStyle = FontStyles.Italic;
flowDoc.FontWeight = FontWeights.UltraBold;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
' Set the desired column gap to 10 device independend pixels.
flowDoc.FontFamily = New FontFamily("Century Gothic")
flowDoc.FontSize = 12.0
flowDoc.FontStretch = FontStretches.UltraExpanded
flowDoc.FontStyle = FontStyles.Italic
flowDoc.FontWeight = FontWeights.UltraBold

Remarks

Any FontStretch settings on child elements override this top-level setting.

Dependency Property Information

Identifier field FontStretchProperty
Metadata properties set to true AffectsMeasure, AffectsRender, Inherits

Applies to