Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Font Awesome Brand Icons do not work

已關閉
#2,278 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

已經有一個關聯 PR 被合併了。

  • #2287 來自 @00200200 —— 已合併

評估

難度
3/5
預估耗時
1-2 天
新手友好度
67/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
css, javascript, python

研究方向

首先執行 issue 中的 Flask 重現,並在 Firefox 或 Chromium 中檢查產生的 HTML 以及載入的 Font Awesome Web 字型。追蹤 folium.Icon 如何處理 fa 前綴,並比較 solid 圖示 heart 與 brand 圖示 bluetooth。當兩個標記都能正確轉譯,且回歸檢查涵蓋 brand 圖示時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Describe the bug

Brand icons from font-awesome do not render correctly.

To Reproduce

from flask import Flask, render_template_string

import folium

app = Flask(__name__)


@app.route("/")
def fullscreen():
    """Simple example of a fullscreen map."""
    m = folium.Map(location=[41, -71], zoom_start=4)

    folium.Marker(location=[41, -72],
        icon=folium.Icon(prefix='fa', icon='fa-heart')).add_to(m)

    folium.Marker(location=[41, -75],
        icon=folium.Icon(prefix='fa', icon='fa-bluetooth')).add_to(m)

    return m.get_root().render()


if __name__ == "__main__":
    app.run(debug=True)

Expected behavior

All icons to render correctly

Environment (please complete the following information):

  • Browser: Firefox 140.15.0esr and Chromium 152.0.7977.64
  • Jupyter Notebook or html files? Flask
  • Python version: sys.version_info(major=3, minor=13, micro=5, releaselevel='final', serial=0)
  • folium version: 0.19.5+dfsg
  • branca version: 0.8.1

Additional context

It seems that the appropriate web font is not loaded. If I go to Web Developer Tools -> Inspector -> Fonts -> All Fonts on Page only https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/webfonts/fa-solid-900.woff2 is loaded and I believe the glyph for bluetooth is in https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/webfonts/fa-brands-400.woff2 so it isn't rendered correctly.

Screenshots

Image

folium is maintained by volunteers. Can you help making a fix for this issue? Probably not

主要語言
Python
星號
7.4k
分支
2.3k
平均合併
2 天 4 小時
30 天內合併 PR
10

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

python-visualization/folium 的其他 Issue

查看 python-visualization/folium 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。