Merge pull request #681 from ichizok/fix/coretext-renderer

Fix Core Text renderer
This commit is contained in:
Kazuki Sakamoto
2018-05-11 20:49:33 -07:00
committed by GitHub
2 changed files with 14 additions and 11 deletions
+5 -8
View File
@@ -1431,7 +1431,7 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
}
CGContextSetRGBStrokeColor(context, RED(sp), GREEN(sp), BLUE(sp),
ALPHA(sp));
ALPHA(sp));
CGContextStrokePath(context);
}
@@ -1449,13 +1449,10 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
CGContextSetFontSize(context, [font pointSize]);
// Calculate position of each glyph relative to (x,y).
if (!composing) {
float xrel = 0;
for (unsigned i = 0; i < length; ++i) {
positions[i].x = xrel;
positions[i].y = .0;
xrel += w;
}
float xrel = composing ? .0 : w;
for (unsigned i = 0; i < length; ++i) {
positions[i].x = i * xrel;
positions[i].y = .0;
}
CTFontRef fontRef = (CTFontRef)(wide ? [fontWide retain]
+9 -3
View File
@@ -8388,7 +8388,13 @@ screen_char(unsigned off, int row, int col)
{
char_u buf[MB_MAXBYTES + 1];
if (utf_ambiguous_width(ScreenLinesUC[off]))
if (utf_ambiguous_width(ScreenLinesUC[off])
# ifdef FEAT_GUI_MACVIM
/* In the GUI, check if the cell width is actually 1 in order
* to display 2-cells emoji correctly. */
&& (!gui.in_use || utf_char2cells(ScreenLinesUC[off]) == 1)
# endif
)
{
if (*p_ambw == 'd'
# ifdef FEAT_GUI
@@ -8404,9 +8410,9 @@ screen_char(unsigned off, int row, int col)
/* not sure where the cursor is after drawing the ambiguous width
* character */
# ifdef FEAT_GUI_MACVIM
if (*p_ambw == 'd' || !gui.in_use)
if (*p_ambw == 'd' || !gui.in_use)
# endif
screen_cur_col = 9999;
screen_cur_col = 9999;
}
else if (utf_char2cells(ScreenLinesUC[off]) > 1)
++screen_cur_col;