diff options
| author | Jan Djärv | 2013-09-03 08:56:25 +0200 |
|---|---|---|
| committer | Jan Djärv | 2013-09-03 08:56:25 +0200 |
| commit | 0ce9f6de648119922179ac9faaecc9445a5eade6 (patch) | |
| tree | 45e0eb23dc4316d3e941aad2d6a3db2a7af64ce4 /src | |
| parent | 88527bc0a26e385376c9da884feb9fe0d4d18429 (diff) | |
| download | emacs-0ce9f6de648119922179ac9faaecc9445a5eade6.tar.gz emacs-0ce9f6de648119922179ac9faaecc9445a5eade6.zip | |
* nsfont.m (INVALID_GLYPH): New define.
(nsfont_encode_char): Use INVALID_GLYPH.
(ns_uni_to_glyphs): Ditto, check for NSNullGlyph.
Fixes: debbugs:15138
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/nsfont.m | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d2e80ace3e4..caba3eb96d4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-09-03 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * nsfont.m (INVALID_GLYPH): New define. | ||
| 4 | (nsfont_encode_char): Use INVALID_GLYPH. | ||
| 5 | (ns_uni_to_glyphs): Ditto, check for NSNullGlyph (Bug#15138). | ||
| 6 | |||
| 1 | 2013-09-02 Dmitry Antipov <dmantipov@yandex.ru> | 7 | 2013-09-02 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 8 | ||
| 3 | * xterm.c (x_last_mouse_movement_time): Revert last change. | 9 | * xterm.c (x_last_mouse_movement_time): Revert last change. |
diff --git a/src/nsfont.m b/src/nsfont.m index 235150e3aef..e1c7d32dde0 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -61,6 +61,7 @@ static void ns_uni_to_glyphs (struct nsfont_info *font_info, | |||
| 61 | static void ns_glyph_metrics (struct nsfont_info *font_info, | 61 | static void ns_glyph_metrics (struct nsfont_info *font_info, |
| 62 | unsigned char block); | 62 | unsigned char block); |
| 63 | 63 | ||
| 64 | #define INVALID_GLYPH 0xFFFF | ||
| 64 | 65 | ||
| 65 | /* ========================================================================== | 66 | /* ========================================================================== |
| 66 | 67 | ||
| @@ -981,7 +982,7 @@ nsfont_encode_char (struct font *font, int c) | |||
| 981 | ns_uni_to_glyphs (font_info, high); | 982 | ns_uni_to_glyphs (font_info, high); |
| 982 | 983 | ||
| 983 | g = font_info->glyphs[high][low]; | 984 | g = font_info->glyphs[high][low]; |
| 984 | return g == 0xFFFF ? FONT_INVALID_CODE : g; | 985 | return g == INVALID_GLYPH ? FONT_INVALID_CODE : g; |
| 985 | } | 986 | } |
| 986 | 987 | ||
| 987 | 988 | ||
| @@ -1354,8 +1355,8 @@ ns_uni_to_glyphs (struct nsfont_info *font_info, unsigned char block) | |||
| 1354 | #else | 1355 | #else |
| 1355 | g = glyphStorage->cglyphs[i]; | 1356 | g = glyphStorage->cglyphs[i]; |
| 1356 | /* TODO: is this a good check? maybe need to use coveredChars.. */ | 1357 | /* TODO: is this a good check? maybe need to use coveredChars.. */ |
| 1357 | if (g > numGlyphs) | 1358 | if (g > numGlyphs || g == NSNullGlyph) |
| 1358 | g = 0xFFFF; /* hopefully unused... */ | 1359 | g = INVALID_GLYPH; /* hopefully unused... */ |
| 1359 | #endif | 1360 | #endif |
| 1360 | *glyphs = g; | 1361 | *glyphs = g; |
| 1361 | } | 1362 | } |
| @@ -1483,7 +1484,7 @@ ns_glyph_metrics (struct nsfont_info *font_info, unsigned char block) | |||
| 1483 | characterIndex: (NSUInteger)charIndex | 1484 | characterIndex: (NSUInteger)charIndex |
| 1484 | { | 1485 | { |
| 1485 | len = glyphIndex+length; | 1486 | len = glyphIndex+length; |
| 1486 | for (i =glyphIndex; i<len; i++) | 1487 | for (i =glyphIndex; i<len; i++) |
| 1487 | cglyphs[i] = glyphs[i-glyphIndex]; | 1488 | cglyphs[i] = glyphs[i-glyphIndex]; |
| 1488 | if (len > maxGlyph) | 1489 | if (len > maxGlyph) |
| 1489 | maxGlyph = len; | 1490 | maxGlyph = len; |