[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: How to set different fonts into the same StyledText widget?

Paul, regarding your statement below:

"just note that after you have set a StyleRange of length N, the StyledText
widget will behind the scenes break it
into N StyleRanges of length 1)."

could you please give me a snippet of code that demonstrates this problem?
I'm curious as to what conditions lead to this behavior.  The only
manipulation of style ranges that the StyledText widget does is to merge
styles - not break up styles, so I don't quite understand how this is
occurring. But if what you say is indeed occurring, this is a bug.

"Paul T. Keyser" <rolarenfan@xxxxxxxxxxxxx> wrote in message
news:3F21BD2D.8FDE7DAE@xxxxxxxxxxxxxxxx
> You need to be using the "StyleRange" interface (rather complicated -- but
the
> javadoc will tell you most of what you need; just note that after you have
set
> a StyleRange of length N, the StyledText widget will behind the scenes
break it
> into N StyleRanges of length 1).
>
> HTH,
> Paul K
>
> Johnny Lo wrote:
>
> > Hi,
> >
> > I need to set differnt fonts and sizes for the text that is set in the
same
> > StyledText widget. But when I call setFont() method it will just apply
the
> > change to the whole text instead of part of the text. Is there any way I
> > could set different fonts and sizes to the text with StyledText widget?
Or
> > should I use TextViewer from JFace?
> >
> > Thanks for helping
> >
> > Johnny
>