PSPDFFontPickerViewController


@interface PSPDFFontPickerViewController : PSPDFStaticTableViewController

Font picker that allows the user to select a font and customize the style.

  • Initialize with a list of displayed UIFontDescriptors. If fontFamilyDescriptors is nil, a default list of all commonly used font families is used.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithFontFamilyDescriptors:
        (nullable NSArray<UIFontDescriptor *> *)fontFamilyDescriptors;

    Swift

    init(fontFamilyDescriptors: [NSFontDescriptor]?)
  • All available font family names as UIFontDescriptors.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic)
        NSArray<UIFontDescriptor *> *_Nonnull fontFamilyDescriptors;

    Swift

    var fontFamilyDescriptors: [NSFontDescriptor] { get }
  • The currently selected font.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) UIFont *selectedFont;

    Swift

    var selectedFont: NSFont? { get set }
  • We highlight common fonts on top to make selection easier. This must be a subset of fontFamilyDescriptors. Set this to nil to have no highlight set.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable)
        NSArray<UIFontDescriptor *> *highlightedFontFamilyDescriptors;

    Swift

    var highlightedFontFamilyDescriptors: [NSFontDescriptor]? { get set }
  • Whether to allow search. Must be set before the view is loaded. Defaults to YES.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL searchEnabled;

    Swift

    var searchEnabled: Bool { get set }
  • Enable font downloading from Apple’s servers. Defaults to YES. - note: See http://support.apple.com/kb/HT5484 for the full list.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showDownloadableFonts;

    Swift

    var showDownloadableFonts: Bool { get set }
  • The font picker delegate - notifies when a font is selected.

    Declaration

    Objective-C

    @property (readwrite, nonatomic)
        id<PSPDFFontPickerViewControllerDelegate> _Nullable delegate;

    Swift

    @IBOutlet weak var delegate: PSPDFFontPickerViewControllerDelegate? { get set }