본문으로 건너뛰기
cccskills
무료GitHub에 공개

sdf-text

Work with Pulp's SDF / MSDF / PSDF glyph atlases — building, sampling via SkSL, and the shared text-layout helpers.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

SDF Text

Pulp renders text through a GPU-sampled signed-distance-field pipeline so a single atlas serves every font size with crisp edges. This skill is for when you are touching core/canvas/src/sdf_atlas.cpp, msdf_atlas.cpp, or the shader files, or when you add call-sites that consume pulp/canvas/sdf_text.hpp.

Where things live

  • core/canvas/include/pulp/canvas/sdf_atlas.hpp — single-channel atlas
  • core/canvas/include/pulp/canvas/msdf_atlas.hpp — multi-channel atlas (RGB/RGBA)
  • core/canvas/include/pulp/canvas/psdf_atlas.hpp — pseudo-SDF + vector-fallback policy
  • core/canvas/include/pulp/canvas/sdf_text.hpp — SdfPenSnap, SdfTextOptions, build_text_quads<AtlasT>(), fill_text_sdf/msdf/psdf<AtlasT>()
  • core/canvas/shaders/sdf_text.sksl — single-channel sampler
  • core/canvas/shaders/msdf_text.sksl — median(r,g,b) sampler
  • docs/reference/sdf-text.md — rendering pipeline reference
  • examples/sdf-text-demo/ — runtime SDF text rendering and bloom demo
  • examples/sdf-vs-msdf-demo/ — console SDF/MSDF atlas dump; MSDF RGB output is currently single-channel-equivalent until msdfgen is wired
  • examples/sdf-effects-demo/ — enumerates host-side effect presets and writes software-rendered baseline files; visual effects wait for the SkSL draw path

Gotchas

  1. Metrics fall back silently when Skia has no default typeface. In headless tests SdfAtlas::build("") can leave advance = base_size and bearing_y = base_size for every glyph. Write tests that assert invariants that hold in both the real and fallback paths, and tighten only when you can detect the real path was taken (gM->advance != gi->advance). See test_sdf_atlas.cpp.
  2. fwidth gives you subpixel AA for free. Do not add a second softness uniform for "anti-alias width" — snapping belongs at the pen (host side), not in the shader.
  3. include_alpha=true changes the pixel stride from 3 to 4 bytes. Use MsdfAtlas::channels() rather than assuming 3.
  4. Templated quad builder. build_text_quads<AtlasT>() only requires that the atlas expose glyph(c), base_size(), and the usual SdfGlyph-shaped fields. That means the same helper works for every atlas variant; do not branch on type.
  5. Vector fallback threshold defaults to 8×. should_use_vector_fallback is a pure policy helper; callers decide at draw time whether to hit the Skia path rasterizer instead of the SDF sampler.
  6. Always call SkFont via the SkSpan overloads. The historical (pointer, count, ...) forms of unicharsToGlyphs, textToGlyphs, getWidthsBounds, getWidths, getPos, getXPos, getPaths, and getIntercepts are gated behind SK_SUPPORT_UNSPANNED_APIS in include/core/SkFont.h. On Skia builds where that macro is not defined (including some chrome/m144 drops), the overloads vanish and sdf_atlas.cpp fails to compile. On this repo PULP_HAS_SKIA is only set when libskia.a links successfully, so the break can hide behind a headers-only pin — confirm by building pulp-canvas against a tree that ships libskia.a (e.g. SKIA_DIR=<other-worktree>/external/skia-build) so the compile path exercises real Skia libraries, not just headers.

Build + test loop

tools/ci/governed-build.sh cmake --build build --target \
  pulp-test-sdf-atlas pulp-test-msdf-atlas pulp-test-psdf-atlas \
  pulp-test-sdf-text pulp-test-sdf-effects \
  pulp-sdf-text-demo pulp-sdf-vs-msdf-demo pulp-sdf-effects-demo

./build/test/pulp-test-sdf-atlas
./build/test/pulp-test-msdf-atlas
./build/test/pulp-test-psdf-atlas
./build/test/pulp-test-sdf-text
./build/test/pulp-test-sdf-effects
./build/examples/sdf-text-demo/pulp-sdf-text-demo
./build/examples/sdf-vs-msdf-demo/pulp-sdf-vs-msdf-demo   # writes /tmp/pulp-*-atlas.{pgm,ppm}
./build/examples/sdf-effects-demo/pulp-sdf-effects-demo   # writes /tmp/pulp-sdf-effects-*.pgm

Future work (deferred, see planning/next-features-plan.md § Feature 4)

  • Vendor Chlumský's msdfgen library (MIT) for shape-decomposed channels
  • Wire SdfEffectParams through a SkSL-backed draw path so glow / shadow / outline / bevel visibly render
  • Runtime atlas growth + LRU eviction

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

aax

무료

Optional AAX support for Pulp, including developer-supplied Avid SDK setup, CMake enablement, DigiShell/AAX Validator workflows, and local AAX builds on macOS or Windows.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Generous-Corp/pulp222026년 10월 19일 업데이트

Configure, implement, and test Pulp's optional desktop Ableton Link tempo-sync adapter while preserving the developer-supplied SDK, licensing, realtime, latency-compensation, and no-install boundaries.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Generous-Corp/pulp222026년 10월 19일 업데이트

Maintain Pulp's installed design-time agent capability manifest and public-surface ledger. Use when adding, removing, renaming, or materially changing public audio, MIDI, signal, timebase, or sequence APIs; registering a new algorithm for generators; changing capability support or deprecation state; or repairing agent-capabilities freshness, schema, fingerprint, tombstone, or installed-SDK tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Generous-Corp/pulp222026년 10월 19일 업데이트

android

무료

Android platform development for Pulp — NDK cross-compilation, Oboe audio, Dawn/Skia GPU rendering, JNI bridge, touch interaction, emulator workflows, and end-to-end smoke validation. Covers build, deploy, debug, and the gotchas discovered during bringup.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Generous-Corp/pulp222026년 10월 19일 업데이트

ara

무료

Optional ARA support for Pulp, including developer-supplied ARA SDK setup, CMake enablement, adapter companion APIs, validation, and ARA-aware plugin implementation guidance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Generous-Corp/pulp222026년 10월 19일 업데이트

The measurement surface for ALL Pulp DSP and audio-pipeline work — read it BEFORE writing or gating DSP, not only when something already sounds wrong. Covers the C++ harness (signal generators, metrics, assertions, RenderScenario, contracts), the offline Audio Doctor (magnitude/frequency response, THD/THD+N, phase/group delay), and their Python sibling the Audio Quality Lab (tools/audio/quality-lab — null residual + alignment, LTAS log-spectral distance, spectral flux/centroid, HNR, Theil-Sen drift slope, Kaiser-sinc resampling, license-guarded corpus, regression-net ratchet). TRIGGER on AUTHORING work — "build/design an oscillator/filter/synth/effect", "add a DSP module", "what should the acceptance gate be", "how do I measure aliasing / anti-aliasing / alias floor", "null against a reference", "is this DSP correct", "choose a tolerance", "golden/regression corpus for audio", "measure drift or jitter", "A/B two renders" — AND on DEBUGGING work — "is there sound / no audio / I hear nothing", "does this filter/compressor/synth/delay produce the right signal", "prove the DSP / prove the contract", "measure the frequency response", "what's the THD / is it distorting", "what's the group delay / phase response / measured latency", "magnitude response curve", "render a test tone and assert", "audio regression", "64-frame works but 128 is silent", "sample-rate change pitch-shifted it", "describe what's in this buffer", "audio doctor", "compare before/after a DSP refactor". Reach for this BEFORE hand-rolling any FFT, null test, alias measurement, pitch tracker, or golden-render script — most of it already exists in one of the two lanes. Test/tool layer over HeadlessHost — deterministic, no audio device, no speakers. Off the realtime thread entirely.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Generous-Corp/pulp222026년 10월 19일 업데이트

Generous-Corp의 스킬 모두 보기

이 스킬의 문제 신고