Gravity Center not centered with text

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Sardoan
Posts: 10
Joined: 2017-10-17T10:57:05-07:00
Authentication code: 1151

Gravity Center not centered with text

Post by Sardoan »

Gravity center does not center correctly for all letters. With trim it cuts off letters:
Image
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gravity Center not centered with text

Post by snibgo »

Please state your IM version and platform.

If you don't show your code, the problem cannot be reproduced, so it won't be fixed.

Also say where your font came from.
snibgo's IM pages: im.snibgo.com
Sardoan
Posts: 10
Joined: 2017-10-17T10:57:05-07:00
Authentication code: 1151

Re: Gravity Center not centered with text

Post by Sardoan »

Version:
Version: ImageMagick 6.8.9-9 Q16 x86_64

OS:
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Fonts:
https://fonts.google.com/specimen/Roboto https://fonts.google.com/specimen/Open+Sans

Code: (Fragment from elixir with the options)
System.cmd "convert", [
"-density", "144",
"-size", "960x960",
"-background", "...",
"-fill", "...",
"-font", "Open-Sans",
"-gravity", "Center",
"label: MR",
"-resample", "72",
"-trim"
]
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Gravity Center not centered with text

Post by snibgo »

The image has a black border. So that code did not make that image.
snibgo's IM pages: im.snibgo.com
Sardoan
Posts: 10
Joined: 2017-10-17T10:57:05-07:00
Authentication code: 1151

Re: Gravity Center not centered with text

Post by Sardoan »

The code made the image. It is a screenshot from my virtual machine. Its the view from the atom-editor. Left the black border to show where the image ends. Made the screenshot with windows having my virtual machine open. Sorry for the confusion. The image rendered with ImageMagick is the picture with the red background.

The picture gets generated during a test, where I put a sleep. After the test the picture gets deleted, so screenshot was the fastest way. If you need the created picture I can upload it while the test is in sleep.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Gravity Center not centered with text

Post by fmw42 »

Please do not post the same question to multiple forums. You have the same posted to the User's forum. See response there.
Post Reply