Changeset 191440 in webkit
- Timestamp:
- Oct 21, 2015 11:45:21 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r191431 r191440 1 2015-10-21 Frederic Wang <fred.wang@free.fr> 2 3 [Mac] Add support for the USE_TYPO_METRICS flag 4 https://bugs.webkit.org/show_bug.cgi?id=150394 5 6 Reviewed by Myles C. Maxfield. 7 8 Update font, reference and Mac expectation for fonts/use-typo-metrics-1.html 9 10 * fonts/lineheight5000-typolineheight2300.woff: Add a MATH table. 11 * platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Updated. 12 * platform/mac/TestExpectations: Remove Mac failure expectation. 13 * platform/mac/mathml/opentype/opentype-stretchy-expected.txt: Updated. 14 * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Updated. 15 1 16 2015-10-21 Ryan Haddad <ryanhaddad@apple.com> 2 17 -
trunk/LayoutTests/platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt
r174585 r191440 11 11 RenderMathMLBlock (anonymous, flex) at (2,0) size 11x4 12 12 RenderBlock (anonymous) at (0,0) size 2x4 13 RenderText at (0,-3) size 2x 1013 RenderText at (0,-3) size 2x0 14 14 text run at (0,-3) width 2: "\x{219C}" 15 15 RenderMathMLSpace {mspace} at (4,0) size 8x1 … … 22 22 RenderMathMLBlock (anonymous, flex) at (2,0) size 22x4 23 23 RenderBlock (anonymous) at (0,0) size 2x4 24 RenderText at (0,-3) size 2x 1024 RenderText at (0,-3) size 2x0 25 25 text run at (0,-3) width 2: "\x{219C}" 26 26 RenderMathMLSpace {mspace} at (5,0) size 16x1 … … 33 33 RenderMathMLBlock (anonymous, flex) at (2,0) size 151x4 34 34 RenderBlock (anonymous) at (0,0) size 2x4 35 RenderText at (0,-3) size 2x 1035 RenderText at (0,-3) size 2x0 36 36 text run at (0,-3) width 2: "\x{219C}" 37 37 RenderMathMLSpace {mspace} at (2,0) size 151x1 -
trunk/LayoutTests/platform/mac/TestExpectations
r191431 r191440 1349 1349 # Imported Blink tests which have not been investigated. 1350 1350 imported/blink/compositing/video/video-controls-layer-creation-squashing.html [ Pass ImageOnlyFailure ] 1351 1352 # USE_TYPO_METRICS is not implemented on mac.1353 webkit.org/b/131839 fonts/use-typo-metrics-1.html [ ImageOnlyFailure ] -
trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt
r170699 r191440 10 10 RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3 11 11 RenderBlock (anonymous) at (0,0) size 3x3 12 RenderText at (0,-3) size 3x 1012 RenderText at (0,-3) size 3x0 13 13 text run at (0,-3) width 3: "\x{219F}" 14 14 RenderText {#text} at (48,16) size 5x18 … … 19 19 RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3 20 20 RenderBlock (anonymous) at (0,0) size 3x3 21 RenderText at (0,-3) size 3x 1021 RenderText at (0,-3) size 3x0 22 22 text run at (0,-3) width 3: "\x{219F}" 23 23 RenderText {#text} at (100,16) size 5x18 … … 28 28 RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3 29 29 RenderBlock (anonymous) at (0,0) size 3x3 30 RenderText at (0,-3) size 3x 1030 RenderText at (0,-3) size 3x0 31 31 text run at (0,-3) width 3: "\x{219F}" 32 32 RenderText {#text} at (0,0) size 0x0 … … 37 37 RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3 38 38 RenderBlock (anonymous) at (0,0) size 3x3 39 RenderText at (0,-3) size 3x 1039 RenderText at (0,-3) size 3x0 40 40 text run at (0,-3) width 3: "\x{219F}" 41 41 RenderText {#text} at (0,0) size 0x0 … … 46 46 RenderMathMLBlock (anonymous, flex) at (0,0) size 83x12 47 47 RenderBlock (anonymous) at (0,0) size 11x12 48 RenderText at (0,6) size 11x 1048 RenderText at (0,6) size 11x0 49 49 text run at (0,6) width 11: "\x{2A1B}" 50 50 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt
r175173 r191440 11 11 RenderMathMLBlock (anonymous, flex) at (2,0) size 11x4 12 12 RenderBlock (anonymous) at (0,0) size 2x4 13 RenderText at (0,-3) size 2x 1013 RenderText at (0,-3) size 2x0 14 14 text run at (0,-3) width 2: "\x{219C}" 15 15 RenderMathMLSpace {mspace} at (4,0) size 8x1 … … 22 22 RenderMathMLBlock (anonymous, flex) at (2,0) size 22x4 23 23 RenderBlock (anonymous) at (0,0) size 2x4 24 RenderText at (0,-3) size 2x 1024 RenderText at (0,-3) size 2x0 25 25 text run at (0,-3) width 2: "\x{219C}" 26 26 RenderMathMLSpace {mspace} at (5,0) size 16x1 … … 33 33 RenderMathMLBlock (anonymous, flex) at (2,0) size 151x4 34 34 RenderBlock (anonymous) at (0,0) size 2x4 35 RenderText at (0,-3) size 2x 1035 RenderText at (0,-3) size 2x0 36 36 text run at (0,-3) width 2: "\x{219C}" 37 37 RenderMathMLSpace {mspace} at (2,0) size 151x1 -
trunk/Source/WebCore/ChangeLog
r191439 r191440 1 2015-10-21 Frederic Wang <fred.wang@free.fr> 2 3 [Mac] Add support for the USE_TYPO_METRICS flag 4 https://bugs.webkit.org/show_bug.cgi?id=150394 5 6 Reviewed by Myles C. Maxfield. 7 8 Make the Cocoa backend use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set. 9 10 No new tests because this is already tested by fonts/use-typo-metrics-1.html 11 12 * platform/graphics/cocoa/FontCocoa.mm: 13 (WebCore::Font::platformInit): Verify whether the OS/2 USE_TYPO_METRICS flag is set and use the typo metrics if that is the case. 14 1 15 2015-10-21 Zalan Bujtas <zalan@apple.com> 2 16 -
trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
r191331 r191440 58 58 #endif 59 59 60 #if USE(APPKIT) 61 #include "OpenTypeTypes.h" 62 #endif 63 60 64 namespace WebCore { 61 65 … … 171 175 float lineGap = scaleEmToUnits(CGFontGetLeading(m_platformData.cgFont()), unitsPerEm) * pointSize; 172 176 177 // The Open Font Format describes the OS/2 USE_TYPO_METRICS flag as follows: 178 // "If set, it is strongly recommended to use OS/2.sTypoAscender - OS/2.sTypoDescender+ OS/2.sTypoLineGap as a value for default line spacing for this font." 179 // We only apply this rule in the important case of fonts with a MATH table. 180 CFArrayRef availableTables = CTFontCopyAvailableTables(m_platformData.cgFont(), kCTFontTableOptionNoOptions); 181 if (CFArrayContainsValue(availableTables, CFRangeMake(0, CFArrayGetCount(availableTables)), kCTFontTableMATH)) { 182 if (CFDataRef os2Table = CGFontCopyTableForTag(kCTFontTableOS2)) { 183 // For the structure of the OS/2 table, see 184 // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html 185 const CFIndex fsSelectionOffset = 16 * 2 + 10 + 4 * 4 + 4 * 1; 186 const CFIndex sTypoAscenderOffset = fsSelectionOffset + 3 * 2; 187 const CFIndex sTypoDescenderOffset = sTypoAscenderOffset + 2; 188 const CFIndex sTypoLineGapOffset = sTypoDescenderOffset + 2; 189 if (CFDataGetLength(os2Table) >= sTypoLineGapOffset + 2) { 190 const UInt8* os2Data = CFDataGetBytePtr(os2Table); 191 const unsigned short useTypoMetricsMask = 1 << 7; 192 if (*(reinterpret_cast<const OpenType::UInt16*>(os2Data + fsSelectionOffset)) & useTypoMetricsMask) { 193 ascent = scaleEmToUnits(*(reinterpret_cast<const OpenType::Int16*>(os2Data + sTypoAscenderOffset)), unitsPerEm) * pointSize; 194 descent = -scaleEmToUnits(*(reinterpret_cast<const OpenType::Int16*>(os2Data + sTypoDescenderOffset)), unitsPerEm) * pointSize; 195 lineGap = scaleEmToUnits(*(reinterpret_cast<const OpenType::Int16*>(os2Data + sTypoLineGapOffset)), unitsPerEm) * pointSize; 196 } 197 } 198 CFRelease(os2Table); 199 } 200 } 201 CFRelease(availableTables); 202 173 203 // We need to adjust Times, Helvetica, and Courier to closely match the 174 204 // vertical metrics of their Microsoft counterparts that are the de facto
Note: See TracChangeset
for help on using the changeset viewer.