Font

The Font field allows to custom fonts by size, styles, weight selection and much more.

font-body

Attributes

AttributesTypeRequiredDescription
idstringRequiredRequired. Unique ID identifying the field. It will be used as meta_key. Must be different from all other field IDs.
titlestringRequiredDisplays title of the option.
subtitlestringOptionalSubtitle display of the option, situated beneath the title.
descstringOptionalDescription of the option, appearing beneath the field control.
typestringRequiredValue identifying the field type. For Font field here we set value font
defaultarrayOptionalArray of default values. See ‘Default Options’ below.
colintOptionalThe proportion of columns that display field on 12 columns per row.
font_sizeboolOptionalFlag to display the font size input.
font_subsetsboolOptionalSubsets support for Google fonts
font_weightboolOptionalFlag to display the font weight selector
googleboolOptionalFlag to set Google fonts. Please make sure the Google API key is defined, or this feature will not work. For information on acquiring an API key, see https://developers.google.com/fonts/docs/developer_api#Auth

Default Options

NameTypeDefaultDescription
font_kindstringfalseSets the default font kind.
font_familystringfalseSets the default font family.
font_sizestringfalseSets the default font size.
font_weightstringfalseSets the default font weight.
font_stylestringfalseSets the default font style.
font_subsetsstringfalseSets the default Google font subset.

 Example Declaration