wader / ansisvg

Convert ANSI to SVG
MIT License
89 stars 9 forks source link

svgscreen rewrite #23

Closed patrislav1 closed 9 months ago

patrislav1 commented 9 months ago

Work in progress

:white_check_mark: Replace background rects with full block characters :white_check_mark: Get rid of explicit X coordinates for character positioning :white_check_mark: Consolidate consecutive tspans with same style (for smaller/cleaner SVG file) :white_check_mark: Support for bold, italic, underline, strikethrough :grimacing: Not sure if all relevant fonts support full block U+2588 (█) :grimacing: Copy/paste of background blocks "suppressed" by putting them on top of the SVG; not sure if there's a better way :x: Still needs guesswork for font width (charboxsize); by default the svg canvas is too narrow (see testdata/*.ansi.svg) :x: tspan consolidation sometimes un-monospaces the font when there's a ligature (see ff in ansitosvg/testdata/fq.ansi.svg). Maybe there's a CSS flag to fix that?

wader commented 9 months ago

Bold/intensive issue was red-herring and current behaviour is probably not correct (iterm2 behaviour). So let's merge!

wader commented 9 months ago

Thanks a lot for working on this! and sorry for all the back and forth

patrislav1 commented 9 months ago

Thanks a lot for working on this! and sorry for all the back and forth

No worries, I learned a lot in the process!

wader commented 9 months ago

👍 Looking forward to future PRs! hopefully i will get to rewrite the tests and add proper font test during next week