FlowDocument.FontSize 屬性

定義

取得或設定 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

屬性值

要使用的字型大小 (以與裝置無關的像素為單位)。 預設值是由 MessageFontSize 值決定。

屬性

範例

下列範例示範如何設定 FontSize 專案的 屬性 FlowDocument

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

下列範例示範如何以程式設計方式設定 FontSize 屬性。

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

備註

子項目上的任何 FontSize 設定會覆寫此最上層設定。

XAML Attribute Usage

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

XAML 值

double
Double

值的字串表示 Double 等於或大於 0.0,但小於 Double.PositiveInfinity 。 不合格的值是以裝置獨立圖元來測量。 字串不需要明確包含小數點。

qualifiedDouble
如上所述的 雙精度 浮點數,後面接著下列其中一個單位規範: px 、、 incmpt 、 。

px (預設) 是裝置獨立單位 (,每單位 1/96 英吋)

in 為英吋;1in==96px

cm 為公分;1cm== (96/2.54) px

pt 為點;1pt== (96/72) px

相依性屬性資訊

識別碼欄位 FontSizeProperty
設定為 的中繼資料屬性 true AffectsMeasure, AffectsRender, Inherits

適用於