When setting bold and italic text attributes on outgoing
messages, they don't show up in the MSN client.
When setting italics text attribute on text "italics", the
message seen on the MSN client is "italicitalic".
Here is the code I am using to set bold/italics attributes:
static private void newText( Message m,
String text,
boolean bBold,
boolean bItalic,
int red, int green, int blue ) {
if ( text.length() == 0 ) return;
TextComponent t = new TextComponent( text );
int style = 0;
if ( bBold ) style += Font.BOLD;
if ( bItalic ) style += Font.ITALIC;
t.setColor( new Color(red, green, blue ) );
Font defaultFont = new Font("SansSerif",style,10);
t.setFont(defaultFont);
m.addComponent(t);
}
Logged In: YES
user_id=907576
This problem also extends to text color and fontsize.
I've written a bot that loops through RGB-values and sends a
message in each color. This results in only 4 different colors in
MSN client: black, green, yellow and red. All other colors are
apparently being mapped to one of these four.
Another loop that sends messages in increasing fontsizes had
no effect at all (all 72 messages looked exactly the same).
Logged In: YES
user_id=907576
Ok, since my previous message I've learnt that there's no
such thing as fontsizes in MSN Messenger.
There are fonts and color however, and these did not come
across properly due to 2 bugs in the MSNMessage class
constructor for outgoing messages.
One bug caused the "FN=" prefix to be overwritten by the
fontname. Fonts were therefor not recognised by MSN Official
Client.
The other bug prepended a "0" character before green and
red color values if their respective int-value was GREATER
than 15 instead of smaller than or equal to 15.
Both bugs are fixed in the attached sourcefile.