Skip to content

Implement dynamic SVG exporter - #1517

Closed
Myriad-Dreamin wants to merge 3 commits into
typst:mainfrom
Myriad-Dreamin:svg
Closed

Myriad-Dreamin wants to merge 3 commits into
typst:mainfrom
Myriad-Dreamin:svg

Conversation

@Myriad-Dreamin

@Myriad-Dreamin Myriad-Dreamin commented Jun 17, 2023 •

Copy link
Copy Markdown
Contributor

Feature covered:

  • export as plain SVG by typst::export::render_svg.
  • export as SVG wrapped with HTML by typst::export::render_svg_html.
    • You can interact with text selections and links.

There are other internal features but still get hiden in current commit (disabled by feature flag).

Correctness:

  • All integration tests have been passed.
  • Run benchmark and got results:
bench_render_pdf
  Instructions:            15690806 (-0.019664%)
  L1 Accesses:             20205673 (-0.022721%)
  L2 Accesses:                46333 (-0.344138%)
  RAM Accesses:                9774 (+0.010232%)
  Estimated Cycles:        20779428 (-0.025774%)

bench_render
  Instructions:            12200484 (+0.000836%)
  L1 Accesses:             16221159 (+0.001245%)
  L2 Accesses:                 3591 (-1.183269%)
  RAM Accesses:               24025 (-0.012485%)
  Estimated Cycles:        17079989 (-0.000691%)

bench_render_svg
  Instructions:             9464878 (-0.000592%)
  L1 Accesses:             12571039 (-0.000851%)
  L2 Accesses:                22822 (+0.144807%)
  RAM Accesses:                5647 (-0.194415%)
  Estimated Cycles:        12882794 (-0.002538%)

bench_render_svg_html
  Instructions:             9613776 (-0.002070%)
  L1 Accesses:             12770932 (-0.004283%)
  L2 Accesses:                24201 (+0.236083%)
  RAM Accesses:                6299 (-0.426810%)
  Estimated Cycles:        13112402 (-0.009204%)

@laurmaedje

laurmaedje commented Jul 5, 2023 •

Copy link
Copy Markdown
Member

I'm going to close this based on the discussion on Discord. My initial response from Discord for posterity:

I think plain SVG export would be valuable, but I would not want to merge the dynamic features, duplicated geometry primitives, etc. My gut feeling tells me that SVG export would probably fit into a single src/export/svg.rs file and would require almost no changes to other files.

Plain SVG export (from scratch or based on this) could then be implemented in a new PR.

@laurmaedje laurmaedje closed this Jul 5, 2023
@laurmaedje laurmaedje changed the title Implement SVG exporter Implement dynamic SVG exporter Jul 5, 2023
@Enter-tainer Enter-tainer mentioned this pull request Jul 16, 2023
5 tasks done
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.

2 participants