Agent Skills › HermannBjorgvin/Clawdmeter › regenerating-firmware-assets

regenerating-firmware-assets

GitHub

用于重新生成固件所需的LVGL字体、图标及Clawd动画头文件等资产。涵盖字体转换与补丁、PNG转RGB565A8图标、以及GIF/Lottie转动画,解决渲染不可见等问题。

.claude/skills/regenerating-firmware-assets/SKILL.md HermannBjorgvin/Clawdmeter

触发场景

添加或修改字体大小/字符 新增或变更图标 重新转换Clawd动画 文本或图标渲染不可见

安装

npx skills add HermannBjorgvin/Clawdmeter --skill regenerating-firmware-assets -g -y
更多选项

非标准路径

npx skills add https://github.com/HermannBjorgvin/Clawdmeter/tree/main/.claude/skills/regenerating-firmware-assets -g -y

不安装直接使用

npx skills use HermannBjorgvin/Clawdmeter@regenerating-firmware-assets

指定 Agent (Claude Code)

npx skills add HermannBjorgvin/Clawdmeter --skill regenerating-firmware-assets -a claude-code -g -y

安装 repo 全部 skill

npx skills add HermannBjorgvin/Clawdmeter --all -g -y

预览 repo 内 skill

npx skills add HermannBjorgvin/Clawdmeter --list

SKILL.md

Frontmatter
{
    "name": "regenerating-firmware-assets",
    "description": "Regenerates the firmware's generated assets - LVGL bitmap fonts (lv_font_conv plus the LVGL 9 patch), RGB565A8 icons from PNGs (tools\/png_to_lvgl.js), and the Clawd animation header splash_animations.h (tools\/convert_official_clawd.js). Use when adding a font size or glyph, adding or changing an icon, adding or re-converting a Clawd animation, or when text or icons render invisible."
}

Regenerating firmware assets

Run everything from the repo root. These files are generated: change the source or the tool, then regenerate. Never hand-edit firmware/src/splash_animations.h or a font_*.c beyond the documented patch.

Fonts (firmware/src/font_*.c)

The exact lv_font_conv@1.5.3 commands for every font and size are in docs/fonts.md. lv_font_conv emits the LVGL 8 layout; patch each file for LVGL 9 or the font compiles but renders invisible:

  1. Remove the #if LVGL_VERSION_MAJOR >= 8 guards around font_dsc and the font struct.
  2. Drop the .cache initializer.
  3. Set .release_glyph = NULL, .kerning = 0, .static_bitmap = 0.
  4. Set .fallback = NULL, .user_data = NULL.

Diff against a checked-in font to confirm the shape. Styrene and Tiempos are ASCII only; new symbols need a font that has the glyphs. Then check rendering in the simulator at 480×480 and 240×240 (verifying-firmware-ui skill): a clean compile proves nothing.

Icons (firmware/src/icons.h)

(cd tools && npm install --no-save pngjs)        # once; tools/node_modules is git-ignored
node tools/png_to_lvgl.js input.png symbol_name [W_MACRO] [H_MACRO] [--tint=RRGGBB | --no-tint]

Output is LVGL RGB565A8, which is planar: w*h RGB565 pixels, then w*h alpha bytes (data_size = w*h*3, stride = w*2). Splice it into icons.h and load it with init_icon_dsc_rgb565a8() in ui.cpp. The default tint is white because Lucide PNGs are black on transparent and would render invisible. Only icons that overlap non-uniform backgrounds (today the battery icons) need RGB565A8; the rest are raw RGB565 baked over the panel background inside opaque zones.

Clawd animations (firmware/src/splash_animations.h)

node tools/convert_official_clawd.js                  # regenerate the header
node tools/convert_official_clawd.js --verify DIR     # + per-animation PNGs to eyeball

Needs ImageMagick. Sources are the official assets in research/clawd-official/ (Laptop and Soccer from their Lottie exports, the rest from GIFs). What the converter does (55×37 stage crops, ≤16-colour palettes, loop detection, synthesized eyes, contrast recolors) is in tools/README.md; asset provenance and format facts are in research/clawd-official/CLAUDE.md. Rebuild the firmware afterwards and check the new or changed animation in the simulator.

Clawd sprites come only from the official art: don't draw or retouch sprite frames by hand. To find new official animations, use the hunting-clawd-animations skill.

版本历史

  • 4e5c079 当前 2026-10-19 03:11

同 Skill 集合

.claude/skills/capturing-desktop-screenshots/SKILL.md
.claude/skills/capturing-device-screenshots/SKILL.md
.claude/skills/cutting-a-release/SKILL.md
.claude/skills/flashing-and-probing-boards/SKILL.md
.claude/skills/hunting-clawd-animations/SKILL.md
.claude/skills/porting-a-board/SKILL.md
.claude/skills/verifying-firmware-ui/SKILL.md

元信息

文件数
0
版本
4e5c079
Hash
d4868b44
收录时间
2026-10-19 03:11

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-26 04:51
浙ICP备14020137号-1