aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsfont.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/nsfont.m')
-rw-r--r--src/nsfont.m9
1 files changed, 5 insertions, 4 deletions
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,
61static void ns_glyph_metrics (struct nsfont_info *font_info, 61static 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;