Compartilhar via


FlowDocument.FontStyle Propriedade

Definição

Obtém ou define o estilo de fonte de nível superior para o FlowDocument.

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

Valor da propriedade

Um membro da FontStyles classe que especifica o estilo de fonte desejado. O padrão é determinado pelo MessageFontStyle valor.

Exemplos

O exemplo a seguir mostra como definir o FontStyle atributo de um FlowDocument elemento.

<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>

O exemplo a seguir mostra como definir a propriedade FontStyle programaticamente.

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

Comentários

Todas as FontStyle configurações em elementos filho substituem essa configuração de nível superior.

Informações da propriedade Dependency

Item Valor
Campo identificador FontStyleProperty
Propriedades de metadados definidas como true AffectsMeasure, , AffectsRenderInherits

Aplica-se a