return w;
}
#endif
- w = [sfont widthOfString: cstr];
+ {
+ NSDictionary *attrsDictionary =
+ [NSDictionary dictionaryWithObject: sfont forKey: NSFontAttributeName];
+ w = [cstr sizeWithAttributes: attrsDictionary].width;
+ }
return max (w, 2.0);
}
return ns_fallback_entity ();
if (NSFONT_TRACE)
- fprintf (stderr, " Returning %d entities.\n", XINT (Flength (list)));
+ fprintf (stderr, " Returning %ld entities.\n",
+ (long)XINT (Flength (list)));
return list;
}
/* FIXME: escape the name? */
if (NSFONT_TRACE)
- fprintf (stderr, "nsfont: list families returning %d entries\n",
- XINT (Flength (list)));
+ fprintf (stderr, "nsfont: list families returning %ld entries\n",
+ (long)XINT (Flength (list)));
return list;
}
/* set up metrics portion of font struct */
font->ascent = [sfont ascender];
font->descent = -[sfont descender];
- font->min_width = [sfont widthOfString: @"|"]; /* FIXME */
+ font->min_width = ns_char_width(sfont, '|');
font->space_width = lrint (ns_char_width (sfont, ' '));
font->average_width = lrint (font_info->width);
font->max_width = lrint (font_info->max_bounds.width);
NSGlyphGenerator *glyphGenerator = [NSGlyphGenerator sharedGlyphGenerator];
/*NSCharacterSet *coveredChars = [nsfont coveredCharacterSet]; */
unsigned int numGlyphs = [font_info->nsfont numberOfGlyphs];
- unsigned int gInd =0, cInd =0;
+ NSUInteger gInd =0, cInd =0;
[glyphStorage setString: allChars font: font_info->nsfont];
[glyphGenerator generateGlyphsForGlyphStorage: glyphStorage
}
/* NSGlyphStorage protocol */
-- (unsigned int)layoutOptions
+- (NSUInteger)layoutOptions
{
return 0;
}
return attrStr;
}
-- (void)insertGlyphs: (const NSGlyph *)glyphs length: (unsigned int)length
- forStartingGlyphAtIndex: (unsigned int)glyphIndex
- characterIndex: (unsigned int)charIndex
+- (void)insertGlyphs: (const NSGlyph *)glyphs length: (NSUInteger)length
+ forStartingGlyphAtIndex: (NSUInteger)glyphIndex
+ characterIndex: (NSUInteger)charIndex
{
len = glyphIndex+length;
for (i =glyphIndex; i<len; i++)
maxGlyph = len;
}
-- (void)setIntAttribute: (int)attributeTag value: (int)val
- forGlyphAtIndex: (unsigned)glyphIndex
+- (void)setIntAttribute: (NSInteger)attributeTag value: (NSInteger)val
+ forGlyphAtIndex: (NSUInteger)glyphIndex
{
return;
}