fix(lint): allow CJK fallback stacks documented in output-spec.md (#75)

Extend lint-skin.py font allowlist with the Hiragino/Noto/Yu Gothic
families from output-spec.md §4 and add adversarial tests including a
Yu Gothic UI rejection case.

Fixes #74
This commit is contained in:
Atirna
2026-08-17 13:44:37 -07:00
committed by GitHub
parent 09df49d8d1
commit 7ed2b20a5a
4 changed files with 49 additions and 2 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "diagram-design", "name": "diagram-design",
"description": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, or DP security matrix diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg or Mermaid .mmd sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.", "description": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, or DP security matrix diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg or Mermaid .mmd sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.",
"version": "2.4.0", "version": "2.4.1",
"author": { "author": {
"name": "Cathryn Lavery", "name": "Cathryn Lavery",
"url": "https://github.com/cathrynlavery" "url": "https://github.com/cathrynlavery"
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "diagram-design", "name": "diagram-design",
"description": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, or DP security matrix diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg or Mermaid .mmd sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.", "description": "Create branded architecture, IT current-state, flowchart, sequence, state machine, ER/data model, timeline, swimlane, quadrant, radar/spider, loop/flywheel, nested, tree, org chart, layer stack, Venn, pyramid/funnel, bar, line, Gantt and scatter charts, high-level, process, medallion, data flow, DP integration, or DP security matrix diagrams as standalone HTML/SVG/PNG. Redraw .drawio/.drawio.png/.drawio.svg or Mermaid .mmd sources at a chosen size/detail; onboard brand tokens from a website; add semantic patterns, callouts, accessible motion, or sketchy/hand-drawn styling.",
"version": "2.4.0", "version": "2.4.1",
"author": { "author": {
"name": "Cathryn Lavery", "name": "Cathryn Lavery",
"url": "https://github.com/cathrynlavery" "url": "https://github.com/cathrynlavery"
+4
View File
@@ -53,6 +53,10 @@ ALLOWED_FONTS = {
"instrument serif", "instrument serif",
"geist", "geist",
"geist mono", "geist mono",
"hiragino sans",
"noto sans jp",
"yu gothic",
"noto sans mono cjk jp",
"system-ui", "system-ui",
"sans-serif", "sans-serif",
"serif", "serif",
+43
View File
@@ -363,6 +363,49 @@ def main() -> int:
"font-family: unsupported font family: Unapproved Sans", "font-family: unsupported font family: Unapproved Sans",
directory, directory,
) )
cjk_name_svg = VALID_SVG.replace("fixture-title", "cjk-name-stack-title").replace(
"fixture-desc", "cjk-name-stack-desc"
)
require_pass(
"cjk-name-stack",
cjk_name_svg.replace(
"</svg>",
'<text font-family="\'Geist\', \'Hiragino Sans\', \'Noto Sans JP\', '
'\'Yu Gothic\', sans-serif">認証サービス</text>\n</svg>',
),
directory,
)
cjk_mono_svg = VALID_SVG.replace("fixture-title", "cjk-mono-stack-title").replace(
"fixture-desc", "cjk-mono-stack-desc"
)
require_pass(
"cjk-mono-stack",
cjk_mono_svg.replace(
"</svg>",
'<text font-family="\'Geist Mono\', \'Noto Sans Mono CJK JP\', '
'monospace">포트 443</text>\n</svg>',
),
directory,
)
cjk_css_svg = VALID_SVG.replace("fixture-title", "cjk-css-stack-title").replace(
"fixture-desc", "cjk-css-stack-desc"
)
require_pass(
"cjk-css-stack",
'<style>text { font-family: "Geist", "Hiragino Sans", "Noto Sans JP", '
'"Yu Gothic", sans-serif; }</style>\n' + cjk_css_svg,
directory,
)
yu_gothic_ui_svg = VALID_SVG.replace(
"fixture-title", "yu-gothic-ui-title"
).replace("fixture-desc", "yu-gothic-ui-desc")
require_lint_finding(
"yu-gothic-ui",
'<style>text { font-family: "Yu Gothic UI", sans-serif; }</style>\n'
+ yu_gothic_ui_svg,
"font-family: unsupported font family: Yu Gothic UI",
directory,
)
spec = importlib.util.spec_from_file_location("build_icons", BUILD_ICONS) spec = importlib.util.spec_from_file_location("build_icons", BUILD_ICONS)
if spec is None or spec.loader is None: if spec is None or spec.loader is None: