FlowDocument.FontFamily プロパティ

定義

FlowDocument に対して、優先される最上位レベルのフォント ファミリを取得または設定します。

public:
 property System::Windows::Media::FontFamily ^ FontFamily { System::Windows::Media::FontFamily ^ get(); void set(System::Windows::Media::FontFamily ^ value); };
[System.Windows.Localizability(System.Windows.LocalizationCategory.Font, Modifiability=System.Windows.Modifiability.Unmodifiable)]
public System.Windows.Media.FontFamily FontFamily { get; set; }
[<System.Windows.Localizability(System.Windows.LocalizationCategory.Font, Modifiability=System.Windows.Modifiability.Unmodifiable)>]
member this.FontFamily : System.Windows.Media.FontFamily with get, set
Public Property FontFamily As FontFamily

プロパティ値

FontFamily

優先フォント ファミリ、または優先されるプライマリ フォント ファミリと 1 つ以上の代替フォント ファミリを指定する FontFamily オブジェクト。 既定値は、MessageFontFamily 値によって決まるフォントです。

属性

次の例は、要素の属性を設定する FontFamily 方法を 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>

次の例では、FontFamily プロパティをプログラムで設定する方法を示しています。

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

注釈

子要素の設定は FontFamily 、この最上位レベルの設定をオーバーライドします。

複数のファミリが指定されている場合、2 番目以降のフォント ファミリは、プライマリ フォント ファミリが使用できない場合や適用できない場合に使用するフォールバック ファミリとして機能します。

このプロパティは、基本設定のみを指定します。 指定したフォント ファミリが使用できない場合は、 FlowDocument 値によって決定されたフォントに自動的に SystemFonts.MessageFontFamily フォールバックします。

XAML 属性の使用方法

<object FontFamily="fontFamilyName"/>  
- or -  
<object FontFamily="fontFamilyNamesList"/>  
- or -  
<object FontFamily="fontFamilyFolderReference"/>  
- or -  
<object FontFamily="fontFamilyUriReference"/>  

XAML 値

fontFamilyName
フォント ファミリ名を指定する文字列。  たとえば、"Arial" または "Century Gothic" です。

fontFamilyNamesList
複数のフォント ファミリ名を指定する文字列。それぞれをコンマで区切ります (コンマの後の空白は無視されます)。 指定された最初のフォント ファミリは、プライマリ フォント ファミリとして機能します。以降のフォント ファミリは、プライマリ フォント ファミリが使用できない場合や適用できない場合に使用するフォールバック ファミリとして機能します。 たとえば、 "Arial, Century Gothic" Arial をプライマリ フォント ファミリとして指定し、フォールバック フォント ファミリとして Century Gothic を指定します。

fontFamilyFolderReference
フォントを含むフォルダーとフォント ファミリ名を指定する文字列。 フォルダーとフォント ファミリ名は、# 文字で区切られます。 フォルダー参照は、絶対参照でも相対参照でもかまいません。 たとえば、「 "Custom Fonts\#My Custom Font" 」のように入力します。

fontFamilyUriReference
フォントの一様リソース識別子 (URI) とフォント ファミリ名を指定する文字列。 URI とフォント ファミリ名は#文字で区切られます。 たとえば、「 "http://MyFontServer/Fonts/#My Custom Font" 」のように入力します。

依存プロパティ情報

識別子フィールド FontFamilyProperty
メタデータのプロパティが次に設定されている true AffectsMeasureAffectsRenderInherits

適用対象