[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:42:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 09e2c4953db163880e2fc4618b347f41d761ceb7
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat May 29 00:07:44 2004 +0000
Reviewed by Maciej.
* WebView.subproj/WebHTMLView.m: (-[WebHTMLView _fontManagerOperationAsStyle]):
First cut at figuring out what operation the font manager is doing without
digging into its private data structures.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 204120d..98eb522 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,13 @@
2004-05-28 Darin Adler <darin at apple.com>
+ Reviewed by Maciej.
+
+ * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _fontManagerOperationAsStyle]):
+ First cut at figuring out what operation the font manager is doing without
+ digging into its private data structures.
+
+2004-05-28 Darin Adler <darin at apple.com>
+
Reviewed by Ken.
- various editing-related improvements
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index 7575e8e..620eb75 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -19,6 +19,7 @@
"%@:%u"
"%@://%@"
"%d"
+"%dpx"
","
"- %s:%d %s - "
"/"
@@ -359,6 +360,9 @@ WebCoreSupport.subproj/WebTextRendererFactory.m:"Geeza Pro"
WebCoreSupport.subproj/WebTextRendererFactory.m:"Pashto"
WebCoreSupport.subproj/WebTextRendererFactory.m:"Urdu"
WebView.subproj/WebDataSource.m:"Refresh"
+WebView.subproj/WebHTMLView.m:"bold"
+WebView.subproj/WebHTMLView.m:"italic"
+WebView.subproj/WebHTMLView.m:"normal"
WebView.subproj/WebPreferences.m:"Identifier"
WebView.subproj/WebPreferences.m:"Values"
WebView.subproj/WebPreferences.m:"WebPreferences%d"
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index 28d2ae8..2594d37 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -2350,9 +2350,44 @@ static WebHTMLView *lastHitView = nil;
{
WebBridge *bridge = [self _bridge];
DOMCSSStyleDeclaration *style = [[bridge DOMDocument] createCSSStyleDeclaration];
- //NSFontManager *fontManager = [NSFontManager sharedFontManager];
- //NSFont *font = [fontManager convertFont:[NSFont]]
- // FIXME: Figure out what style change to apply!
+
+ NSFontManager *fm = [NSFontManager sharedFontManager];
+
+ NSFont *a = [fm convertFont:[fm fontWithFamily:@"Helvetica" traits:0 weight:5 size:10]];
+ NSFont *b = [fm convertFont:[fm fontWithFamily:@"Times" traits:(NSBoldFontMask | NSItalicFontMask) weight:10 size:12]];
+
+ NSString *fa = [a familyName];
+ NSString *fb = [a familyName];
+ if ([fa isEqualToString:fb]) {
+ [style setFontFamily:fa];
+ }
+
+ int sa = [a pointSize];
+ int sb = [b pointSize];
+ if (sa == sb) {
+ [style setFontSize:[NSString stringWithFormat:@"%dpx", sa]];
+ }
+
+ int wa = [fm weightOfFont:a];
+ int wb = [fm weightOfFont:b];
+ if (wa == wb) {
+ if (wa >= 9) {
+ [style setFontWeight:@"bold"];
+ } else {
+ [style setFontWeight:@"normal"];
+ }
+ }
+
+ BOOL ia = ([fm traitsOfFont:a] & NSItalicFontMask) != 0;
+ BOOL ib = ([fm traitsOfFont:b] & NSItalicFontMask) != 0;
+ if (ia == ib) {
+ if (ia) {
+ [style setFontStyle:@"italic"];
+ } else {
+ [style setFontStyle:@"normal"];
+ }
+ }
+
return style;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list