Enum FontFamily

FontFamily

Deprecated. The methods getFontFamily() and setFontFamily(String) now use string names for fonts instead of this enum. Although this enum is deprecated, it will remain available for compatibility with older scripts.

An enumeration of the supported fonts.

Use the FontFamily enumeration to set the font for a range of text, element or document.

const body =
    DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();

// Insert a paragraph at the start of the document.
body.insertParagraph(0, 'Hello, Apps Script!');

// Set the tab font to Calibri.
body.editAsText().setFontFamily(DocumentApp.FontFamily.CALIBRI);

// Set the first paragraph font to Arial.
body.getParagraphs()[0].setFontFamily(DocumentApp.FontFamily.ARIAL);

// Set "Apps Script" to Comic Sans MS.
const text = 'Apps Script';
const a = body.getText().indexOf(text);
const b = a + text.length - 1;
body.editAsText().setFontFamily(a, b, DocumentApp.FontFamily.COMIC_SANS_MS);
PropertyTypeDescription
AMARANTHEnumThe Amaranth font family.
ARIALEnumThe Arial font family.
ARIAL_BLACKEnumThe Arial Black font family.
ARIAL_NARROWEnumThe Arial Narrow font family.
ARVOEnumThe Arvo font family.
CALIBRIEnumThe Calibri font family.
CAMBRIAEnumThe Cambria font family.
COMIC_SANS_MSEnumThe Comic Sans MS font family.
CONSOLASEnumThe Consolas font family.
CORSIVAEnumThe Corsiva font family.
COURIER_NEWEnumThe Courier New font family.
DANCING_SCRIPTEnumThe Dancing Script font family.
DROID_SANSEnumThe Droid Sans font family.
DROID_SERIFEnumThe Droid Serif font family.
GARAMONDEnumThe Garamond font family.
GEORGIAEnumThe Georgia font family.
GLORIA_HALLELUJAHEnumThe Gloria Hallelujah font family.
GREAT_VIBESEnumThe Great Vibes font family.
LOBSTEREnumThe Lobster font family.
MERRIWEATHEREnumThe Merriweather font family.
PACIFICOEnumThe Pacifico font family.
PHILOSOPHEREnumThe Philosopher font family.
POIRET_ONEEnumThe Poiret One font family
QUATTROCENTOEnumThe Quattrocento font family.
ROBOTOEnumThe Roboto font family
SHADOWS_INTO_LIGHTEnumThe Shadows Into Light font family.
SYNCOPATEEnumThe Syncopate font family.
TAHOMAEnumThe Tahoma font family.
TIMES_NEW_ROMANEnumThe Times New Roman font family.
TREBUCHET_MSEnumThe Trebuchet MS font family.
UBUNTUEnumThe Ubuntu font family.
VERDANAEnumThe Verdana font family.