mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.57k stars 6.48k forks source link

[Bug] Cannot change font in SVG preview #3033

Open ClSlaid opened 2 years ago

ClSlaid commented 2 years ago

Describe the bug Changing the font in the live editor is impossible, users can only adjust font size. 图片 图片

To Reproduce Link to Live Editor: https://mermaid.live/edit#pako:eNqdVFFr01AY_SuX-6QYC6v0pQ8DSTeESRmmCGJ8uEu-tBeSe-PN7bSWgvikttPBEBHm5oShIGz6ouCK_hmT9c2_4E1uOrPazGkeUjjfuef7zndP08cOdwHXcQR3u8AcaFDSFiSwGVJPSISkDg0Jk8j0KTD5J26BWAehcQGORKK9dqFaqxmoeqWavS7qYpNLQIK2OxJxL5ero3j8MH43RC1zFSXP95InQ03W5cuLi1q-bt1q6gJxJF0nSqk4jyYpdq6q2JeumiszJ4qTujBXaLbtiUiBX5QB5s46V6ZT93_zrQxrv8dHW8nr3Z_jUbw5Sl5-1vuIj74efxi2rluT7zvJs_35w-UAuga-z_9hOzmgzxnIBHWZHnXUMSMvrUBv6b7TIax9AmXkBmdQovk_cMklzN10iflTk5rZr0nDDggrBMdAy5TRqANuicaZcMmVn2_FpxuXGJ2fnvx_U6sV8-ODl8VnOqKKBtLZ0FFJ85MlJ3nxMdk4-DF-M_m2VWKv0bRQsrs_OXw7OfySfHp0hq-5vZPtjfjpXvzqvRapVColS_jdKA35zvb5lpH15GlAddmY9o0PRsnjzYKqzfSJ6YMNHIAICHXVB62f1mwsOxCAjdWlYo8LiKSNjULlJhGUrPkQpZS-lkuZTC6TgPq9FL497WLjFg0gQk24h27wgLBcS9cs3hVOlhXqoVXBbaxrd4yirEUf5OMsLIRScwY2G6jZu6GrlrLkUskFrnvEj8DApCu51WMOrkvRhSkp_0prcPALLpAOYA

Steps to reproduce the behavior:

  1. Write something
  2. Change the configurations, adjust themeVariables.fontFamily
  3. See error

Expected behavior Fonts in SVG changed to Times New Roman and Source Serif Pro instead of froze.

Screenshots as is shown above

Desktop (please complete the following information):

Additional context More documentation such as how to configure fonts should be presented to users

sidharthv96 commented 2 years ago

Similar to https://github.com/mermaid-js/mermaid/issues/3032, font is applied to some diagram types (graph, class) but not others.