* src/macfont.m (mac_font_shape): Make sure that total_advance is increasing.
This commit is contained in:
parent
8dc4626a0b
commit
bfeda891a5
1 changed files with 6 additions and 4 deletions
|
@ -3767,6 +3767,7 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
|
|||
{
|
||||
struct mac_glyph_layout *gl;
|
||||
CGPoint position;
|
||||
CGFloat max_x;
|
||||
|
||||
if (!RIGHT_TO_LEFT_P)
|
||||
gl = glbuf + range.location;
|
||||
|
@ -3788,12 +3789,13 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
|
|||
CTRunGetGlyphs (ctrun, range, &gl->glyph_id);
|
||||
|
||||
CTRunGetPositions (ctrun, range, &position);
|
||||
max_x = position.x + CTRunGetTypographicBounds (ctrun, range,
|
||||
NULL, NULL, NULL);
|
||||
max_x = max (max_x, total_advance);
|
||||
gl->advance_delta = position.x - total_advance;
|
||||
gl->baseline_delta = position.y;
|
||||
gl->advance = (gl->advance_delta
|
||||
+ CTRunGetTypographicBounds (ctrun, range,
|
||||
NULL, NULL, NULL));
|
||||
total_advance += gl->advance;
|
||||
gl->advance = max_x - total_advance;
|
||||
total_advance = max_x;
|
||||
}
|
||||
|
||||
if (RIGHT_TO_LEFT_P)
|
||||
|
|
Loading…
Add table
Reference in a new issue