Possible bug in TEXFIELD wordwrap text-align:center; and renderer="webgl"

  • Hello, I have an issue with a distorted hotspot type="text". I try to set CSS: text-align:center; and wordwrap="true". Depending of the text lenght it works fine or not.

    Same code for both pictures. I've only changed "CASA" by "CAS" no more changes in the code.



    CODE:


    <hotspot name="nom"
    bgcolor="0xe1c334"
    type="text"
    enabled="false"
    visible="true"
    width="240px"
    height="70px"
    edge="center"
    html="LA MEJOR CASA DEL MUNDO MUNDIAL"
    css="color:0xffffff; font-family:CenturyGothic,Geneva,AppleGothic,sans-serif;font-size:18px; text-align:center; "
    wordwrap="true"
    vcenter="true"
    keep="true"
    zorder="40" />

    PD: I can't change to renderer to css3d (then it center fine) because I have an action that rotate the text syncronized with the view and if I change the rendere doesn't work.

  • Hi,

    which browser?
    Safari?

    There is unfortunately a known Safari bug with that - the box-sizes that Safari provides for the words don't match the actual rendering or a slightly too inaccurate for correct calculations.

    It works that way: the browser provides several 'bounding-boxes' for the words to render and these boxes can contain one or more words, but the exact information which word to render where is not available. So krpano then tries to fill these boxes with the available words from the text - and when there is a difference between the box-width and the summed-width of the words then such can happen and a word wouldn't into the correct box and get into the next one.

    The general problem here are too limited browser APIs for rendering HTML to a texture image and such workarounds by manually rendering the html text somehow are also limited by the information and the accuracy of the information that the browser provides.

    That means there is unfortunately currently no general solution that is guaranteed to work in all cases.

    When such happens it can be a workaround to slightly modify the html text code a bit, maybe a blank or any empty <span> here and there to get the browser to providing different information can will render properly.

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!