|
Re: Rendering tabs in text with Draw2d [message #189843 is a reply to message #189812] |
Fri, 29 July 2005 18:39 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
It really depends on the behavior you want for the tabs. If you need
center, right, and decimal align, it probably requires a complex solution.
Just jumping to the next multiple of N pixels could be done by some extended
interface on the context which inserts a spacing fragment or something. Or,
maybe you could insert the spacing from the TextFlow by checking how much
space is used in the LineBox.
"Joshua Knauer" <joshua.knauer@businessobjects.com> wrote in message
news:dcdns2$cmm$1@news.eclipse.org...
> Hi,
>
> I'm looking into the best way to render tabs with draw2d. Currently \t is
> not rendered at all by TextFlow, which is probably the correct behaviour
> :)
> I'm considering a couple of options:
>
> 1) Create a new textflow of a fixed width for each tab character and just
> use the regular ParagraphTextLayout. The obvious problem with this is
> that
> my tabs will not line up nicely across lines, which is kind of what tabs
> are
> for, no I wouldn't call this a very good solution :) Has anyone tried
> this
> approach before? I'm assuming this will be a quick and easy fix, but am I
> missing something that will come back to bite me?
>
> 2) Create a new TextLayout that takes tabs into account. This seems like
> the correct way to deal with the problem, but will be much more work. Has
> anyone done this before?
>
> Are there other options that I'm not aware of? If anyone knows of an
> example of someone else rendering tabs with draw2d that I could use as a
> reference it would be much appreciated :)
>
> Thanks,
>
> Josh
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03249 seconds