发送反馈
Enum FontFamily
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
FontFamily
已弃用 。getFontFamily()
和 setFontFamily(String)
方法现在使用字体字符串名称(而不是此枚举)。虽然此枚举已废弃,但仍可用于与旧脚本兼容。
支持的字体的枚举。
使用 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);
已弃用的属性
属性 类型 说明
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 Font 系列。
DANCING_SCRIPT
Enum
Dancing Script 字体系列。
DROID_SANS
Enum
Droid Sans 字体系列。
DROID_SERIF
Enum
Droid Serif 字体系列。
GARAMOND
Enum
Garamond 字体系列。
GEORGIA
Enum
格鲁吉亚字体系列。
GLORIA_HALLELUJAH
Enum
Gloria Hallelujah 字体系列。
GREAT_VIBES
Enum
Great Vibes 字体系列。
LOBSTER
Enum
龙虾字体系列。
MERRIWEATHER
Enum
Merriweather 字体系列。
PACIFICO
Enum
Pacifico 字体系列。
PHILOSOPHER
Enum
哲学字体系列。
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
The Times New Roman 字体系列。
TREBUCHET_MS
Enum
Trebuchet MS 字体系列。
UBUNTU
Enum
Ubuntu 字体系列。
VERDANA
Enum
Verdana 字体系列。
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-08-17。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]
需要向我们提供更多信息?