Add support for the USE_TYPO_METRICS flag on iOS
https://bugs.webkit.org/show_bug.cgi?id=131839

Reviewed by Darin Adler.

Make the iOS Font service use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.
The code shared by iOS, OS X and AppleWin is moved into a separate OpenTypeCG module.

No new tests because this is already tested by fonts/use-typo-metrics-1.html

* PlatformAppleWin.cmake: Add OpenTypeCG files.
* PlatformMac.cmake: ditto.
* WebCore.vcxproj/WebCore.vcxproj: ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: ditto.
* WebCore.xcodeproj/project.pbxproj: ditto.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit): Use functions from OpenTypeCG.
(WebCore::fontHasMathTable): Deleted.
* platform/graphics/ios/FontServicesIOS.mm:
(WebCore::FontServicesIOS::FontServicesIOS): Use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.
* platform/graphics/opentype/OpenTypeCG.h: Added.
* platform/graphics/opentype/OpenTypeCG.cpp: Added.
(WebCore::OpenType::fontHasMathTable): Move this code from FontCocoa.mm.
(WebCore::OpenType::readShortFromTable): Inline function to read a 16-bit big endian integer from the OS/2 table and to cast it into a short integer.
(WebCore::OpenType::tryGetTypoMetrics): Move this code from FontCocoa.mm.
* platform/graphics/opentype/OpenTypeTypes.h: Add missing Glyph.h header needed by TableWithCoverage::getCoverageIndex.
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::Font::platformInit): Use functions from OpenTypeCG.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@192017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed