Fix <rdar://5549919> Add font database initialization code to WebCore and call it...
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 05:23:20 +0000 (05:23 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 05:23:20 +0000 (05:23 +0000)
commit3921fd9a59102c29163668ce46beed3905a78773
tree99567d89da211d75618e6b6a2861088c3dcc1a5a
parentc34ac23bef21ee1e414b7c7765e346ed2325b0f2
 Fix <rdar://5549919> Add font database initialization code to WebCore and call it from WebKit

 WebCore:

         Add font database initialization code to WebCore

         Reviewed by Ada.

         * WebCore.vcproj/WebCore.vcproj: Added FontDatabase.{cpp,h}.
         * platform/win/FontDatabase.cpp: Added.
         (WebCore::systemFontsDirectory):
         (WebCore::fontsPlistPath):
         (WebCore::systemHasFontsNewerThanFontsPlist):
         (WebCore::readFontPlist):
         (WebCore::populateFontDatabaseFromPlist):
         (WebCore::populateFontDatabaseFromFileSystem):
         (WebCore::writeFontDatabaseToPlist):
         (WebCore::populateFontDatabase): This is the only function callable
         from outside this file. It populates the font database once, either
         from the fonts plist, or from the filesystem (and then saves a new
         fonts plist).
         * platform/win/FontDatabase.h: Added.

 WebKitTools:

         Remove now-unnecessary call to InitializeCoreGraphics

         WebKit takes care of this now.

         Reviewed by Ada.

         * DumpRenderTree/win/DumpRenderTree.cpp:
         (initialize):

 WebKit/win:

         Fix <rdar://5549919> Initialize the font database before any font code is invoked

         We initialize the database in two places:
            1. When instantiating WebKitClassFactory, which is guaranteed to
            happen before any WebView is instantiated.
            2. When making a WebCore::Font in WebKitGraphics.

         This ensures that the font database will be populated before any font
         code is invoked. We rely on WebCore to only populate the database
         once.

         Reviewed by Ada.

         * WebKitClassFactory.cpp:
         (WebKitClassFactory::WebKitClassFactory): Populate the font database.
         * WebKitGraphics.cpp:
         (makeFont): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/platform/win/FontDatabase.cpp [new file with mode: 0644]
WebCore/platform/win/FontDatabase.h [new file with mode: 0644]
WebKit/win/ChangeLog
WebKit/win/WebKitClassFactory.cpp
WebKit/win/WebKitGraphics.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp