feat: Webフォントをローカルホスティング化して外部CDN依存を排除#1343
Merged
Conversation
## 背景 crane_web_debuggerのWebインターフェースでアイコンやテキストフォントの表示が 毎回遅い問題があった。原因は全フォント(Material Symbols Outlined、 Noto Sans JP、Roboto)をGoogle Fonts CDNから読み込んでおり、 ページアクセスのたびに外部ネットワークアクセスが発生していたため。 ## 変更内容 - download_fonts.py を追加: Google Fonts CDNからフォントをダウンロードするスクリプト - Dockerfileに `RUN python3 /app/web/download_fonts.py` を追加し、 Dockerビルド時にフォントをダウンロードしてイメージに焼き込む - 4つのHTMLファイルのGoogle Fonts CDN参照をローカルCSS参照に変更 - .gitignoreに assets/fonts/ を追加(フォントファイルはgit管理外) ## 開発時の使い方 初回およびフォント更新時に以下を実行: python3 crane_web_debugger/web/download_fonts.py
d08bc66 to
481ecb0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
crane_web_debuggerのWebインターフェースで使用している全フォント(Material Symbols Outlined、Noto Sans JP、Roboto)をGoogle Fonts CDNからローカルファイルに切り替え、外部ネットワークアクセスを完全に排除する。
背景・根本原因
アイコン表示が毎回遅い問題があった。原因はGoogle Fonts CDNからのフォント読み込みで毎回外部ネットワークアクセスが発生していたため。特にMaterial Symbols Outlinedはフォントサイズが大きく(3.8MB)、CDNからの取得に時間がかかっていた。
変更内容