Menu

setRichTextWidth problem

Help
2003-09-25
2003-09-27
  • Peter Bienstman

    Peter Bienstman - 2003-09-25

    The following code doesn't seem to work as intended:

    t = karamba.createRichText(widget, 50*". ")
    karamba.setRichTextWidth(widget, t, 100)

    It prints out several lines of dots, but the width is not 100 pixels, but more like 90 pixels.

    Is this a bug?

     
    • Ryan Nickell

      Ryan Nickell - 2003-09-25

      For the most part, fonts don't use a pixel system when displaying on the screen. It's a point system.  Depending on the font in question it could be much smaller than the pixel size you want or much larger (although I haven't seen it end up larger) than you want.  I ran across this when trying to center text in iLaunch.  Hope this helps clear things up.
      cheers,
      -p0z3r

       
      • Peter Bienstman

        Peter Bienstman - 2003-09-25

        According to the API documentation, the argument to setRichTextWidth is in pixels, so I shouldn't need to care about what point sizes my fonts are, should I?

         
        • Ryan Nickell

          Ryan Nickell - 2003-09-27

          I think you are right after looking up the setRichTextWidth() call.. ("this function changes it's width to the specified value in pixels. ")
          I'll have to try it to see what it does on my machine and let you know if this is just you or everyone.
          cheers,
          -p0z3r

           

Log in to post a comment.