Changeset 261573 in webkit


Ignore:
Timestamp:
May 12, 2020 1:32:17 PM (4 years ago)
Author:
mmaxfield@apple.com
Message:

Text is clipped when rendered with fonts which have a negative line gap metric
https://bugs.webkit.org/show_bug.cgi?id=211683
<rdar://problem/62192986>

Reviewed by Zalan Bujtas.

Source/WebCore:

... As seen on nytimes.com.

Some fonts have negative line gap metrics. Chrome and Firefox both clamp it to 0, so the
line-height isn't decreased. However, we were honoring the negative line gap, thereby decreasing
line-height.

There are some typographical reasons to want a negative line gap, which is why this clamping
behavior shouldn't be done in the platform text library. In the interest of matching other
browsers, we should perform this clamping ourselves in WebKit.

Test: fast/text/negative-line-gap.html

  • platform/graphics/Font.cpp:

(WebCore::Font::platformGlyphInit):

LayoutTests:

  • fast/text/negative-line-gap-expected.html: Added.
  • fast/text/negative-line-gap.html: Added.
  • fast/text/resources/Ahem-negative-line-gap.ttf: Added.
  • platform/ios/fast/text/international/complex-character-based-fallback-expected.txt:
  • platform/mac/fast/text/international/complex-character-based-fallback-expected.txt:
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r261550 r261573  
     12020-05-12  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Text is clipped when rendered with fonts which have a negative line gap metric
     4        https://bugs.webkit.org/show_bug.cgi?id=211683
     5        <rdar://problem/62192986>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        * fast/text/negative-line-gap-expected.html: Added.
     10        * fast/text/negative-line-gap.html: Added.
     11        * fast/text/resources/Ahem-negative-line-gap.ttf: Added.
     12        * platform/ios/fast/text/international/complex-character-based-fallback-expected.txt:
     13        * platform/mac/fast/text/international/complex-character-based-fallback-expected.txt:
     14
    1152020-05-12  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/LayoutTests/platform/ios/fast/text/international/complex-character-based-fallback-expected.txt

    r224049 r261573  
    1414          text run at (489,20) width 279: " covered by the default font and is rendered"
    1515          text run at (0,40) width 52: "using it."
    16       RenderBlock {P} at (0,76) size 306x146 [border: (3px solid #000000)]
    17         RenderText {#text} at (3,3) size 297x139
     16      RenderBlock {P} at (0,76) size 306x153 [border: (3px solid #000000)]
     17        RenderText {#text} at (3,3) size 297x145
    1818          text run at (3,3) width 167: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
    19           text run at (3,23) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
    20           text run at (3,43) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
    21           text run at (3,63) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
    22           text run at (3,83) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
    23           text run at (3,103) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
    24           text run at (3,123) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
    25       RenderBlock {P} at (0,238) size 784x40
     19          text run at (3,24) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
     20          text run at (3,45) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
     21          text run at (3,66) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
     22          text run at (3,87) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
     23          text run at (3,108) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
     24          text run at (3,129) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
     25      RenderBlock {P} at (0,245) size 784x40
    2626        RenderText {#text} at (0,0) size 766x39
    2727          text run at (0,0) width 766: "This is the same text but specifying a font that covers Tamil. Note that the exclamation point is rendered using the same"
    2828          text run at (0,20) width 99: "font as the text."
    29       RenderBlock {P} at (0,294) size 306x146 [border: (3px solid #000000)]
    30         RenderText {#text} at (3,3) size 297x139
     29      RenderBlock {P} at (0,301) size 306x153 [border: (3px solid #000000)]
     30        RenderText {#text} at (3,3) size 297x145
    3131          text run at (3,3) width 167: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
    32           text run at (3,23) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
    33           text run at (3,43) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
    34           text run at (3,63) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
    35           text run at (3,83) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
    36           text run at (3,103) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
    37           text run at (3,123) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
     32          text run at (3,24) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
     33          text run at (3,45) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
     34          text run at (3,66) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
     35          text run at (3,87) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
     36          text run at (3,108) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
     37          text run at (3,129) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
  • trunk/LayoutTests/platform/mac/fast/text/international/complex-character-based-fallback-expected.txt

    r233831 r261573  
    1414          text run at (489,18) width 279: " covered by the default font and is rendered"
    1515          text run at (0,36) width 52: "using it."
    16       RenderBlock {P} at (0,70) size 306x139 [border: (3px solid #000000)]
    17         RenderText {#text} at (3,3) size 297x132
     16      RenderBlock {P} at (0,70) size 306x146 [border: (3px solid #000000)]
     17        RenderText {#text} at (3,3) size 297x138
    1818          text run at (3,3) width 167: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
    19           text run at (3,22) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
    20           text run at (3,41) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
    21           text run at (3,60) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
    22           text run at (3,79) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
    23           text run at (3,98) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
    24           text run at (3,117) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
    25       RenderBlock {P} at (0,225) size 784x36
     19          text run at (3,23) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
     20          text run at (3,43) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
     21          text run at (3,63) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
     22          text run at (3,83) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
     23          text run at (3,103) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
     24          text run at (3,123) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
     25      RenderBlock {P} at (0,232) size 784x36
    2626        RenderText {#text} at (0,0) size 766x36
    2727          text run at (0,0) width 766: "This is the same text but specifying a font that covers Tamil. Note that the exclamation point is rendered using the same"
    2828          text run at (0,18) width 99: "font as the text."
    29       RenderBlock {P} at (0,277) size 306x139 [border: (3px solid #000000)]
    30         RenderText {#text} at (3,3) size 297x132
     29      RenderBlock {P} at (0,284) size 306x146 [border: (3px solid #000000)]
     30        RenderText {#text} at (3,3) size 297x138
    3131          text run at (3,3) width 167: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
    32           text run at (3,22) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
    33           text run at (3,41) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
    34           text run at (3,60) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
    35           text run at (3,79) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
    36           text run at (3,98) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
    37           text run at (3,117) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
     32          text run at (3,23) width 267: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
     33          text run at (3,43) width 277: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
     34          text run at (3,63) width 297: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
     35          text run at (3,83) width 279: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
     36          text run at (3,103) width 268: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
     37          text run at (3,123) width 155: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
  • trunk/Source/WebCore/ChangeLog

    r261572 r261573  
     12020-05-12  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Text is clipped when rendered with fonts which have a negative line gap metric
     4        https://bugs.webkit.org/show_bug.cgi?id=211683
     5        <rdar://problem/62192986>
     6
     7        Reviewed by Zalan Bujtas.
     8
     9        ... As seen on nytimes.com.
     10
     11        Some fonts have negative line gap metrics. Chrome and Firefox both clamp it to 0, so the
     12        line-height isn't decreased. However, we were honoring the negative line gap, thereby decreasing
     13        line-height.
     14
     15        There are some typographical reasons to want a negative line gap, which is why this clamping
     16        behavior shouldn't be done in the platform text library. In the interest of matching other
     17        browsers, we should perform this clamping ourselves in WebKit.
     18
     19        Test: fast/text/negative-line-gap.html
     20
     21        * platform/graphics/Font.cpp:
     22        (WebCore::Font::platformGlyphInit):
     23
    1242020-05-12  Ross Kirsling  <ross.kirsling@sony.com>
    225
  • trunk/Source/WebCore/platform/graphics/Font.cpp

    r254534 r261573  
    138138    m_spaceWidth = width;
    139139    m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph));
     140    auto amountToAdjustLineGap = std::min(m_fontMetrics.floatLineGap(), 0.0f);
     141    m_fontMetrics.setLineGap(m_fontMetrics.floatLineGap() - amountToAdjustLineGap);
     142    m_fontMetrics.setLineSpacing(m_fontMetrics.floatLineSpacing() - amountToAdjustLineGap);
    140143    determinePitch();
    141144    m_adjustedSpaceWidth = m_treatAsFixedPitch ? ceilf(width) : roundf(width);
Note: See TracChangeset for help on using the changeset viewer.