Skip to content

Using --width leaves margin on the right #198

@beberlei

Description

@beberlei

Describe the bug

I want to embed the images into a presentation, using placement snapping to center code images so that I can have multiple after each other without the window "hoping" around. However the generated images using a fixed width have transparent margin on the right, so that I can't center it with Powerpoint correctly.

To Reproduce

{
  "window": false,
  "width": 1600,
  "height": 900,
  "border": {
    "radius": 32,
    "width": 4,
    "color": "#515151"
  },
  "shadow": false,
  "padding": [20, 20, 20, 20],
  "margin": "0",
  "font": {
    "family": "Source Code Pro",
    "size": 48
  },
  "line_height": 1.2,
  "show_line_numbers": true
}

file:

<?php
// writes "/tmp/test.txt" into stat cache
touch("/tmp/test.txt");

// file existance is known from stat cache
if (file_exists("/tmp/test.txt")) {
}

// load something else from filesystem
$stat2 = stat("/tmp");

// not in cache anymore, load from filesystem
if (file_exists("/tmp/test.txt")) {
}

command:

freeze --config=custom.json --theme=dracula --language=php stat1.php -o stat1.png

Expected behavior

image with terminal window at 1600px width.

Screenshots

Transparent margin on the right.

Image
Image

Desktop (please complete the following information):

  • OS: MacOS
  • freeze version v0.2.2 (80921ba)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions