2010-01-15 05:45:30 PST
Hello Tim,
This is a bug since v2.0.. unfortunately there is no easy fix.
The problem is that the italic text and the regular text are rendered as two separate TextComponents. The rendering code is not smart enough to make the needed calculations and align the two TextComponents correctly.
The solutions I am thinking for all these bugs (there are more similar rendering issues) is to make the TextComponent able to display complex text (different fonts, colors, etc). That way the text in your html example would be one single text component and thus rendered normally.
For now unfortunately the only way to have "centered" text is to have it as a single TextComponent, that means that all the text must belong to the same tag.
For example if you remove the italics tag (<i>) from "bar" the result will render correctly.
I plan to prepare the rich TextComponent for the 2.3 release but this depends heavily on the work load i will have the next months.
I hope I helped, sorry i could not provide a good solution for that.
regards,
--
pashalis.