diff options
| -rw-r--r-- | src/macfont.m | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/macfont.m b/src/macfont.m index 4e4daba0707..c799100c855 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -3767,6 +3767,7 @@ mac_font_shape (CTFontRef font, CFStringRef string, | |||
| 3767 | { | 3767 | { |
| 3768 | struct mac_glyph_layout *gl; | 3768 | struct mac_glyph_layout *gl; |
| 3769 | CGPoint position; | 3769 | CGPoint position; |
| 3770 | CGFloat max_x; | ||
| 3770 | 3771 | ||
| 3771 | if (!RIGHT_TO_LEFT_P) | 3772 | if (!RIGHT_TO_LEFT_P) |
| 3772 | gl = glbuf + range.location; | 3773 | gl = glbuf + range.location; |
| @@ -3788,12 +3789,13 @@ mac_font_shape (CTFontRef font, CFStringRef string, | |||
| 3788 | CTRunGetGlyphs (ctrun, range, &gl->glyph_id); | 3789 | CTRunGetGlyphs (ctrun, range, &gl->glyph_id); |
| 3789 | 3790 | ||
| 3790 | CTRunGetPositions (ctrun, range, &position); | 3791 | CTRunGetPositions (ctrun, range, &position); |
| 3792 | max_x = position.x + CTRunGetTypographicBounds (ctrun, range, | ||
| 3793 | NULL, NULL, NULL); | ||
| 3794 | max_x = max (max_x, total_advance); | ||
| 3791 | gl->advance_delta = position.x - total_advance; | 3795 | gl->advance_delta = position.x - total_advance; |
| 3792 | gl->baseline_delta = position.y; | 3796 | gl->baseline_delta = position.y; |
| 3793 | gl->advance = (gl->advance_delta | 3797 | gl->advance = max_x - total_advance; |
| 3794 | + CTRunGetTypographicBounds (ctrun, range, | 3798 | total_advance = max_x; |
| 3795 | NULL, NULL, NULL)); | ||
| 3796 | total_advance += gl->advance; | ||
| 3797 | } | 3799 | } |
| 3798 | 3800 | ||
| 3799 | if (RIGHT_TO_LEFT_P) | 3801 | if (RIGHT_TO_LEFT_P) |