Veraltet. Bei den Methoden get
und set
werden jetzt Stringnamen für Schriftarten anstelle dieses Enumerationstyps verwendet. Dieses Enum ist zwar eingestellt, bleibt aber zur Abwärtskompatibilität mit älteren Scripts verfügbar.
Eine Aufzählung der unterstützten Schriftarten.
Mit der Aufzählung Font
können Sie die Schriftart für einen Textbereich, ein Element oder ein Dokument festlegen.
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);
Eingestellte Properties
Attribut | Typ | Beschreibung |
---|---|---|
AMARANTH | Enum | Die Schriftfamilie „Amaranth“ |
ARIAL | Enum | Die Schriftfamilie „Arial“. |
ARIAL_BLACK | Enum | Die Schriftfamilie „Arial Black“ |
ARIAL_NARROW | Enum | Die Schriftfamilie „Arial Narrow“ |
ARVO | Enum | Die Schriftfamilie „Arvo“ |
CALIBRI | Enum | Die Schriftfamilie „Calibri“ |
CAMBRIA | Enum | Die Schriftfamilie „Cambria“ |
COMIC_SANS_MS | Enum | Die Schriftfamilie „Comic Sans MS“ |
CONSOLAS | Enum | Die Consolas-Schriftfamilie. |
CORSIVA | Enum | Die Schriftfamilie „Corsiva“ |
COURIER_NEW | Enum | Courier New |
DANCING_SCRIPT | Enum | Die Schriftfamilie „Dancing Script“ |
DROID_SANS | Enum | Die Schriftfamilie „Droid Sans“ |
DROID_SERIF | Enum | Die Schriftfamilie „Droid Serif“ |
GARAMOND | Enum | Die Schriftfamilie „Garamond“. |
GEORGIA | Enum | Die Schriftfamilie „Georgia“ |
GLORIA_HALLELUJAH | Enum | Die Schriftfamilie „Gloria Hallelujah“ |
GREAT_VIBES | Enum | Die Schriftfamilie „Great Vibes“ |
LOBSTER | Enum | Die Schriftfamilie „Lobster“ |
MERRIWEATHER | Enum | Die Schriftfamilie „Merriweather“ |
PACIFICO | Enum | Die Schriftfamilie „Pacifico“ |
PHILOSOPHER | Enum | Die Schriftfamilie „Philosopher“ |
POIRET_ONE | Enum | Die Schriftfamilie „Poiret One“ |
QUATTROCENTO | Enum | Die Schriftfamilie „Quattrocento“. |
ROBOTO | Enum | Die Schriftfamilie „Roboto“ |
SHADOWS_INTO_LIGHT | Enum | Die Schriftfamilie „Shadows Into Light“ |
SYNCOPATE | Enum | Die Schriftfamilie „Syncopate“ |
TAHOMA | Enum | Die Schriftfamilie „Tahoma“. |
TIMES_NEW_ROMAN | Enum | Die Schriftfamilie „Times New Roman“. |
TREBUCHET_MS | Enum | Die Schriftfamilie „Trebuchet MS“ |
UBUNTU | Enum | Die Ubuntu-Schriftfamilie. |
VERDANA | Enum | Die Schriftfamilie „Verdana“. |