Recent

Author Topic: wrap text around image  (Read 11419 times)

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: wrap text around image
« Reply #15 on: September 25, 2016, 08:36:17 pm »
I tried to attached the PDF. It starts at page 91. It is too large for the system.
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: wrap text around image
« Reply #16 on: September 25, 2016, 09:27:31 pm »
Attached is a zipped (RTF) excerpt from the PDF.

When it comes down to it... I don't know if RichMemo can work with it.
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2283
    • havefunsoft.com
Re: wrap text around image
« Reply #17 on: September 26, 2016, 03:41:13 am »
I tried MS Word Office 2010. It saves the image and apparently is using the new tags.
However Wordpad won't open the inserted image.
« Last Edit: September 26, 2016, 03:46:11 am by skalogryz »
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: wrap text around image
« Reply #18 on: September 26, 2016, 01:13:53 pm »
Yes, I checked with my programs, and only OpenOffice could display it as a wrapped image. It was also resizable and movable. Some of the others could not load the image. RichMemo loaded it, but as an inline.

The Specification document said that it presents the accumulated RTF codes from 1987 to 2007. So they are dependent on what year our RTF engine was compiled.

I expect that WordPad is a very old program, and its continued development was stopped. Ours is apparently newer, since we can read and process the image, and it knows to ignore the frame attributes that it is built with. I was able to resize and move the image.

That might mean that there are still codes within it that could do the job, but they are Beta functions with different nomenclature. If we could find a specification sheet for our generation of RTF, or perhaps a list of experimental functions, we could have a chance at it.

Rick
« Last Edit: September 26, 2016, 01:18:21 pm by rick2691 »
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: wrap text around image
« Reply #19 on: September 26, 2016, 08:18:52 pm »
It looks like \WrapAround is the innovation of RTF 1.9. The \shpwr is older. So far I have found it in 1.5. Yet just as old is a predecessor to \WrapAround. It is named \WrapText. \WrapAround has replaced it.

Now I have to find some examples on how to implement either \wraptext or \shpwr.

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

rick2691

  • Sr. Member
  • ****
  • Posts: 375
Re: wrap text around image
« Reply #20 on: September 27, 2016, 06:44:53 pm »
I tried wraptext and \shpwr methods. Couldn't get them to work... so I give up.

Rick
Windows 10, LAZ 1.6.4, FPC 3.0.2, SVN 54278, i386-win32-win32/win64, forms use windows unit

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2283
    • havefunsoft.com
Re: wrap text around image
« Reply #21 on: September 27, 2016, 06:45:53 pm »
I tried wraptext and \shpwr methods. Couldn't get them to work... so I give up.
way to go.

Make your version 1.0. without, and use Kmemo for version 2.0 :)
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

tk

  • Sr. Member
  • ****
  • Posts: 364
Re: wrap text around image
« Reply #22 on: October 17, 2016, 11:21:18 pm »
I've just found this thread and as I am the KMemo maintainer I have some remarks for clarification:

1. KMemo rtf reader and writer uses \shpwr and \shpwrk control words, not \wraparound.  Only rectangular wrap is supported now, not tight wrap.
2. Never tried rtf saved from KMemo in Windows XP, don't have already. But under Win7/8/10 (MS Word 2007 and above) I was not aware of some problems in this regard.
3. I've used the RTF spec 1.9 to implement the RTF streaming.
4. Because the RTF specification does not much care about details, it is true that every word processor saves its own version. Simple things work almost everywhere but embedded objects (shapes, images, tables, lists) are mess. With KMemo, I've tested with MS Word most of the time because AFAIK it is where the RTF specification comes from. Unfortunately that means that eg. Libreoffice Writer did not accept some tags from MS Word and vice versa (last year tested, don't know anymore what exactly).

You sure are selling KMemo.

skalogryz: Seems that you could sell KMemo for me when it is mature :D

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2283
    • havefunsoft.com
Re: wrap text around image
« Reply #23 on: October 18, 2016, 04:14:04 am »
I've just found this thread and as I am the KMemo maintainer I have some remarks for clarification:

1. KMemo rtf reader and writer uses \shpwr and \shpwrk control words, not \wraparound.  Only rectangular wrap is supported now, not tight wrap.
is there a sample available?

skalogryz: Seems that you could sell KMemo for me when it is mature :D
You just need to find more contributors and maybe more feedback.

The most important are language and input experienced contributors, such as rick2691.
Any 3d party "rich-edit" is typically killed by supporting western languages only, making windows RichEdit-based solution (i.e. RichMemo) the only option.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

tk

  • Sr. Member
  • ****
  • Posts: 364
Re: wrap text around image
« Reply #24 on: October 18, 2016, 02:59:16 pm »
is there a sample available?
It should work when you create a rtf document in MS word with that alignments and load it to kmemo.
Actually yesterday I've experimented again with some more complex documents (with positioned objects etc., because I now work on the shape/image anchors and sizing grips) and I could even find differences between Word 2007 and 2010.
I'll investigate more.

You just need to find more contributors and maybe more feedback.
Yes, but mainly I need to have more time for this and not to be as lazy as I am :D

Any 3d party "rich-edit" is typically killed by supporting western languages only, making windows RichEdit-based solution (i.e. RichMemo) the only option.
Actually because I am Czech guy I cared much about language support, but of course not for every language. Especially not for far east and arabic languages which I don't know at all, there native speaking contributors would be very welcome. Though, I think Delphi RichView - which is 3-rd party rich edit component- behaves very well in this regard. For me/us, important thing is that kmemo compiles both in Delphi and Lazarus, what was my primary goal to even create it.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2283
    • havefunsoft.com
Re: wrap text around image
« Reply #25 on: October 18, 2016, 04:55:06 pm »
It should work when you create a rtf document in MS word with that alignments and load it to kmemo.
Actually yesterday I've experimented again with some more complex documents (with positioned objects etc., because I now work on the shape/image anchors and sizing grips) and I could even find differences between Word 2007 and 2010.
I'll investigate more.
MS Word creates very sluggish RTFs, with bunch of MS word specific tags in it.
Looking for a lightweight example.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

tk

  • Sr. Member
  • ****
  • Posts: 364
Re: wrap text around image
« Reply #26 on: October 19, 2016, 08:07:27 pm »
Looking for a lightweight example.

See attached document, saved with my recent version of KMemo.
Opens fine in Word 2007,2010.
And vice versa.

Did not try RichMemo (or Rich edit control in Delphi).
But in my Total Commander previewer the image does not show up (actually no image at all, because it probably uses some old Windows richedit control without any imaging support).

The image doesn't show up in Wordpad either, because Wordpad a)supports only inline images, b)clearly supports only images saved as windows metafile. You must save a png or jpeg as the old deprecated windows metafile  (not the enhanced one) in the rtf to support old M$ apps. Welcome to the M$ world.


skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2283
    • havefunsoft.com
Re: wrap text around image
« Reply #27 on: October 19, 2016, 09:24:24 pm »
Thanks for the sample.

Did not try RichMemo (or Rich edit control in Delphi).
The point is to force richedit to draw images wrapped.
Imho, it is not possible until Windows (whatever) (my grandkids will probably patch RichMemo for that).
« Last Edit: October 19, 2016, 09:26:25 pm by skalogryz »
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz