Skip to content

render: replay equations in native Skia PNG output#626

Open
seo-rii wants to merge 3 commits intoedwardkim:develfrom
seo-rii:render-p5
Open

render: replay equations in native Skia PNG output#626
seo-rii wants to merge 3 commits intoedwardkim:develfrom
seo-rii:render-p5

Conversation

@seo-rii
Copy link
Copy Markdown
Contributor

@seo-rii seo-rii commented May 6, 2026

변경 요약

이번 PR은 P4에서 들어간 native Skia PNG 렌더링 경로에 수식 replay를 추가합니다.

P4까지는 PaintOp::Equation이 native Skia 경로에서 placeholder 박스로만 그려졌는데, 이 PR에서는 기존 equation layout tree(EquationNode.layout_box)를 Skia canvas에 직접 replay하도록 바꿉니다. 그래서 render_page_png_nativeexport-png처럼 native Skia PNG 경로를 타는 출력에서 수식이 빈 박스처럼 빠지지 않습니다.

구현 범위는 일부러 좁게 잡았습니다.

  • src/renderer/skia/equation_conv.rs를 추가해서 equation layout node를 Skia draw call로 변환합니다.
  • fraction, atop, sqrt, superscript/subscript, matrix, limit, bracket/paren, decoration, font style 등 현재 equation layout tree가 표현하는 주요 노드를 replay합니다.
  • PaintOp::Equation 처리에서 EquationNode.layout_box를 사용하고, bbox 폭 차이가 있을 때는 x축 scale로 맞춥니다.
  • 수식 색상과 기본 font size를 native Skia 출력에 반영합니다.
  • README에는 P5가 “native Skia equation replay” 단계라는 점과 아직 raw-svg/form/native CanvasKit replay는 후속이라는 점을 명시했습니다.

#599에서 export-png와 VLM/Vision 쪽 사용 흐름이 들어왔기 때문에, 이 PR은 그 PNG 출력 품질을 바로 보강하는 성격입니다. 다만 #613 같은 VLM preset 확장이나 #614 DPI metadata는 이 PR 범위에 넣지 않습니다.

관련 이슈

테스트

  • cargo test --features native-skia skia --lib 통과
  • cargo clippy --features native-skia --lib -- -D warnings 통과
  • cargo clippy -- -D warnings 통과
  • cargo check --target wasm32-unknown-unknown --lib 통과
  • cargo test 통과

스크린샷

없음.

이 PR은 native Skia raster backend 내부 replay 보강이고, 테스트는 수식이 placeholder가 아니라 실제 colored ink로 렌더링되는지 확인하는 방식으로 추가했습니다.

@seo-rii seo-rii marked this pull request as ready for review May 6, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant