Page 1 of 1
Text: first line, accent issue
Posted: 2017-05-09T14:07:42-07:00
by Kree
Hello guys! I try to create a picture from a text, my command similar like this:
Code: Select all
convert -font Turnpike -pointsize 72 label:"ÖÜÓÚÉÁ\nÖÜÓÚÉÁ" text.png
As you can see, I try to use the
Turnpike font, what have accent characters, and they are only visible in the second line, but not in the first:
Which parameter can modify the first line's white space? The -interline-spacing works only between the lines.
Thanks in advance!
Re: Text: first line, accent issue
Posted: 2017-05-09T14:30:43-07:00
by dlemstra
What is your os and version of IM?
Re: Text: first line, accent issue
Posted: 2017-05-09T16:12:23-07:00
by fmw42
I suspect that your font glyphs for that font are not accurately representing the accented symbols. I tried on IM 6.9.8.4 Q16 and they do not work. Whereas arial font works fine.
Re: Text: first line, accent issue
Posted: 2017-05-09T16:39:12-07:00
by snibgo
Of course, you can put a \n at the start. At the end, -trim and add a border, if you want.
Code: Select all
convert -font Turnpike -pointsize 72 label:"\nÖÜÓÚÉÁ\nÖÜÓÚÉÁ" -trim -bordercolor White -border 10 text.png
EDIT: In the example, I forgot to put \n at the start.
Re: Text: first line, accent issue
Posted: 2017-05-09T17:25:06-07:00
by GeeMack
Kree wrote: ↑2017-05-09T14:07:42-07:00As you can see, I try to use the
Turnpike font, what have accent characters, and they are only visible in the second line, but not in the first: [...] Which parameter can modify the first line's white space? The -interline-spacing works only between the lines.
This is going to be an issue with maybe 20% or more of fonts. I ran a quick loop in a directory of monospace fonts I use for labeling scientific images like weather maps and satellite images. Using IM v7.0.5-5 on Windows 10 and a command like this to generate the labels...
Code: Select all
magick -pointsize 48 -font "%FONT%" label:"Å" -gravity center -background #808080 -extent 48x72 test.png
... then assembling them into a montage to create this sampler...
... you can see that a random sampling of fonts will display this problem with a substantial percentage of them. The proportion seems to be similar even with fonts that aren't monospace when I run the loop in a directory with hundreds of fairly common Windows fonts.
I just accept that IM won't print the entire character, so I've developed work-arounds like adding a newline "\n" at the beginning of the label, then trimming and bordering as necessary to get my required size, something like
snibgo mentioned above. Another method I use in some scripts is to create the label with white characters on white, then use "-annotate" and "-gravity southwest" to apply black characters to that white label. I've also created the white on white label with one pointsize, then reduced the pointsize before using "-annotate" to print black characters on the label.
None of these "fixes" is ideal, but the issue has come up in the "Bugs" forum, and apparently it isn't something that can be easily fixed in the source code.
Re: Text: first line, accent issue
Posted: 2017-05-13T12:27:41-07:00
by Kree
Thank you guys! This \n beginning and -trim works like a charm! Because of the problem is with the font itself, this hacking is a good solution for me! Thanks again!