{"id":"e99c7473-77c1-42d9-8dd6-f1ce0bea0632","shortId":"FXGpEF","kind":"skill","title":"makepad-font","tagline":"CRITICAL: Use for Makepad font and text rendering. Triggers on:\nmakepad font, makepad text, makepad glyph, makepad typography,\nfont atlas, text layout, font family, font size, text shaping,\nmakepad 字体, makepad 文字, makepad 排版, makepad 字形","description":"# Makepad Font Skill\n\n> **Version:** makepad-widgets (dev branch) | **Last Updated:** 2026-01-19\n>\n> Check for updates: https://crates.io/crates/makepad-widgets\n\nYou are an expert at Makepad text and font rendering. Help users by:\n- **Font configuration**: Font families, sizes, styles\n- **Text layout**: Understanding text layouter and shaping\n- **Text rendering**: GPU-based text rendering with SDF\n\n## Documentation\n\nRefer to the local files for detailed documentation:\n- `./references/font-system.md` - Font module structure and APIs\n\n## IMPORTANT: Documentation Completeness Check\n\n**Before answering questions, Claude MUST:**\n\n1. Read the relevant reference file(s) listed above\n2. If file read fails or file is empty:\n   - Inform user: \"本地文档不完整，建议运行 `/sync-crate-skills makepad --force` 更新文档\"\n   - Still answer based on SKILL.md patterns + built-in knowledge\n3. If reference file exists, incorporate its content into the answer\n\n## Text Module Structure\n\n```\ndraw/src/text/\n├── font.rs           # Font handle and metrics\n├── font_atlas.rs     # GPU texture atlas for glyphs\n├── font_face.rs      # Font face data\n├── font_family.rs    # Font family management\n├── fonts.rs          # Built-in fonts\n├── glyph_outline.rs  # Glyph vector outlines\n├── glyph_raster_image.rs # Rasterized glyph images\n├── layouter.rs       # Text layout engine\n├── rasterizer.rs     # Glyph rasterization\n├── sdfer.rs          # Signed distance field generator\n├── selection.rs      # Text selection/cursor\n├── shaper.rs         # Text shaping (harfbuzz)\n```\n\n## Using Fonts in DSL\n\n### Text Style\n\n```rust\n<Label> {\n    text: \"Hello World\"\n    draw_text: {\n        text_style: {\n            font: { path: dep(\"crate://self/resources/fonts/MyFont.ttf\") }\n            font_size: 16.0\n            line_spacing: 1.5\n            letter_spacing: 0.0\n        }\n        color: #FFFFFF\n    }\n}\n```\n\n### Theme Fonts\n\n```rust\n<Label> {\n    text: \"Styled Text\"\n    draw_text: {\n        text_style: <THEME_FONT_REGULAR> {\n            font_size: (THEME_FONT_SIZE_P)\n        }\n    }\n}\n```\n\n## Font Definition in DSL\n\n```rust\nlive_design! {\n    // Define font path\n    FONT_REGULAR = {\n        font: { path: dep(\"crate://self/resources/fonts/Regular.ttf\") }\n    }\n\n    FONT_BOLD = {\n        font: { path: dep(\"crate://self/resources/fonts/Bold.ttf\") }\n    }\n\n    // Use in widget\n    <Label> {\n        draw_text: {\n            text_style: <FONT_REGULAR> {\n                font_size: 14.0\n            }\n        }\n    }\n}\n```\n\n## Layouter API\n\n```rust\npub struct Layouter {\n    loader: Loader,\n    cache_size: usize,\n    cached_params: VecDeque<OwnedLayoutParams>,\n    cached_results: HashMap<OwnedLayoutParams, Rc<LaidoutText>>,\n}\n\nimpl Layouter {\n    pub fn new(settings: Settings) -> Self;\n    pub fn rasterizer(&self) -> &Rc<RefCell<Rasterizer>>;\n    pub fn is_font_family_known(&self, id: FontFamilyId) -> bool;\n    pub fn define_font_family(&mut self, id: FontFamilyId, definition: FontFamilyDefinition);\n    pub fn define_font(&mut self, id: FontId, definition: FontDefinition);\n    pub fn get_or_layout(&mut self, params: impl LayoutParams) -> Rc<LaidoutText>;\n}\n```\n\n## Layout Parameters\n\n```rust\npub struct OwnedLayoutParams {\n    pub text: Substr,\n    pub spans: Box<[Span]>,\n    pub options: LayoutOptions,\n}\n\npub struct Span {\n    pub style: Style,\n    pub len: usize,\n}\n\npub struct Style {\n    pub font_family_id: FontFamilyId,\n    pub font_size_in_pts: f32,\n    pub color: Option<Color>,\n}\n\npub struct LayoutOptions {\n    pub max_width_in_lpxs: Option<f32>,  // Max width for wrapping\n    pub wrap: bool,                       // Enable word wrap\n    pub first_row_indent_in_lpxs: f32,    // First line indent\n}\n```\n\n## Rasterizer Settings\n\n```rust\npub struct Settings {\n    pub loader: loader::Settings,\n    pub cache_size: usize,  // Default: 4096\n}\n\npub struct rasterizer::Settings {\n    pub sdfer: sdfer::Settings {\n        padding: 4,     // SDF padding\n        radius: 8.0,    // SDF radius\n        cutoff: 0.25,   // SDF cutoff\n    },\n    pub grayscale_atlas_size: Size::new(4096, 4096),\n    pub color_atlas_size: Size::new(2048, 2048),\n}\n```\n\n## DrawText Widget\n\n```rust\n<View> {\n    // Label is a simple text widget\n    <Label> {\n        text: \"Simple Label\"\n        draw_text: {\n            color: #FFFFFF\n            text_style: {\n                font_size: 14.0\n            }\n        }\n    }\n\n    // TextFlow for rich text\n    <TextFlow> {\n        <Bold> { text: \"Bold text\" }\n        <Italic> { text: \"Italic text\" }\n        <Link> {\n            text: \"Click here\"\n            href: \"https://example.com\"\n        }\n    }\n}\n```\n\n## Text Properties\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `text` | String | Text content |\n| `font` | Font | Font resource |\n| `font_size` | f64 | Size in points |\n| `line_spacing` | f64 | Line height multiplier |\n| `letter_spacing` | f64 | Character spacing |\n| `color` | Vec4 | Text color |\n| `brightness` | f64 | Text brightness |\n| `curve` | f64 | Text curve effect |\n\n## When Answering Questions\n\n1. Makepad uses SDF (Signed Distance Field) for crisp text at any scale\n2. Fonts are loaded once and cached in GPU texture atlases\n3. Text shaping uses harfbuzz for proper glyph positioning\n4. Use `dep(\"crate://...\")` for embedded font resources\n5. Default font cache size is 4096 glyphs\n6. Atlas sizes: 4096x4096 for grayscale, 2048x2048 for color (emoji)\n\n\n## When to Use\nUse this skill when tackling tasks related to its primary domain or functionality as described above.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["makepad","font","antigravity","awesome","skills","sickn33","agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows"],"capabilities":["skill","source-sickn33","skill-makepad-font","topic-agent-skills","topic-agentic-skills","topic-ai-agent-skills","topic-ai-agents","topic-ai-coding","topic-ai-workflows","topic-antigravity","topic-antigravity-skills","topic-claude-code","topic-claude-code-skills","topic-codex-cli","topic-codex-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/makepad-font","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add sickn33/antigravity-awesome-skills","source_repo":"https://github.com/sickn33/antigravity-awesome-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 34726 github stars · SKILL.md body (5,854 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-23T12:51:12.589Z","embedding":null,"createdAt":"2026-04-18T21:40:25.037Z","updatedAt":"2026-04-23T12:51:12.589Z","lastSeenAt":"2026-04-23T12:51:12.589Z","tsv":"'-01':52 '-19':53 '/crates/makepad-widgets':59 '/references/font-system.md':104 '/sync-crate-skills':141 '0.0':247 '0.25':477 '1':119,578 '1.5':244 '14.0':297,516 '16.0':241 '2':128,591 '2026':51 '2048':494,495 '2048x2048':632 '3':155,602 '4':469,611 '4096':459,486,487,624 '4096x4096':629 '5':618 '6':626 '8.0':473 'answer':115,146,165,576 'api':109,299 'ask':688 'atlas':23,178,482,490,601,627 'base':90,147 'bold':283,522 'bool':340,430 'boundari':696 'box':384 'branch':48 'bright':566,569 'built':152,191 'built-in':151,190 'cach':306,309,312,455,597,621 'charact':560 'check':54,113 'clarif':690 'claud':117 'clear':663 'click':528 'color':248,413,489,510,562,565,634 'complet':112 'configur':74 'content':162,540 'crates.io':58 'crates.io/crates/makepad-widgets':57 'crisp':586 'criteria':699 'critic':4 'curv':570,573 'cutoff':476,479 'data':184 'default':458,619 'defin':273,343,354 'definit':267,350,360 'dep':237,280,286,613 'describ':653,667 'descript':536 'design':272 'detail':102 'dev':47 'distanc':211,583 'document':95,103,111 'domain':649 'draw':231,256,291,508 'draw/src/text':169 'drawtext':496 'dsl':224,269 'effect':574 'embed':615 'emoji':635 'empti':136 'enabl':431 'engin':205 'environ':679 'environment-specif':678 'example.com':531 'exist':159 'expert':63,684 'f32':411,440 'f64':547,553,559,567,571 'face':183 'fail':132 'famili':27,76,187,335,345,403 'ffffff':249,511 'field':212,584 'file':100,124,130,134,158 'first':435,441 'fn':320,326,332,342,353,363 'font':3,8,15,22,26,28,41,68,73,75,105,171,182,186,193,222,235,239,251,260,263,266,274,276,278,282,284,295,334,344,355,402,407,514,541,542,543,545,592,616,620 'font.rs':170 'font_atlas.rs':175 'font_face.rs':181 'font_family.rs':185 'fontdefinit':361 'fontfamilydefinit':351 'fontfamilyid':339,349,405 'fontid':359 'fonts.rs':189 'forc':143 'function':651 'generat':213 'get':364 'glyph':19,180,195,200,207,609,625 'glyph_outline.rs':194 'glyph_raster_image.rs':198 'gpu':89,176,599 'gpu-bas':88 'grayscal':481,631 'handl':172 'harfbuzz':220,606 'hashmap':314 'height':555 'hello':229 'help':70 'href':530 'id':338,348,358,404 'imag':201 'impl':317,370 'import':110 'incorpor':160 'indent':437,443 'inform':137 'input':693 'ital':525 'knowledg':154 'known':336 'label':499,507 'last':49 'layout':25,80,83,204,298,303,318,366,373 'layouter.rs':202 'layoutopt':388,417 'layoutparam':371 'len':396 'letter':245,557 'limit':655 'line':242,442,551,554 'list':126 'live':271 'load':594 'loader':304,305,451,452 'local':99 'lpxs':422,439 'makepad':2,7,14,16,18,20,32,34,36,38,40,45,65,142,579 'makepad-font':1 'makepad-widget':44 'manag':188 'match':664 'max':419,424 'metric':174 'miss':701 'modul':106,167 'multipli':556 'must':118 'mut':346,356,367 'new':321,485,493 'option':387,414,423 'outlin':197 'output':673 'ownedlayoutparam':315,378 'p':265 'pad':468,471 'param':310,369 'paramet':374 'path':236,275,279,285 'pattern':150 'permiss':694 'point':550 'posit':610 'primari':648 'proper':608 'properti':533,534 'pts':410 'pub':301,319,325,331,341,352,362,376,379,382,386,389,392,395,398,401,406,412,415,418,428,434,447,450,454,460,464,480,488 'question':116,577 'radius':472,475 'raster':199,208,327,444,462 'rasterizer.rs':206 'rc':316,329,372 'read':120,131 'refcel':330 'refer':96,123,157 'regular':277 'relat':645 'relev':122 'render':11,69,87,92 'requir':692 'resourc':544,617 'result':313 'review':685 'rich':519 'row':436 'rust':227,252,270,300,375,446,498 'safeti':695 'scale':590 'scope':666 'sdf':94,470,474,478,581 'sdfer':465,466 'sdfer.rs':209 'selection.rs':214 'selection/cursor':216 'self':324,328,337,347,357,368 'self/resources/fonts/bold.ttf':287 'self/resources/fonts/myfont.ttf':238 'self/resources/fonts/regular.ttf':281 'set':322,323,445,449,453,463,467 'shape':31,85,219,604 'shaper.rs':217 'sign':210,582 'simpl':502,506 'size':29,77,240,261,264,296,307,408,456,483,484,491,492,515,546,548,622,628 'skill':42,641,658 'skill-makepad-font' 'skill.md':149 'source-sickn33' 'space':243,246,552,558,561 'span':383,385,391 'specif':680 'still':145 'stop':686 'string':538 'struct':302,377,390,399,416,448,461 'structur':107,168 'style':78,226,234,254,259,294,393,394,400,513 'substitut':676 'substr':381 'success':698 'tackl':643 'task':644,662 'test':682 'text':10,17,24,30,66,79,82,86,91,166,203,215,218,225,228,232,233,253,255,257,258,292,293,380,503,505,509,512,520,521,523,524,526,527,532,537,539,564,568,572,587,603 'textflow':517 'textur':177,600 'theme':250,262 'topic-agent-skills' 'topic-agentic-skills' 'topic-ai-agent-skills' 'topic-ai-agents' 'topic-ai-coding' 'topic-ai-workflows' 'topic-antigravity' 'topic-antigravity-skills' 'topic-claude-code' 'topic-claude-code-skills' 'topic-codex-cli' 'topic-codex-skills' 'treat':671 'trigger':12 'type':535 'typographi':21 'understand':81 'updat':50,56 'use':5,221,288,580,605,612,638,639,656 'user':71,138 'usiz':308,397,457 'valid':681 'vec4':563 'vecdequ':311 'vector':196 'version':43 'widget':46,290,497,504 'width':420,425 'word':432 'world':230 'wrap':427,429,433 '字体':33 '字形':39 '建议运行':140 '排版':37 '文字':35 '更新文档':144 '本地文档不完整':139","prices":[{"id":"c38f7124-8af8-4dd0-8938-46332f569ba4","listingId":"e99c7473-77c1-42d9-8dd6-f1ce0bea0632","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T21:40:25.037Z"}],"sources":[{"listingId":"e99c7473-77c1-42d9-8dd6-f1ce0bea0632","source":"github","sourceId":"sickn33/antigravity-awesome-skills/makepad-font","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/makepad-font","isPrimary":false,"firstSeenAt":"2026-04-18T21:40:25.037Z","lastSeenAt":"2026-04-23T12:51:12.589Z"}],"details":{"listingId":"e99c7473-77c1-42d9-8dd6-f1ce0bea0632","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"makepad-font","github":{"repo":"sickn33/antigravity-awesome-skills","stars":34726,"topics":["agent-skills","agentic-skills","ai-agent-skills","ai-agents","ai-coding","ai-workflows","antigravity","antigravity-skills","claude-code","claude-code-skills","codex-cli","codex-skills","cursor","cursor-skills","developer-tools","gemini-cli","gemini-skills","kiro","mcp","skill-library"],"license":"mit","html_url":"https://github.com/sickn33/antigravity-awesome-skills","pushed_at":"2026-04-23T06:41:03Z","description":"Installable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.","skill_md_sha":"b9c09c3f46a038674c4da5d5942a12ce75e7822e","skill_md_path":"skills/makepad-font/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/makepad-font"},"layout":"multi","source":"github","category":"antigravity-awesome-skills","frontmatter":{"name":"makepad-font","description":"CRITICAL: Use for Makepad font and text rendering. Triggers on:\nmakepad font, makepad text, makepad glyph, makepad typography,\nfont atlas, text layout, font family, font size, text shaping,\nmakepad 字体, makepad 文字, makepad 排版, makepad 字形"},"skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/makepad-font"},"updatedAt":"2026-04-23T12:51:12.589Z"}}