[英]How to Set the Font Weight in Apps Script - Google Docs
在正常和粗体粗细之间进行调整:
setAttributes
并将DocumentApp.Attribute.BOLD
设置为true
或false
(如上面提到的@Tanaike)。setBold(bold)
或setBold(startOffset, endOffsetInclusive, bold)
。 To set weights other than normal and bold for fonts that include additional weights (eg the medium weight of Alegreya Sans) there's an apparently undocumented method: use the setFontFamily(fontFamilyName)
or setFontFamily(startOffset, endOffsetInclusive, fontFamilyName)
method and append a semicolon and字体系列字符串的数字CSS 字体重量,如下所示:
someElement.setFontFamily('Alegreya Sans;500')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.