diff --git a/frontends/gnustep/tables/font.m b/frontends/gnustep/tables/font.m index 96d64b4d6..a11d55d92 100644 --- a/frontends/gnustep/tables/font.m +++ b/frontends/gnustep/tables/font.m @@ -76,7 +76,7 @@ static nserror cocoa_font_position(const plot_font_style_t *style, } NSUInteger glyphIndex = cocoa_glyph_for_location(layout, x); - if (glyphIndex >= length) { + if (glyphIndex >= [layout numberOfGlyphs]) { *char_offset = length; } else { NSUInteger chars = [layout characterIndexForGlyphAtIndex: glyphIndex];