Enum FontFamily
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
글꼴모음
지원 중단되었습니다. 이제 getFontFamily()
및 setFontFamily(String)
메서드는 이 enum 대신 글꼴에 문자열 이름을 사용합니다. 이 enum은 지원 중단되었지만 이전 스크립트와의 호환성을 위해 계속 사용할 수 있습니다.
지원되는 글꼴의 열거형입니다.
FontFamily
열거형을 사용하여 텍스트, 요소 또는 문서의 글꼴을 설정합니다.
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);
지원 중단된 속성
속성 | 유형 | 설명 |
AMARANTH | Enum | Amaranth 글꼴 모음 |
ARIAL | Enum | Arial 글꼴 모음 |
ARIAL_BLACK | Enum | Arial Black 글꼴 모음 |
ARIAL_NARROW | Enum | Arial Narrow 글꼴 모음 |
ARVO | Enum | Arvo 글꼴 모음 |
CALIBRI | Enum | Calibri 글꼴 모음 |
CAMBRIA | Enum | Cambria 글꼴 모음 |
COMIC_SANS_MS | Enum | Comic Sans MS 글꼴 모음 |
CONSOLAS | Enum | Consolas 글꼴 모음 |
CORSIVA | Enum | Corsiva 글꼴 모음 |
COURIER_NEW | Enum | Courier New 글꼴 모음 |
DANCING_SCRIPT | Enum | 댄싱 스크립트 글꼴 모음 |
DROID_SANS | Enum | Droid Sans 글꼴 모음 |
DROID_SERIF | Enum | Droid Serif 글꼴 모음 |
GARAMOND | Enum | Garamond 글꼴 모음 |
GEORGIA | Enum | Georgia 글꼴 모음 |
GLORIA_HALLELUJAH | Enum | Gloria Hallelujah 글꼴 모음 |
GREAT_VIBES | Enum | Great Vibes 글꼴 모음 |
LOBSTER | Enum | Lobster 글꼴 모음 |
MERRIWEATHER | Enum | Merriweather 글꼴 모음 |
PACIFICO | Enum | Pacifico 글꼴 모음 |
PHILOSOPHER | Enum | Philosopher 글꼴 모음 |
POIRET_ONE | Enum | Poiret One 글꼴 모음 |
QUATTROCENTO | Enum | Quattrocento 글꼴 모음 |
ROBOTO | Enum | Roboto 글꼴 모음 |
SHADOWS_INTO_LIGHT | Enum | Shadows Into Light 글꼴 모음 |
SYNCOPATE | Enum | Syncopate 글꼴 모음 |
TAHOMA | Enum | Tahoma 글꼴 모음 |
TIMES_NEW_ROMAN | Enum | Times New Roman 글꼴 모음 |
TREBUCHET_MS | Enum | Trebuchet MS 글꼴 모음 |
UBUNTU | Enum | Ubuntu 글꼴 모음 |
VERDANA | Enum | Verdana 글꼴 모음 |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003e\u003ccode\u003eFontFamily\u003c/code\u003e is deprecated and now uses string names for fonts instead of the enum, but remains for compatibility.\u003c/p\u003e\n"],["\u003cp\u003eThis enum allows you to set the font for text ranges, elements, or entire Google Docs documents.\u003c/p\u003e\n"],["\u003cp\u003eSupported fonts include Arial, Calibri, Comic Sans MS, Times New Roman, Verdana, and many more.\u003c/p\u003e\n"],["\u003cp\u003eYou can use methods like \u003ccode\u003esetFontFamily()\u003c/code\u003e within Google Apps Script to apply these fonts.\u003c/p\u003e\n"]]],["`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"],null,["# Enum FontFamily\n\nFontFamily\n\n\n**Deprecated.** The methods `get``Font``Family()` and `set``Font``Family(String)` now use string\nnames for fonts instead of this enum. Although this enum is deprecated, it will remain\navailable for compatibility with older scripts.\n\nAn enumeration of the supported fonts.\n\nUse the `Font``Family` enumeration to set the font for a range of text, element or\ndocument.\n\n```javascript\nconst body =\n DocumentApp.getActiveDocument().getActiveTab().asDocumentTab().getBody();\n\n// Insert a paragraph at the start of the document.\nbody.insertParagraph(0, 'Hello, Apps Script!');\n\n// Set the tab font to Calibri.\nbody.editAsText().setFontFamily(DocumentApp.FontFamily.CALIBRI);\n\n// Set the first paragraph font to Arial.\nbody.getParagraphs()[0].setFontFamily(DocumentApp.FontFamily.ARIAL);\n\n// Set \"Apps Script\" to Comic Sans MS.\nconst text = 'Apps Script';\nconst a = body.getText().indexOf(text);\nconst b = a + text.length - 1;\nbody.editAsText().setFontFamily(a, b, DocumentApp.FontFamily.COMIC_SANS_MS);\n``` \n\n### Deprecated properties\n\n| Property | Type | Description |\n|----------------------|--------|-------------------------------------|\n| `AMARANTH` | `Enum` | The Amaranth font family. |\n| `ARIAL` | `Enum` | The Arial font family. |\n| `ARIAL_BLACK` | `Enum` | The Arial Black font family. |\n| `ARIAL_NARROW` | `Enum` | The Arial Narrow font family. |\n| `ARVO` | `Enum` | The Arvo font family. |\n| `CALIBRI` | `Enum` | The Calibri font family. |\n| `CAMBRIA` | `Enum` | The Cambria font family. |\n| `COMIC_SANS_MS` | `Enum` | The Comic Sans MS font family. |\n| `CONSOLAS` | `Enum` | The Consolas font family. |\n| `CORSIVA` | `Enum` | The Corsiva font family. |\n| `COURIER_NEW` | `Enum` | The Courier New font family. |\n| `DANCING_SCRIPT` | `Enum` | The Dancing Script font family. |\n| `DROID_SANS` | `Enum` | The Droid Sans font family. |\n| `DROID_SERIF` | `Enum` | The Droid Serif font family. |\n| `GARAMOND` | `Enum` | The Garamond font family. |\n| `GEORGIA` | `Enum` | The Georgia font family. |\n| `GLORIA_HALLELUJAH` | `Enum` | The Gloria Hallelujah font family. |\n| `GREAT_VIBES` | `Enum` | The Great Vibes font family. |\n| `LOBSTER` | `Enum` | The Lobster font family. |\n| `MERRIWEATHER` | `Enum` | The Merriweather font family. |\n| `PACIFICO` | `Enum` | The Pacifico font family. |\n| `PHILOSOPHER` | `Enum` | The Philosopher font family. |\n| `POIRET_ONE` | `Enum` | The Poiret One font family |\n| `QUATTROCENTO` | `Enum` | The Quattrocento font family. |\n| `ROBOTO` | `Enum` | The Roboto font family |\n| `SHADOWS_INTO_LIGHT` | `Enum` | The Shadows Into Light font family. |\n| `SYNCOPATE` | `Enum` | The Syncopate font family. |\n| `TAHOMA` | `Enum` | The Tahoma font family. |\n| `TIMES_NEW_ROMAN` | `Enum` | The Times New Roman font family. |\n| `TREBUCHET_MS` | `Enum` | The Trebuchet MS font family. |\n| `UBUNTU` | `Enum` | The Ubuntu font family. |\n| `VERDANA` | `Enum` | The Verdana font family. |"]]