[webkit-changes] cvs commit: WebKit/WebCoreSupport.subproj
WebTextRenderer.m
Adele
adele at opensource.apple.com
Mon Dec 19 12:54:16 PST 2005
adele 05/12/19 12:54:16
Modified: . ChangeLog
. ChangeLog
WebCoreSupport.subproj WebTextRenderer.m
Added: fast/text atsui-kerning-and-ligatures-expected.checksum
atsui-kerning-and-ligatures-expected.png
atsui-kerning-and-ligatures-expected.txt
atsui-kerning-and-ligatures.html
Log:
LayoutTests:
Reviewed by Darin, committed by Adele.
- test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6137
Disable kerning and some ligatures in the ATSUI code path
* fast/text/atsui-kerning-and-ligatures-expected.checksum: Added.
* fast/text/atsui-kerning-and-ligatures-expected.png: Added.
* fast/text/atsui-kerning-and-ligatures-expected.txt: Added.
* fast/text/atsui-kerning-and-ligatures.html: Added.
WebKit:
Reviewed by Darin, committed by Adele.
Test: fast/text/atsui-kerning-and-ligatures.html
- fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6137
Disable kerning and some ligatures in the ATSUI code path
* WebCoreSupport.subproj/WebTextRenderer.m:
(initializeATSUStyle): Disable kerning; disable ligatures unless the font
does not contain 'a', in which case it is assumed to never be rendered
by the CG code path.
Revision Changes Path
1.171 +12 -0 LayoutTests/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/LayoutTests/ChangeLog,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -r1.170 -r1.171
--- ChangeLog 19 Dec 2005 19:37:47 -0000 1.170
+++ ChangeLog 19 Dec 2005 20:54:05 -0000 1.171
@@ -2,6 +2,18 @@
Reviewed by Darin, committed by Adele.
+ - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6137
+ Disable kerning and some ligatures in the ATSUI code path
+
+ * fast/text/atsui-kerning-and-ligatures-expected.checksum: Added.
+ * fast/text/atsui-kerning-and-ligatures-expected.png: Added.
+ * fast/text/atsui-kerning-and-ligatures-expected.txt: Added.
+ * fast/text/atsui-kerning-and-ligatures.html: Added.
+
+2005-12-19 Mitz Pettel <opendarwin.org at mitzpettel.com>
+
+ Reviewed by Darin, committed by Adele.
+
- test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6132
Incorrect selection highlighting for ATSUI text when selected range is "CG-safe"
1.1 LayoutTests/fast/text/atsui-kerning-and-ligatures-expected.checksum
Index: atsui-kerning-and-ligatures-expected.checksum
===================================================================
7ae0ce5d0587c93f48878a63174f3895
1.1 LayoutTests/fast/text/atsui-kerning-and-ligatures-expected.png
<<Binary file>>
1.1 LayoutTests/fast/text/atsui-kerning-and-ligatures-expected.txt
Index: atsui-kerning-and-ligatures-expected.txt
===================================================================
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x36
RenderText {TEXT} at (0,0) size 53x18
text run at (0,0) width 53: "Test for "
RenderInline {I} at (0,0) size 751x36
RenderText {TEXT} at (53,0) size 751x36
text run at (53,0) width 698: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6137 Disable kerning and some ligatures in the ATSUI code"
text run at (0,18) width 28: "path"
RenderText {TEXT} at (28,18) size 4x18
text run at (28,18) width 4: "."
RenderBlock {P} at (0,52) size 784x18
RenderText {TEXT} at (0,0) size 709x18
text run at (0,0) width 709: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
RenderBlock {DIV} at (0,86) size 784x42
RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)]
RenderBlock (anonymous) at (0,14) size 784x28
RenderInline {SPAN} at (0,0) size 551x28
RenderText {TEXT} at (0,0) size 551x28
text run at (0,0) width 551: "AVAVAVAVAVfififififififi Lorem ipsum dolor sit ame\x{300}t"
RenderText {TEXT} at (0,0) size 0x0
selection start: position 37 of child 0 {TEXT} of child 3 {SPAN} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
selection end: position 42 of child 0 {TEXT} of child 3 {SPAN} of child 5 {DIV} of child 1 {BODY} of child 0 {HTML} of document
1.1 LayoutTests/fast/text/atsui-kerning-and-ligatures.html
Index: atsui-kerning-and-ligatures.html
===================================================================
<html>
<head>
<title></title>
<script type="text/javascript">
function test()
{
var t = document.getElementById("t").firstChild;
window.getSelection().setBaseAndExtent(t, 37, t, 42);
}
</script>
</head>
<body onload="test()">
<p>
Test for <i>http://bugzilla.opendarwin.org/show_bug.cgi?id=6137
Disable kerning and some ligatures in the ATSUI code path</i>.
</p>
<p>
The word “dolor” below should be highlighted in its entirety. The
highlight should not extend beyond that word.
</p>
<div style="font-size: 24px;">
<hr>
<span id="t">AVAVAVAVAVfififififififi Lorem ipsum dolor sit amèt</span>
</div>
</body>
</html>
1.3410 +14 -0 WebKit/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebKit/ChangeLog,v
retrieving revision 1.3409
retrieving revision 1.3410
diff -u -r1.3409 -r1.3410
--- ChangeLog 19 Dec 2005 19:37:49 -0000 1.3409
+++ ChangeLog 19 Dec 2005 20:54:07 -0000 1.3410
@@ -2,6 +2,20 @@
Reviewed by Darin, committed by Adele.
+ Test: fast/text/atsui-kerning-and-ligatures.html
+
+ - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6137
+ Disable kerning and some ligatures in the ATSUI code path
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (initializeATSUStyle): Disable kerning; disable ligatures unless the font
+ does not contain 'a', in which case it is assumed to never be rendered
+ by the CG code path.
+
+2005-12-19 Mitz Pettel <opendarwin.org at mitzpettel.com>
+
+ Reviewed by Darin, committed by Adele.
+
Test: fast/text/should-use-atsui.html
- fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=6132
1.205 +16 -4 WebKit/WebCoreSupport.subproj/WebTextRenderer.m
Index: WebTextRenderer.m
===================================================================
RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebTextRenderer.m,v
retrieving revision 1.204
retrieving revision 1.205
diff -u -r1.204 -r1.205
--- WebTextRenderer.m 19 Dec 2005 19:37:58 -0000 1.204
+++ WebTextRenderer.m 19 Dec 2005 20:54:15 -0000 1.205
@@ -1162,10 +1162,12 @@
CGAffineTransform transform = CGAffineTransformMakeScale(1, -1);
Fixed fontSize = FloatToFixed([renderer->font.font pointSize]);
- ATSUAttributeTag styleTags[] = { kATSUSizeTag, kATSUFontTag, kATSUFontMatrixTag};
- ByteCount styleSizes[] = { sizeof(Fixed), sizeof(ATSUFontID), sizeof(CGAffineTransform) };
- ATSUAttributeValuePtr styleValues[] = { &fontSize, &fontID, &transform };
- status = ATSUSetAttributes(renderer->_ATSUStyle, 3, styleTags, styleSizes, styleValues);
+ // Turn off automatic kerning until it is supported in the CG code path (6136 in bugzilla)
+ Fract kerningInhibitFactor = FloatToFract(1.0);
+ ATSUAttributeTag styleTags[4] = { kATSUSizeTag, kATSUFontTag, kATSUFontMatrixTag, kATSUKerningInhibitFactorTag };
+ ByteCount styleSizes[4] = { sizeof(Fixed), sizeof(ATSUFontID), sizeof(CGAffineTransform), sizeof(Fract) };
+ ATSUAttributeValuePtr styleValues[4] = { &fontSize, &fontID, &transform, &kerningInhibitFactor };
+ status = ATSUSetAttributes(renderer->_ATSUStyle, 4, styleTags, styleSizes, styleValues);
if (status != noErr)
FATAL_ALWAYS("ATSUSetAttributes failed (%d)", status);
status = ATSFontGetTable(fontID, 'prop', 0, 0, 0, &propTableSize);
@@ -1176,6 +1178,16 @@
else
FATAL_ALWAYS("ATSFontGetTable failed (%d)", status);
+ // Turn off ligatures such as 'fi' to match the CG code path's behavior, until bugzilla 6135 is fixed.
+ // Don't be too aggressive: if the font doesn't contain 'a', then assume that any ligatures it contains are
+ // in characters that always go through ATSUI, and therefore allow them. Geeza Pro is an example.
+ // See bugzilla 5166.
+ if ([[renderer->font.font coveredCharacterSet] characterIsMember:'a']) {
+ ATSUFontFeatureType featureTypes[] = { kLigaturesType };
+ ATSUFontFeatureSelector featureSelectors[] = { kCommonLigaturesOffSelector };
+ status = ATSUSetFontFeatures(renderer->_ATSUStyle, 1, featureTypes, featureSelectors);
+ }
+
renderer->ATSUStyleInitialized = YES;
}
}
More information about the webkit-changes
mailing list