I did find a solution for the main problem: see the end of this question.

I have a text-file which contains:

│ A♦ │ K♥ │ Q♠ │ J♣ │

I convert it with:

convert -interline-spacing 0 -size 250x100 -gravity center -fill black -font Liberation-Mono -density 96 -pointsize 12 caption:"$(<brokenLines.txt)" brokenLines.png

This works reasonably well and produces:

Table with broken vertical lines

But this has two problems:

  1. There are gaps in the vertical lines.
  2. I would like the diamond and heart to be red.

How would I implement this?

I found a solution for the first and main problem, use:

-interline-spacing -2

instead of:

-interline-spacing 0

Then I get (the above went OK on someone else's system):

Table without broken vertical lines

  • It seems to me like a general problem with how the border is created, rather than just the vertical lines. I can see gaps in the horizontal sections as well. The easy fix might be to just use a different font. I checked the font this site uses to display the text (Menlo) and then I used it to create a new image dropping out -density and it looks just as solid as it does on this site. It's not perfect, but it's pretty solid. – Joonas May 29 at 12:02
  • I just noticed the first font on this site is Consolas and Menlo is the second fallback. Thought I'd mention that to avoid confusion. Consolas looks better than your first image but not as good as Menlo. – Joonas May 29 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.