• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
5

ダイナミックフォント提供時にconsoleで404 エラー

New Here ,
Sep 29, 2020 Sep 29, 2020

Copy link to clipboard

Copied

私のサイトは非同期遷移ですべてのページへ移動できるように構築してあるのですが、

何ページか移動すると、consoleに以下のようなtypekitのエラーログが出力されます。

 

404 https://use.typekit.net/af/xxxxxx/xxxxxx/xx/m?primer=xxxxxx  

 

このヘルプページに書いてあるとおり、use.typekit.net 上にフォントのサブセットが既にあれば404がでることが正常であると書いてありますが、そもそもエラーを回避することはできないのでしょうか。

https://helpx.adobe.com/jp/fonts/user-guide.html/jp/fonts/using/dynamic-subsetting.ug.html

 

私の要望としては以下の2点です。

・consoleにエラーログを出力しない方法はありますか?

・ログだけでなく、そもそもダウンロードせずエラーを回避することはできますか?

 

--

 

ちなみに、fontの読み込みには、以下のようなJSを記載しています

 

(function(d) {
        var config = {
                kitId: 'xxxxxxx',
                scriptTimeout: 3000,
                async: true
            },
            h = d.documentElement,
            t = setTimeout(function() { h.className = h.className.replace(/\bwf-loading\b/g, "") + " wf-inactive"; }, config.scriptTimeout),
            tk = d.createElement("script"),
            f = false,
            s = d.getElementsByTagName("script")[0],
            a;
        h.className += " wf-loading";
        tk.src='https://use.typekit.net/' + config.kitId + '.js';
        tk.async = true;
        tk.onload = tk.onreadystatechange = function() { a = this.readyState; if (f || a && a != "complete" && a != "loaded") return;
        f = true;
        clearTimeout(t); try { Typekit.load(config) } catch (e) {} };
    s.parentNode.insertBefore(tk, s)
})(document);

 

よろしくお願いいたします。

Views

752

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation