html: add a generic fallback family to font-family
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in src/odr/internal/html/document_document_style.cpp-adjacent code: src/odr/internal/html/document_style.cpp, functions translate_text_style and translate_block_font_style, where font-family:<name>; is emitted. Trace where font data comes from to find ODF style:font-family-generic and docx w:family (inside w:font), then add quoted-name-plus-generic output with a small well-known-fonts table defaulting to sans-serif. Done means every emitted font-family has a quoted name and generic fallback, checked against the reference-output comparison that flagged xlsx Calibri cells.
由索引模型根据 Issue 内容生成。
描述
The HTML output writes font-family:<name>; with the font name of the document only (translate_text_style and translate_block_font_style in src/odr/internal/html/document_style.cpp). The value has no generic fallback family.
If the font is not installed, the browser uses its default font, which is usually a serif font. A spreadsheet in Calibri then renders in Times. Excel and LibreOffice replace a missing font with a font of the same kind.
Proposal:
- Add a generic family after the name, for example
font-family:"Calibri",sans-serif. - Pick
serif,sans-seriformonospacefrom the font data if the document gives it (style:font-family-genericin ODF,w:familyinw:fontfor docx). Else use a small table of well-known names, and usesans-serifas the default. - Quote the name, so a name with special characters stays one family.
The v7.4.0 → v7.5.0 reference-output check found this on xlsx cells that now get their Calibri font from the row or column style. This is not a regression, because cells with their own Calibri style had the same problem before.
🤖 Generated with Claude Code
- 主要语言
- C++
- 星标
- 41
- 派生
- 10
- 平均合并
- 12 小时 4 分钟
- 30 天内合并 PR
- 297
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
opendocument-app/OpenDocument.core 的其他 Issue
-
bug
难度 4/5 3-5 天 新手友好度 35/100
opendocument-app/OpenDocument.core#1211 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 42/100
opendocument-app/OpenDocument.core#1210 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 45/100
opendocument-app/OpenDocument.core#1209 ·
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 38/100
opendocument-app/OpenDocument.core#1208 ·
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 35/100
opendocument-app/OpenDocument.core#1207 ·
维护者通常 1 天内回复
查看 opendocument-app/OpenDocument.core 的全部 Issue
相似的 Issue
-
objdetect(mcc): CCheckerDetector leaves its chart type uninitialized 🤖🤖🤖可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
(S1 - Need confirmation)
难度 2/5 1-3 小时 新手友好度 65/100
CleverRaven/Cataclysm-DDA#89182 ·
维护者通常 1 天内回复
-
ai_p2
难度 2/5 1-3 小时 新手友好度 84/100
ClickHouse/ClickHouse#126833 ·
维护者通常 1 天内回复
-
clang:static analyzer
难度 2/5 1-3 小时 新手友好度 68/100
llvm/llvm-project#233598 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100