diff options
author | Mark Plomer <mail@mark-plomer.de> | 2016-04-03 11:52:59 +0200 |
---|---|---|
committer | Mark Plomer <mail@mark-plomer.de> | 2016-04-03 12:11:26 +0200 |
commit | f5f94d9c089cb670e9c119fff4102af1ffc7fbe5 (patch) | |
tree | bee5ea5bc7992aba6c3657f3a4fef67165c97baa /ext/pcre/php_pcre.c | |
parent | 9f25f736ed50a2dc94aeff4f289c1a5e26fc6a40 (diff) | |
download | php-git-f5f94d9c089cb670e9c119fff4102af1ffc7fbe5.tar.gz |
fix left-shifted/misaligned bounding-box + wrong kerning in imagettfbbox/imageftbbox
- load glyph with FT_LOAD_IGNORE_TRANSFORM for bbox as final bbox is rotated at once later (fixes "double-rotation" per glyph for calculating bbox)
- reload the rotated glyph for painting after that (only if angle != 0)
- rotate the original bbox at 0,0 and do not throw away xMin/yMin (drawing-rotation is also based at "origin" point - including the bearingX, see http://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html#section-3) - this fixes the "left-shift"-problem also when angle = 0
- removed "xb/yb" and use "x/y" directly for offsetting brect (no need for adding "x1/y1" and substracting "yd" later)
- removed therefore unused "yd" helper var which seems tried to fix parts of the original problems
- initialize x/y with 0 instead of -1 in php_imagettftext_common() to make image*text() and image*bbox() results identical (there was a -1px shift in image*bbox() before)
- fixed gdroundupdown() for negative numbers (-256 / 64 gives -5 instead of -4 before)
- rotate kerning-delta by given angle (fixes completely wrong kerning and therefore wrong bounding box if angle != 0)
- changed 3 tests and added a new one to test for the new (better) coordinates
Diffstat (limited to 'ext/pcre/php_pcre.c')
0 files changed, 0 insertions, 0 deletions