Enum FontFamily
Schriftfamilie
Veraltet. Bei den Methoden getFontFamily()
und setFontFamily(String)
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 FontFamily
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“. |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2024-12-22 (UTC).
[null,null,["Zuletzt aktualisiert: 2024-12-22 (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."]]],[]]