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);
속성유형설명
AMARANTHEnumAmaranth 글꼴 모음
ARIALEnumArial 글꼴 모음
ARIAL_BLACKEnumArial Black 글꼴 모음
ARIAL_NARROWEnumArial Narrow 글꼴 모음
ARVOEnumArvo 글꼴 모음
CALIBRIEnumCalibri 글꼴 모음
CAMBRIAEnumCambria 글꼴 모음
COMIC_SANS_MSEnumComic Sans MS 글꼴 모음
CONSOLASEnumConsolas 글꼴 모음
CORSIVAEnumCorsiva 글꼴 모음
COURIER_NEWEnumCourier New 글꼴 모음
DANCING_SCRIPTEnum댄싱 스크립트 글꼴 모음
DROID_SANSEnumDroid Sans 글꼴 모음
DROID_SERIFEnumDroid Serif 글꼴 모음
GARAMONDEnumGaramond 글꼴 모음
GEORGIAEnumGeorgia 글꼴 모음
GLORIA_HALLELUJAHEnumGloria Hallelujah 글꼴 모음
GREAT_VIBESEnumGreat Vibes 글꼴 모음
LOBSTEREnumLobster 글꼴 모음
MERRIWEATHEREnumMerriweather 글꼴 모음
PACIFICOEnumPacifico 글꼴 모음
PHILOSOPHEREnumPhilosopher 글꼴 모음
POIRET_ONEEnumPoiret One 글꼴 모음
QUATTROCENTOEnumQuattrocento 글꼴 모음
ROBOTOEnumRoboto 글꼴 모음
SHADOWS_INTO_LIGHTEnumShadows Into Light 글꼴 모음
SYNCOPATEEnumSyncopate 글꼴 모음
TAHOMAEnumTahoma 글꼴 모음
TIMES_NEW_ROMANEnumTimes New Roman 글꼴 모음
TREBUCHET_MSEnumTrebuchet MS 글꼴 모음
UBUNTUEnumUbuntu 글꼴 모음
VERDANAEnumVerdana 글꼴 모음