Skip to main content

EditBase.TextFontFamily Property

Gets or sets the font family that the editor uses for input text, label and placeholder.

Namespace: DevExpress.XamarinForms.Editors

Assembly: DevExpress.XamarinForms.Editors.dll

NuGet Package: DevExpress.XamarinForms.Editors

Declaration

public string TextFontFamily { get; set; }

Property Value

Type Description
String

The font family name.

Remarks

To apply a custom font, add the font file to your solution, and then assign it to the editor’s TextFontFamily property.

This example shows how to apply the Verdana font.

  1. Add the font file to your platform-specific projects:

    • Android
      Add the font file to the Android project’s Assets folder and set Build Action: AndroidAsset.
    • iOS
      Add the font file to the iOS project’s Resources folder,
      set Build Action: BundleResource,
      and add the font file name to the Info.plist file (the UIAppFonts key in Visual Studio, or the Fonts provided by application property in Visual Studio for Mac).
  2. In the App.xaml file, add the following lines to the ResourceDictionary section:

    <OnPlatform x:TypeArguments="x:String" x:Key="Verdana">
      <On Platform="Android" Value="verdana.ttf#Verdana"/>
      <On Platform="iOS" Value="Verdana"/>
    </OnPlatform>
    
  3. Set the TextFontFamily property to the key defined for the custom font:

      <dxe:TextEdit TextFontFamily="{StaticResource Verdana}" />
    

Note

The TextFontAttributes property affects the default font only. If you need to apply a bold or an italic custom font, use the corresponding font style file as described above.

See Also