2017-06-11 6 views
0

キャプションを作成するのに次のコマンドを使用しています。しかし、私は行間の間隔もコントロールしたい。値を負に設定すると(行を互いに近づけるために)、最初の行は大文字を切り捨てます。私は "境界"を追加しようとしましたが、境界を追加するだけです - "パディング"を追加しません。 「パディング」を追加する方法はありますか?ImageMagick:キャプション付きの行間がカットオフを作成

convert templates/input.pdf -font test.ttf 
-size 1245x283! -background red -fill white -gravity northwest 
-interline-spacing -25 
caption:"Interline-Spacing NOT WORKING\r\nwith Captions" 
-geometry +129+129 -composite output/temp.png 

enter image description here

答えて

0

私はインターライン間隔がテキストまでのベースラインからですよね。下の文字はベースラインの下に突出しています。私はそれがもっと "行の高さ"だと思います。

明らかな解決方法は、大文字を許可するか、大文字を使用しないように間隔を広げることです。

-15の設定は、あなたがしていることに対して機能するようです。

0

ImageMagickでは、テキストを囲む余分な部分を取り除きたい場合は、-graderity centerを設定してから、-trim + repageを使用して、必要なことがわかっている場合は-borderまたは-extentを使用して境界線を追加します出力サイズ。その後、西の前に-gravityを使用し、必要であれば

convert (-size 2115x560 xc:skyblue) (-size 1245x283! -background red -fill white -gravity center -font arial -interline-spacing -25 caption:"Interline-Spacing NOT WORKING\r\nwith Captions" -trim +repage -background red -extent 1245x283!) -gravity northwest -geometry +129+129 -composite temp.png 

enter image description here

が白いテキストが左揃え - :Windowsで

convert \(-size 2115x560 xc:skyblue \) \(-size 1245x283! -background red -fill white -gravity center -font arial -interline-spacing -25 caption:"Interline-Spacing NOT WORKING\r\nwith Captions" -trim +repage -background red -extent 1245x283! \) -gravity northwest -geometry +129+129 -composite temp.png 

またはこの:

は、この使用して、UNIXの構文をお試しくださいエクステンションと重力の西の字幕:

convert \(-size 2115x560 xc:skyblue \) \(-size 1245x283! -background red -fill white -gravity west -font arial -interline-spacing -25 caption:"Interline-Spacing NOT WORKING\r\nwith Captions" -trim +repage -background red -gravity west -extent 1245x283! \) -gravity northwest -geometry +129+129 -composite temp2.png 
012スカイブルーと鉱山用フォント:

enter image description here

は私-sizeの2115x560のXCの代わりに、あなたの入力画像を交換してください。

関連する問題