Share via


FlowDocument.FontSize Properti

Definisi

Mendapatkan atau mengatur ukuran font tingkat atas untuk FlowDocument.

public:
 property double FontSize { double get(); void set(double value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.FontSizeConverter))]
[System.Windows.Localizability(System.Windows.LocalizationCategory.None)]
public double FontSize { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.FontSizeConverter))>]
[<System.Windows.Localizability(System.Windows.LocalizationCategory.None)>]
member this.FontSize : double with get, set
Public Property FontSize As Double

Nilai Properti

Ukuran font yang diinginkan untuk digunakan, dalam piksel independen perangkat). Default ditentukan oleh MessageFontSize nilai .

Atribut

Contoh

Contoh berikut menunjukkan cara mengatur FontSize atribut FlowDocument elemen.

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

Contoh berikut menunjukkan cara mengatur FontSize properti secara terprogram.

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

Keterangan

Pengaturan apa pun FontSize pada elemen turunan mengambil alih pengaturan tingkat atas ini.

Penggunaan Atribut XAML

<object FontSize="double"/>  
- or -  
<object FontSize="qualifiedDouble"/>  

Nilai XAML

double
Double

Representasi string dari nilai yang Double sama dengan atau lebih besar dari 0,0 tetapi lebih kecil dari Double.PositiveInfinity. Nilai yang tidak memenuhi syarat diukur dalam piksel independen perangkat. String tidak perlu secara eksplisit menyertakan titik desimal.

qualifiedDouble
Nilai ganda seperti yang dijelaskan di atas, diikuti oleh salah satu penentu unit berikut: px, , incm, pt.

px (default) adalah unit independen perangkat (1/96 inci per unit)

in adalah inci; 1in==96px

cm adalah sentimeter; 1cm==(96/2,54) px

pt adalah poin; 1pt==(96/72) px

Informasi Properti Dependensi

Bidang pengidentifikasi FontSizeProperty
Properti metadata diatur ke true AffectsMeasure, AffectsRender, Inherits

Berlaku untuk