Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » Displaying Images in an SWT StyledText
Displaying Images in an SWT StyledText [message #63243] Tue, 09 December 2008 10:18 Go to next message
yaumunlam  is currently offline yaumunlam Friend
Messages: 33
Registered: July 2009
Member
Hi David,

as in
http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
"Images don't flow with the text", but why can't using font metrics to
compute the number of blank spaces required to create enough horizontal
space (in pixels) to display the image without obscuring text?

Thanks!

Yau.
Re: Displaying Images in an SWT StyledText [message #63268 is a reply to message #63243] Tue, 09 December 2008 17:19 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 135
Registered: July 2009
Senior Member
Yau wrote:
> Hi David,
>
> as in
> http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> "Images don't flow with the text", but why can't using font metrics to
> compute the number of blank spaces required to create enough horizontal
> space (in pixels) to display the image without obscuring text?
>
> Thanks!
>
> Yau.
>
>

Yau, this is in fact difficult to do. Of course it is possible to pad
the text with spaces to have the text flow around the image, however
adjusting text flow and wrap as the control is resized is more than just
tricky.

The best place to implement this feature is in the StyledText control.
Given that StyledText paints to a Canvas and already handles text flow
and wrap, it's entirely possible for StyledText to be modified to handle
images as well. I recommend that you work with the SWT team if you are
interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #63292 is a reply to message #63268] Wed, 10 December 2008 04:06 Go to previous messageGo to next message
yaumunlam  is currently offline yaumunlam Friend
Messages: 33
Registered: July 2009
Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

"David Green" <dgreen99@gmail.com> wrote in message
news:ghm9el$b9m$1@build.eclipse.org...
> Yau wrote:
> > Hi David,
> >
> > as in
> >
http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> > "Images don't flow with the text", but why can't using font metrics to
> > compute the number of blank spaces required to create enough horizontal
> > space (in pixels) to display the image without obscuring text?
> >
> > Thanks!
> >
> > Yau.
> >
> >
>
> Yau, this is in fact difficult to do. Of course it is possible to pad
> the text with spaces to have the text flow around the image, however
> adjusting text flow and wrap as the control is resized is more than just
> tricky.
>
> The best place to implement this feature is in the StyledText control.
> Given that StyledText paints to a Canvas and already handles text flow
> and wrap, it's entirely possible for StyledText to be modified to handle
> images as well. I recommend that you work with the SWT team if you are
> interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #63338 is a reply to message #63292] Wed, 10 December 2008 20:05 Go to previous message
David Green is currently offline David GreenFriend
Messages: 135
Registered: July 2009
Senior Member
Yau wrote:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

Based on Felipe's response to your bug, it appears as if it's already
possible to flow images with the text. I've created bug 258348 as a result:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=258348
Re: Displaying Images in an SWT StyledText [message #595374 is a reply to message #63243] Tue, 09 December 2008 17:19 Go to previous message
David Green is currently offline David GreenFriend
Messages: 96
Registered: July 2009
Member
Yau wrote:
> Hi David,
>
> as in
> http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> "Images don't flow with the text", but why can't using font metrics to
> compute the number of blank spaces required to create enough horizontal
> space (in pixels) to display the image without obscuring text?
>
> Thanks!
>
> Yau.
>
>

Yau, this is in fact difficult to do. Of course it is possible to pad
the text with spaces to have the text flow around the image, however
adjusting text flow and wrap as the control is resized is more than just
tricky.

The best place to implement this feature is in the StyledText control.
Given that StyledText paints to a Canvas and already handles text flow
and wrap, it's entirely possible for StyledText to be modified to handle
images as well. I recommend that you work with the SWT team if you are
interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #595382 is a reply to message #63268] Wed, 10 December 2008 04:06 Go to previous message
yaumunlam  is currently offline yaumunlam Friend
Messages: 33
Registered: July 2009
Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

"David Green" <dgreen99@gmail.com> wrote in message
news:ghm9el$b9m$1@build.eclipse.org...
> Yau wrote:
> > Hi David,
> >
> > as in
> >
http://greensopinion.blogspot.com/2008/09/beyond-rich-text-d isplaying-images-in.html ,
> > "Images don't flow with the text", but why can't using font metrics to
> > compute the number of blank spaces required to create enough horizontal
> > space (in pixels) to display the image without obscuring text?
> >
> > Thanks!
> >
> > Yau.
> >
> >
>
> Yau, this is in fact difficult to do. Of course it is possible to pad
> the text with spaces to have the text flow around the image, however
> adjusting text flow and wrap as the control is resized is more than just
> tricky.
>
> The best place to implement this feature is in the StyledText control.
> Given that StyledText paints to a Canvas and already handles text flow
> and wrap, it's entirely possible for StyledText to be modified to handle
> images as well. I recommend that you work with the SWT team if you are
> interested in such a feature.
Re: Displaying Images in an SWT StyledText [message #595406 is a reply to message #63292] Wed, 10 December 2008 20:05 Go to previous message
David Green is currently offline David GreenFriend
Messages: 96
Registered: July 2009
Member
Yau wrote:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=258228

Based on Felipe's response to your bug, it appears as if it's already
possible to flow images with the text. I've created bug 258348 as a result:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=258348
Previous Topic:Displaying data from database with WikiText
Next Topic:WikiText Textile-generated HTML Misrenders in Eclipse Help System
Goto Forum:
  


Current Time: Mon Dec 22 02:18:33 GMT 2014

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

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