carbon-now-cli icon indicating copy to clipboard operation
carbon-now-cli copied to clipboard

Weird line break issues with SVG

Open graipher opened this issue 1 year ago • 2 comments

Describe the bug When saving as SVG, some lines are weirdly broken. widthAdjustment is true. The PNG version is fine. Only happens with chromium driver, not firefox.

To Reproduce Steps to reproduce the behavior:

  1. Run carbon-now with… config.json
{
  "latest-preset": {
    "theme": "material",
    "backgroundColor": "#00000000",
    "windowTheme": "none",
    "windowControls": false,
    "fontFamily": "Fira Code",
    "fontSize": "18px",
    "lineNumbers": false,
    "firstLineNumber": 1,
    "dropShadow": false,
    "dropShadowOffsetY": "20px",
    "dropShadowBlurRadius": "68px",
    "selectedLines": "*",
    "widthAdjustment": true,
    "lineHeight": "133%",
    "paddingVertical": "2px",
    "paddingHorizontal": "2px",
    "squaredImage": false,
    "watermark": false,
    "exportSize": "1x",
    "type": "svg",
    "language": "python"
  }
}

and generics.py

from typing import Generic, TypeVar

T = TypeVar("T")

def f(a: T) -> T:
	return a

class A(Generic[T]):
	a: T

carbon-now generics.py --engine chromium

  1. Wait for image to download…
  2. See error

Expected behavior SVG and PNG output should be the same. There should be no weird linebreaks that are not present in the file.

Screenshots SVG: Generics_1 PNG: Generics_1

Info (please complete the following information):

  • OS [e.g. macOS, Linux, Windows, iOS]: Linux
  • --engine used [e.g. chromium, firefox, webkit]: chromium
  • Carbon URL (run with --open-in-browser to see) [e.g. carbon.now.sh?bg=pink]: browser does not open

graipher avatar Dec 15 '23 10:12 graipher

@graipher Thank you for opening; sorry I missed this earlier last month. I’ll investigate further this weekend, but I think this is an error on Carbon’s part (not the CLI), since I remember having different outputs when implementing --engine as part of v2 and I even had to use --engine firefox for some of the screenshots of the docs.

I will report back, though; thanks for your patience! 🙂

mixn avatar Jan 09 '24 12:01 mixn

Been quite swamped since the beginning of the year, but I will tackle a new release of the CLI soon and, amongst other things, address this (somehow.) 🙂 Thanks for your patience, appreciated! @graipher

mixn avatar May 31 '24 08:05 mixn