Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » StyledText multiple font support
StyledText multiple font support [message #441262] Thu, 12 August 2004 16:52 Go to next message
Simone Gianni is currently offline Simone GianniFriend
Messages: 29
Registered: July 2009
Junior Member
Hi all,
does anybody knows about a StyledText or similar custom widget that also
supports different fonts and/or different font-sizes? Or any plan to do
something in that direction?

This improvement would open the way for WYSIWYG text editing in SWT, to
code something more similar to a WordPad than to a NotePad.

I've red the full source code for StyledText, and it could be easy to
add this as long as lines are all the same height (thus fonts have all
"similar" sizes). Anyway, to support different font sizes, all the
places where a pixel<->line conversion occurrs should be changed (and
there are many); also, this conversion should check the height of all
the lines to obtain the y position of a single line, and this could lead
to a great performance issue, but i'm sure there are already
consolidated strategies out there to solve this problems.

Does anyone knows something? Is anyone interested in it?

Ciao,
Simone Gianni
Re: StyledText multiple font support [message #441270 is a reply to message #441262] Thu, 12 August 2004 20:52 Go to previous messageGo to next message
Michael Brown is currently offline Michael BrownFriend
Messages: 20
Registered: July 2009
Junior Member
"Simone Gianni" <s.gianni@thebug.it> wrote in message
news:cfg74p$8el$1@eclipse.org...
> Hi all,
> does anybody knows about a StyledText or similar custom widget that also
> supports different fonts and/or different font-sizes? Or any plan to do
> something in that direction?
>
> This improvement would open the way for WYSIWYG text editing in SWT, to
> code something more similar to a WordPad than to a NotePad.
>
> I've red the full source code for StyledText, and it could be easy to
> add this as long as lines are all the same height (thus fonts have all
> "similar" sizes). Anyway, to support different font sizes, all the
> places where a pixel<->line conversion occurrs should be changed (and
> there are many); also, this conversion should check the height of all
> the lines to obtain the y position of a single line, and this could lead
> to a great performance issue, but i'm sure there are already
> consolidated strategies out there to solve this problems.
>
> Does anyone knows something? Is anyone interested in it?
>
> Ciao,
> Simone Gianni

I'd be happy to see the StyledText box support a few more attributes then
just bold and italic. Specifically, underline would be very useful to me.

Mike
Re: StyledText multiple font support [message #441388 is a reply to message #441262] Fri, 13 August 2004 15:05 Go to previous messageGo to next message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
Please enter a Bugzilla feature request asking for multi-font StyledText.
In the feature request, please say why you need it.
Please get others who want this also to add themselves to the CC list and
say why they need it.
Thanks,
Carolyn

"Simone Gianni" <s.gianni@thebug.it> wrote in message
news:cfg74p$8el$1@eclipse.org...
> Hi all,
> does anybody knows about a StyledText or similar custom widget that also
> supports different fonts and/or different font-sizes? Or any plan to do
> something in that direction?
>
> This improvement would open the way for WYSIWYG text editing in SWT, to
> code something more similar to a WordPad than to a NotePad.
>
> I've red the full source code for StyledText, and it could be easy to
> add this as long as lines are all the same height (thus fonts have all
> "similar" sizes). Anyway, to support different font sizes, all the
> places where a pixel<->line conversion occurrs should be changed (and
> there are many); also, this conversion should check the height of all
> the lines to obtain the y position of a single line, and this could lead
> to a great performance issue, but i'm sure there are already
> consolidated strategies out there to solve this problems.
>
> Does anyone knows something? Is anyone interested in it?
>
> Ciao,
> Simone Gianni
Re: StyledText multiple font support [message #441389 is a reply to message #441270] Fri, 13 August 2004 15:05 Go to previous messageGo to next message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
There is already a feature request for underline:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=71901
Please add yourself to the CC list if you would like to track its progress.

Thanks,
Carolyn

"Michael Brown" <mab@purdue.edu> wrote in message
news:cfgl68$v62$1@eclipse.org...
>
> "Simone Gianni" <s.gianni@thebug.it> wrote in message
> news:cfg74p$8el$1@eclipse.org...
> > Hi all,
> > does anybody knows about a StyledText or similar custom widget that also
> > supports different fonts and/or different font-sizes? Or any plan to do
> > something in that direction?
> >
> > This improvement would open the way for WYSIWYG text editing in SWT, to
> > code something more similar to a WordPad than to a NotePad.
> >
> > I've red the full source code for StyledText, and it could be easy to
> > add this as long as lines are all the same height (thus fonts have all
> > "similar" sizes). Anyway, to support different font sizes, all the
> > places where a pixel<->line conversion occurrs should be changed (and
> > there are many); also, this conversion should check the height of all
> > the lines to obtain the y position of a single line, and this could lead
> > to a great performance issue, but i'm sure there are already
> > consolidated strategies out there to solve this problems.
> >
> > Does anyone knows something? Is anyone interested in it?
> >
> > Ciao,
> > Simone Gianni
>
> I'd be happy to see the StyledText box support a few more attributes then
> just bold and italic. Specifically, underline would be very useful to me.
>
> Mike
>
>
Re: StyledText multiple font support [message #441423 is a reply to message #441262] Sun, 15 August 2004 18:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tami.acm.org

Multiple font support would be greatly desirable to me.

Simone Gianni wrote:

> Hi all,
> does anybody knows about a StyledText or similar custom widget that also
> supports different fonts and/or different font-sizes? Or any plan to do
> something in that direction?
>
> This improvement would open the way for WYSIWYG text editing in SWT, to
> code something more similar to a WordPad than to a NotePad.
>
> I've red the full source code for StyledText, and it could be easy to
> add this as long as lines are all the same height (thus fonts have all
> "similar" sizes). Anyway, to support different font sizes, all the
> places where a pixel<->line conversion occurrs should be changed (and
> there are many); also, this conversion should check the height of all
> the lines to obtain the y position of a single line, and this could lead
> to a great performance issue, but i'm sure there are already
> consolidated strategies out there to solve this problems.
>
> Does anyone knows something? Is anyone interested in it?
>
> Ciao,
> Simone Gianni
Re: StyledText multiple font support [message #441447 is a reply to message #441423] Mon, 16 August 2004 14:30 Go to previous messageGo to next message
Simone Gianni is currently offline Simone GianniFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Tamilyn,
i started making some experiments. The first I'm trying to do is to
remove the lineHeight field from the widget, and move the lineHeight
calculations to the styler, using :

int getLineHeight(int line)
int getLineVerticalPosition(int line)
int getLineForPosition(int y)
int getTotalHeight()

This is to solve the main problem i found : changing the font is not so
difficult, and the widget already supports different widths (bold fonts
are ususally larger, also if it uses an average width that will cause
some problems when the fonts are really different) while it assumes all
the lines have the same height.

In our case, the height of the line is the height of the bigger font,
and this value will have to be cached since quite often a full-scan is
needed.

I also have some problems with font baselines.

Would you like to jump in?

Ciao,
Simone Gianni


Tamilyn Crawford wrote:

> Multiple font support would be greatly desirable to me.
>
> Simone Gianni wrote:
>
>> Hi all,
>> does anybody knows about a StyledText or similar custom widget that
>> also supports different fonts and/or different font-sizes? Or any plan
>> to do something in that direction?
>>
>> This improvement would open the way for WYSIWYG text editing in SWT,
>> to code something more similar to a WordPad than to a NotePad.
>>
>> I've red the full source code for StyledText, and it could be easy to
>> add this as long as lines are all the same height (thus fonts have all
>> "similar" sizes). Anyway, to support different font sizes, all the
>> places where a pixel<->line conversion occurrs should be changed (and
>> there are many); also, this conversion should check the height of all
>> the lines to obtain the y position of a single line, and this could
>> lead to a great performance issue, but i'm sure there are already
>> consolidated strategies out there to solve this problems.
>>
>> Does anyone knows something? Is anyone interested in it?
>>
>> Ciao,
>> Simone Gianni
Re: StyledText multiple font support [message #441519 is a reply to message #441388] Mon, 16 August 2004 19:30 Go to previous message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
Actually, after searching more carefully (and on the assumption that this
feature request *must* exist somewhere) I see that the request for a
multi-font text editor (with underline, etc) is already in Bugzilla, with
the title "Implement RichText editor for SWT".

Please add yourselves to the CC list of this feature request to track
progress:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=54426

Carolyn

"Carolyn MacLeod" <Carolyn_MacLeod@ca.ibm.com> wrote in message
news:cfil6d$la4$1@eclipse.org...
> Please enter a Bugzilla feature request asking for multi-font StyledText.
> In the feature request, please say why you need it.
> Please get others who want this also to add themselves to the CC list and
> say why they need it.
> Thanks,
> Carolyn
>
> "Simone Gianni" <s.gianni@thebug.it> wrote in message
> news:cfg74p$8el$1@eclipse.org...
> > Hi all,
> > does anybody knows about a StyledText or similar custom widget that also
> > supports different fonts and/or different font-sizes? Or any plan to do
> > something in that direction?
> >
> > This improvement would open the way for WYSIWYG text editing in SWT, to
> > code something more similar to a WordPad than to a NotePad.
> >
> > I've red the full source code for StyledText, and it could be easy to
> > add this as long as lines are all the same height (thus fonts have all
> > "similar" sizes). Anyway, to support different font sizes, all the
> > places where a pixel<->line conversion occurrs should be changed (and
> > there are many); also, this conversion should check the height of all
> > the lines to obtain the y position of a single line, and this could lead
> > to a great performance issue, but i'm sure there are already
> > consolidated strategies out there to solve this problems.
> >
> > Does anyone knows something? Is anyone interested in it?
> >
> > Ciao,
> > Simone Gianni
>
>
Previous Topic:SWT Browser & Mozilla
Next Topic:IActionDelegate2 "Internal plug-in action delegate error on creation."
Goto Forum:
  


Current Time: Thu Apr 25 07:13:45 GMT 2024

Powered by FUDForum. Page generated in 0.03731 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top