지원 중단되었습니다. 이제 getFontFamily()
및 setFontFamily(String)
메서드는 이 enum 대신 글꼴에 문자열 이름을 사용합니다. 이 enum은 지원 중단되었지만 이전 스크립트와의 호환성을 위해 계속 사용할 수 있습니다.
지원되는 글꼴의 열거형입니다.
FontFamily
열거형을 사용하여 텍스트, 요소 또는 문서 범위의 글꼴을 설정합니다.
var body = DocumentApp.getActiveDocument().getBody(); // Insert a paragraph at the start of the document. body.insertParagraph(0, "Hello, Apps Script!"); // Set the document 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. var text = 'Apps Script'; var a = body.getText().indexOf(text); var b = a + text.length - 1; body.editAsText().setFontFamily(a, b, DocumentApp.FontFamily.COMIC_SANS_MS);