topmindspace/topmind-writing-skills / topmind-cover
topmind-cover
Unverified设计高辨识度的文章、图文与视频封面、头图和缩略图,适配小红书、抖音、公众号、X Article 与短帖;追求清晰信息密度与真实层次,概念功能图诚实标注“功能示意,不是实拍”。密集信息长图用 topmind-poster。
scripts/test_title_font_resolution.py
View on GitHubimport os
from pathlib import Path
import runpy
import unittest
from unittest.mock import patch
TITLE = Path(__file__).with_name("title-engine.py")
class TitleFontTests(unittest.TestCase):
def setUp(self):
self.engine = runpy.run_path(str(TITLE))
self.resolve = self.engine["resolve_alias"]
self.fallback, self.index = self.engine["MAC_FONT_FALLBACKS"]["hei"]
def test_local_noto_takes_priority_over_system_font(self):
candidate = self.engine["FONTS"]["hei"][0][0]
with patch("os.path.isfile", side_effect={candidate, self.fallback}.__contains__):
self.assertEqual(self.resolve("hei"), (candidate, 0, "Bold"))
def test_system_fallback_selects_the_actual_bold_face(self):
with patch("os.path.isfile", side_effect={self.fallback}.__contains__):
self.assertEqual(self.resolve("hei"), (self.fallback, 2, None))
@unittest.skipUnless(os.path.isfile("/System/Library/Fonts/Hiragino Sans GB.ttc"), "macOS CJK face")
def test_fallback_renders_hiragino_w6(self):
actual = os.path.isfile
with patch("os.path.isfile", side_effect=lambda p: p == self.fallback and actual(p)):
font = self.engine["font"]("hei", 52)
self.assertEqual(font.getname(), ("Hiragino Sans GB", "W6"))
self.assertIsNotNone(font.getmask("擎").getbbox())
if __name__ == "__main__":
unittest.main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |