paulrosen / abcjs

javascript for rendering abc music notation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Revisiting server-side rendering SVG

UlyssesZh opened this issue · comments

This was discussed in #742 and #578 (but probably other issues). From the issue comments by @paulrosen, I see the main difficulty is calculating text size without DOM. I can think of several ways:

  • Actually introduce DOM by using jsdom or other similar libraries.
  • Let the user input all necessary font information (font face, size, weight, etc) and use canvas to calculate the font size.
  • Just do not support contents depending on text sizes. Like katex, provide an official CSS file that guarantees to work with the output SVG.