adium-1.4 2660:6a8a206aa8af: Address a few font issues that have...

commits at adium.im commits at adium.im
Wed Oct 28 05:57:48 UTC 2009


details:	http://hg.adium.im/adium-1.4/rev/6a8a206aa8af
revision:	2660:6a8a206aa8af
author:		Zachary West <zacw at adium.im>
date:		Wed Oct 28 01:57:39 2009 -0400

Address a few font issues that have cropped up recently. Fixes #12906.

In previous releases of Adium, we would drop (in a few situations) the font tag information for outgoing messages if it was Helvetica sized 12. This, of course, was terribly confusing: if you specified any attributes, such as color, weight, decoration, etc., it forced Helvetica again.

In Snow Leopard, Apple started including the background color by default in our attributed strings, which has been causing us to, once again, force font tags in situations where we wouldn't before. Sometimes you'd see Helvetica, sometimes you wouldn't. Confusing.

Instead of trying to send plaintext, which we failed at in a good amount of situations (and all situations in SL), we now always send the font information. This was done by removing the forced Helvetica/12 assumptions in the HTML decoder.

We also respect the "show message fonts" preference for outgoing messages on top of incoming. This was another part of the confusing affects that a non-forced default of Helvetica was causing. Outgoing would appear Helvetica, incoming would be the non-allowed default WKMV font.

I tried to approach this as "strip the background color when foreground isn't specified, go back to the way the old things were" but its behavior was just honestly  confusing. Let's be consistent in some way.

diffs (34 lines):

diff -r 418ff98620bf -r 6a8a206aa8af Frameworks/Adium Framework/Source/AIHTMLDecoder.m
--- a/Frameworks/Adium Framework/Source/AIHTMLDecoder.m	Tue Oct 27 22:45:52 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIHTMLDecoder.m	Wed Oct 28 01:57:39 2009 -0400
@@ -249,10 +249,10 @@
 	}	
 	
 	//Setup the default attributes
-	NSString		*currentFamily = [@"Helvetica" retain];
+	NSString		*currentFamily = nil;
 	NSString		*currentColor = nil;
 	NSString		*currentBackColor = nil;
-	int				 currentSize = 12;
+	int				 currentSize = 0;
 	BOOL			 currentItalic = NO;
 	BOOL			 currentBold = NO;
 	BOOL			 currentUnderline = NO;
diff -r 418ff98620bf -r 6a8a206aa8af Plugins/WebKit Message View/AIWebkitMessageViewStyle.m
--- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m	Tue Oct 27 22:45:52 2009 -0700
+++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m	Wed Oct 28 01:57:39 2009 -0400
@@ -703,12 +703,8 @@
 	 */
 	NSString		*htmlEncodedMessage = [AIHTMLDecoder encodeHTML:[content message]
 															headers:NO 
-														   fontTags:([content isOutgoing] ?
-																	 YES :
-																	 showIncomingFonts)
-												 includingColorTags:(allowsColors ?
-																	 ([content isOutgoing] ? YES : showIncomingColors) :
-																	 NO)
+														   fontTags:showIncomingFonts
+												 includingColorTags:showIncomingColors
 													  closeFontTags:YES
 														  styleTags:YES
 										 closeStyleTagsOnFontChange:YES




More information about the commits mailing list