Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Help! Wordwrap in DelphiX?

  1. #11

    Re: Help! Wordwrap in DelphiX?

    I'm not "going to make", i already did (the text printing part)

    The lib is using OpenGL so simple glColor() works with it, as well as blending, scaling effects. Distortion (ripple/wave etc) effects need custom rendering but i realize that i still miss simple bold/italic switches... And enough of that offtopic this thread...

  2. #12

    Re: Help! Wordwrap in DelphiX?

    A little news from the OpenGL based Memo component... It came to be different than i expected but here's the key things:
    - TStringList does not have any automatic feature for wrapping. VCL TMemo might have but i wont use it.
    - I can't simply go through characters and do line changes where i want, then the scrollbars would not work line-by-line.
    - The line changes are made in separate Update procedure, by adding for example character #30 (almost anything between 0..31 except 10 or 13) and a real line-break char. So then, when memo is resized bigger and wrapping is changed, the character and line change can be removed knowing where it is. This character is ignored when drawing, and removed when saving.
    All in all: TStringList.Strings[] array will be properly wrapped before rendering.
    - Using scrollbar up and down is easy this way, but left and right (when wrapping is disabled) is more complicated. This requires to "virtually" move the caret from left side until first visible letter comes.

  3. #13

    Re: Help! Wordwrap in DelphiX?

    If you know the max width to display 'each' line of text, there is a function on Delphi called WrapText(), it's break to be displayed on that width...

  4. #14

    Re: Help! Wordwrap in DelphiX?

    My functions are all finished now, and WrapText() doesn't seem to give a alternate solution. It cuts between certain number of characters, not by how much they take in pixels. Also i would need to keep in memory both unwrapped and wrapped strings if i wanted to resize the text area. (edit: or worse/slower, call WrapText() each time Drawing happens)

Page 2 of 2 FirstFirst 12


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Comodo SSL