+2005-02-15 Richard Williamson <rjw@apple.com>
+
+ Fixed <rdar://problem/3998368> Tiger8A376: WebTextRenderer assertion failure in Safari while browsing news.bbc.co.uk
+
+ Removed use of FATAL_ALWAYS from getUncachedWidth(). It's unclear
+ why we would trigger the FATAL_ALWAYS. In the past we've seen
+ the message triggered because of corrupt fonts. Anyway, in this
+ particular case, we will now return 0 for the character width,
+ rather than exiting.
+
+ Reviewed by David Harrison.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (getUncachedWidth):
+
2005-02-15 Richard Williamson <rjw@apple.com>
Fixed <rdar://problem/3999467> when Osaka-Mono is specified as fixed width font, Osaka used instead
if (font == NULL)
font = renderer->font;
- if (!CGFontGetGlyphScaledAdvances ([font _backingCGSFont], &glyph, 1, &width, [font pointSize]))
- FATAL_ALWAYS ("Unable to cache glyph widths for %@ %f", [font displayName], [font pointSize]);
+ if (!CGFontGetGlyphScaledAdvances ([font _backingCGSFont], &glyph, 1, &width, [font pointSize])) {
+ ERROR ("Unable to cache glyph widths for %@ %f", [font displayName], [font pointSize]);
+ return 0.;
+ }
return width;
}
pointSize = [font pointSize];
m = CGAffineTransformMakeScale(pointSize, pointSize);
- if (!CGFontGetGlyphTransformedAdvances([font _backingCGSFont], &m, _AppkitGetCGRenderingMode(font), &glyph, 1, &advance))
- FATAL_ALWAYS ("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
+ if (!CGFontGetGlyphTransformedAdvances([font _backingCGSFont], &m, _AppkitGetCGRenderingMode(font), &glyph, 1, &advance)) {
+ ERROR ("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
+ return 0.;
+ }
return advance.width;
}