centering a jit.lcd text ?


    Mar 24 2011 | 5:41 pm
    hello,
    I need to center a text dynamically feeding a jit.lcd on the Xaxis (width)
    Sentences aren't the same size.
    At first, I tried to do that:
    Xposition = (Width / 2. - (Number of characters * size of font) / 2. )
    If the logic is ok, I have problems probably with space between letters + the value of "size of font"
    Indeed, the fontsize is given in ...?
    I guess it isn't event in pixel unit so
    any ideas? advices?
    best,
    julien

    • Mar 24 2011 | 6:07 pm
      did you study jitter recipes, Book 3, patch 28? (attached below)
      It doesn't use the jit.lcd as in your examples, instead it uses openGL and jit.gl.text2d... worth a look in any case!
    • Mar 24 2011 | 6:19 pm
      hello,
      I'm quite ok with jit.gl.text2d but I understood that it doesn't offer unicode for windows.
      how can I work with accentuation etc ?
      I'll subtitle in french + spanish so .. accentuation is a must.
      I especially used jit.lcd because I believed it was impossible to use accentuation with jit.gl.text2d
      can you help me with that?
    • Mar 25 2011 | 8:56 am
      jit.gl.text2d doesn't seem to display my accentuation character BUT maybe it isn't the unicode limitation...
      in that post http://cycling74.com/forums/topic.php?id=31974 , I figured out I had problem with jit.lcd too :-/
      any ideas/advices?
      all the best,
      julien