Update to reflect the minimal WebKitSystemInterface changes required
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Sep 2007 16:10:52 +0000 (16:10 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Sep 2007 16:10:52 +0000 (16:10 +0000)
        to support @font-face.

        Reviewed by john

        * platform/mac/FontDataMac.mm:
        (WebCore::FontData::platformInit):
        (WebCore::FontData::platformWidthForGlyph):
        * platform/mac/WebCoreSystemInterface.h:
        * platform/mac/WebCoreSystemInterface.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/mac/FontDataMac.mm
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm

index 25511941af71ce18a5cca0ea2584c4ef819b60ff..b65869b7c0b4ee252fefc2f4d1ce95d872a37854 100644 (file)
@@ -1,3 +1,16 @@
+2007-09-27  David Hyatt  <hyatt@apple.com>
+
+        Update to reflect the minimal WebKitSystemInterface changes required
+        to support @font-face.
+
+        Reviewed by john
+
+        * platform/mac/FontDataMac.mm:
+        (WebCore::FontData::platformInit):
+        (WebCore::FontData::platformWidthForGlyph):
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2007-09-26  Darin Adler  <darin@apple.com>
 
         - fix Windows build
index d95b679e2832d384c2a8083c91b34be98bfd4857..dea38ce1c325cb04477a05dc61041fb412db6fd8 100644 (file)
@@ -161,7 +161,7 @@ void FontData::platformInit()
     int iDescent;
     int iLineGap;
     unsigned unitsPerEm;
-    wkGetFontMetrics(m_font.font(), &iAscent, &iDescent, &iLineGap, &unitsPerEm); 
+    wkGetFontMetrics(wkGetCGFontFromNSFont(m_font.font()), &iAscent, &iDescent, &iLineGap, &unitsPerEm); 
     float pointSize = [m_font.font() pointSize];
     float fAscent = scaleEmToUnits(iAscent, unitsPerEm) * pointSize;
     float fDescent = -scaleEmToUnits(iDescent, unitsPerEm) * pointSize;
@@ -282,7 +282,7 @@ float FontData::platformWidthForGlyph(Glyph glyph) const
     float pointSize = [font pointSize];
     CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
     CGSize advance;
-    if (!wkGetGlyphTransformedAdvances(font, &m, &glyph, &advance)) {
+    if (!wkGetGlyphTransformedAdvances(wkGetCGFontFromNSFont(font), font, &m, &glyph, &advance)) {
         LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
         advance.width = 0;
     }
index 6165a7e79fbd46ee413977ef1d3abee18fa1ffc5..49365f75ad9d119b56fa7b54a7e1abcf3f310201 100644 (file)
@@ -92,8 +92,8 @@ extern CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
 extern ATSGlyphRef (*wkGetDefaultGlyphForChar)(NSFont*, UniChar);
 extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
 extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
-extern void (*wkGetFontMetrics)(NSFont*, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
-extern BOOL (*wkGetGlyphTransformedAdvances)(NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
+extern void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
+extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
 extern ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
 extern int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
 extern size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);
index 5444e91509313b82b8c8e0f3dd39fc834c86394f..46159aa989000ac047b331b57592fa1251377813 100644 (file)
@@ -41,8 +41,8 @@ CGFontRef (*wkGetCGFontFromNSFont)(NSFont*);
 ATSGlyphRef (*wkGetDefaultGlyphForChar)(NSFont*, UniChar);
 NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
 NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
-void (*wkGetFontMetrics)(NSFont*, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
-BOOL (*wkGetGlyphTransformedAdvances)(NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
+void (*wkGetFontMetrics)(CGFontRef, int* ascent, int* descent, int* lineGap, unsigned* unitsPerEm);
+BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
 ATSLayoutRecord* (*wkGetGlyphVectorFirstRecord)(void* glyphVector);
 int (*wkGetGlyphVectorNumGlyphs)(void* glyphVector);
 size_t (*wkGetGlyphVectorRecordSize)(void* glyphVector);