Stay organized with collections Save and categorize content based on your preferences.
FontFamilyDeprecated. 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);Deprecated properties Property Type Description
AMARANTH
Enum
The Amaranth font family. ARIAL
Enum
The Arial font family. ARIAL_BLACK
Enum
The Arial Black font family. ARIAL_NARROW
Enum
The Arial Narrow font family. ARVO
Enum
The Arvo font family. CALIBRI
Enum
The Calibri font family. CAMBRIA
Enum
The Cambria font family. COMIC_SANS_MS
Enum
The Comic Sans MS font family. CONSOLAS
Enum
The Consolas font family. CORSIVA
Enum
The Corsiva font family. COURIER_NEW
Enum
The Courier New font family. DANCING_SCRIPT
Enum
The Dancing Script font family. DROID_SANS
Enum
The Droid Sans font family. DROID_SERIF
Enum
The Droid Serif font family. GARAMOND
Enum
The Garamond font family. GEORGIA
Enum
The Georgia font family. GLORIA_HALLELUJAH
Enum
The Gloria Hallelujah font family. GREAT_VIBES
Enum
The Great Vibes font family. LOBSTER
Enum
The Lobster font family. MERRIWEATHER
Enum
The Merriweather font family. PACIFICO
Enum
The Pacifico font family. PHILOSOPHER
Enum
The Philosopher font family. POIRET_ONE
Enum
The Poiret One font family QUATTROCENTO
Enum
The Quattrocento font family. ROBOTO
Enum
The Roboto font family SHADOWS_INTO_LIGHT
Enum
The Shadows Into Light font family. SYNCOPATE
Enum
The Syncopate font family. TAHOMA
Enum
The Tahoma font family. TIMES_NEW_ROMAN
Enum
The Times New Roman font family. TREBUCHET_MS
Enum
The Trebuchet MS font family. UBUNTU
Enum
The Ubuntu font family. VERDANA
Enum
The Verdana font family.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["`FontFamily` is deprecated and now uses string names for fonts instead of the enum, but remains for compatibility."],["This enum allows you to set the font for text ranges, elements, or entire Google Docs documents."],["Supported fonts include Arial, Calibri, Comic Sans MS, Times New Roman, Verdana, and many more."],["You can use methods like `setFontFamily()` within Google Apps Script to apply these fonts."]]],["`FontFamily` enumeration, though deprecated, remains for older script compatibility. It lists supported font options like `ARIAL`, `CALIBRI`, and `COMIC_SANS_MS`. The methods `getFontFamily()` and `setFontFamily(String)` now use string names, and `FontFamily` is used to apply a specific font to document text, paragraphs, or specific ranges within text, via methods like `setFontFamily()`. There are multiple examples showing the usage of the font `FontFamily`.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4