Add support for the USE_TYPO_METRICS flag on iOS
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 08:50:31 +0000 (08:50 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Nov 2015 08:50:31 +0000 (08:50 +0000)
commit935dce332f8220fa1a47dcddc1a060dd4dbae83d
tree1f672d952e10c32aad23bde0bb9be13398e8da48
parent9dfefa9a45e251561ca76ba35e8df8e8dd55d966
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: https://svn.webkit.org/repository/webkit/trunk@192017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PlatformAppleWin.cmake
Source/WebCore/PlatformMac.cmake
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
Source/WebCore/platform/graphics/ios/FontServicesIOS.mm
Source/WebCore/platform/graphics/opentype/OpenTypeCG.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/opentype/OpenTypeCG.h [new file with mode: 0644]
Source/WebCore/platform/graphics/opentype/OpenTypeTypes.h
Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp