public interface

FontManager

com.pspdfkit.ui.fonts.FontManager

Class Overview

Gives you access to all the fonts available on the system.

Summary

Public Methods
abstract List<Font> getAvailableFonts()
This lists all the fonts available to use with PSPDFKit.
abstract Font getFontByName(String name)
Gets the font specified by the given name or null.

Public Methods

public abstract List<Font> getAvailableFonts ()

This lists all the fonts available to use with PSPDFKit.

Returns
  • All available fonts or an empty list if the user hasn't granted us storage access permission.

public abstract Font getFontByName (String name)

Gets the font specified by the given name or null. This function returns fonts for which getName() matches (i.e. where the font family name matches) and also fonts where any of the actual font files (including the font style suffix) matches the given font name.

final Font font1 = fontManager.getFontByName("Roboto");
 final Font font2 = fontManager.getFontByName("Roboto-Bold");

 // This method returns the same font object for both inputs.
 assert font1 == font2;
 

Parameters
name The name of the font to get. May be null, in which case this method will always return null.
Returns
  • The font of the given name or null if no font for the name exists.