Skip to content
  • aroben's avatar
    Fix <rdar://5549919> Add font database initialization code to WebCore and call it from WebKit · 2829b3c4
    aroben authored
     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: http://svn.webkit.org/repository/webkit/trunk@27020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    2829b3c4