0
環境は、スタンドアロンスクリプトHTMLService()
でウェブアプリとして展開されている:Google Apps ScriptでFont Awesomeを使用するには?
function doGet() {
return HtmlService.createTemplateFromFile('index').evaluate();
}
// see: http://stackoverflow.com/a/39309690
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}
私はこのようなindex.html
でフォント恐ろしいCSSファイルにリンクすることができます
<?!= include('css_font_awesome'); ?>
これは内のスタイルが含まれているcss_font_awesome.html
にリンクします<style>
タグ
しかし、どのように、私はつまり、フォント恐ろしいCSSファイル内.eot
、.woff
、.ttf
と.svg
ファイルへリンクしてください:
@font-face {
font-family: 'FontAwesome';
src: url('fontawesome-webfont.eot?v=4.6.3');
src: url('fontawesome-webfont.eot?#iefix&v=4.6.3') format('embedded-opentype'), url('fontawesome-webfont.woff2?v=4.6.3') format('woff2'), url('fontawesome-webfont.woff?v=4.6.3') format('woff'), url('fontawesome-webfont.ttf?v=4.6.3') format('truetype'), url('fontawesome-webfont.svg?v=4.6.3#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
これは、CDN(または他の外部のGoogle Apps以外のドメインのドメインホスティング)を使用せずに可能であれば、後でポスターが出てくるのを知ってうまくいきました。 – user1063287
10/2016現在、Apps Scriptにはホスティングオプションはありません。第三者ホストする必要があります。 Firebase、App Engine、Cloud Storageは、Apps Scriptコミュニティで一般的に使用されているものです。 –