Funny rendering of <center> and &l...

Developers
2010-01-14
2013-04-26
  • Timothy Bourke
    Timothy Bourke
    2010-01-14

    The first line of this file does not seem to be rendered properly in the latest revision (r207) of Fire 2.3 (and earlier versions):

    <?xml version="1.0" encoding="UTF-8" ?>
    <body>
    <center>
    <i>bar</i> not centered properly
    </center>
    <br/>
    <i>bar</i> not centered properly
    </body>
    

    The top "not centered properly" is displayed on top of the "foo".

    (I can post a cut-down example MIDlet if it helps.).

    Is there an easy fix?

    Tim.

     
  • Pashalis Padeleris
    Pashalis Padeleris
    2010-01-15

    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.

     
  • Timothy Bourke
    Timothy Bourke
    2010-01-15

    Thanks for the explanation Pashalis,

    I understand. And I sympathize with your work load. I'm only able to develop my app from time to time too.

    Best regards,

    Tim.