Download and apply fonts to text in the Layout editor

Download and apply fonts to text

When using the Android Support Library v26.0.0 or higher (or when your minSdkVersion is 26 or higher), you can select from hundreds of fonts by following these steps:

  1. In the Layout Editor, click the Design tab to view your layout in the design editor.
  2. Click a text view.
  3. In the Attributes window, expand textAppearance and then click to expand the fontFamily box.
  4. Scroll to the bottom of the list and click More Fonts to open the Resources dialog.

    Figure 6. The Resources dialog to select a font

  5. In the Resources dialog, select a font by browsing the list or typing into the search bar at the top. If you select one listed under Downloadable, then you can either click Create downloadable font to load the font at runtime (as a downloadable font), or click Add font to project to package the TTF font file in your APK. (The fonts listed under Android are provided in the Android system so do not need to be downloaded or bundled in your APK.)
  6. Click OK.

Leave a Reply