possible bug -direction IM 6.7.0.2 Q16
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
possible bug -direction IM 6.7.0.2 Q16
IM 6.7.0.2 Q16 Mac OSX TIGER.
The following fails, assuming I understand what -direction right-to-left is supposed to do.
convert -background lightblue -fill blue -pointsize 48 -font Arial -direction right-to-left label:"ABCDEFG" tmp.png
The resulting image is only the letter A.
see also viewtopic.php?f=3&t=18868
The following fails, assuming I understand what -direction right-to-left is supposed to do.
convert -background lightblue -fill blue -pointsize 48 -font Arial -direction right-to-left label:"ABCDEFG" tmp.png
The resulting image is only the letter A.
see also viewtopic.php?f=3&t=18868
Re: possible bug -direction IM 6.7.0.2 Q16
We'll get a patch into ImageMagick 6.7.0-4 Beta by sometime tomorrow to fix the problem you reported.
Re: possible bug -direction IM 6.7.0.2 Q16
magick:
results are not good, besides direction is correct. I use Microsoft Visual Studio 2008 Version 9.0.30729.1, it compiles with no errors or warnings but i have a broken convert.exe output, both in terms of render and characters, as (in arabic) it superimposes some.
Thank you
results are not good, besides direction is correct. I use Microsoft Visual Studio 2008 Version 9.0.30729.1, it compiles with no errors or warnings but i have a broken convert.exe output, both in terms of render and characters, as (in arabic) it superimposes some.
Thank you
Last edited by teebe on 2011-06-06T22:02:09-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug -direction IM 6.7.0.2 Q16
IM 6.7.0.4 Mac OSX Tiger
The command
convert -background lightblue -fill blue -pointsize 48 -font Arial -direction right-to-left label:"ABCDEFG" A2G_reversed.png
does indeed now reverse the characters, BUT they are not filled.
Likewise without the -direction, they are still not filled.
convert -background lightblue -fill blue -pointsize 48 -font Arial label:"ABCDEFG" A2G.png
The command
convert -background lightblue -fill blue -pointsize 48 -font Arial -direction right-to-left label:"ABCDEFG" A2G_reversed.png
does indeed now reverse the characters, BUT they are not filled.
Likewise without the -direction, they are still not filled.
convert -background lightblue -fill blue -pointsize 48 -font Arial label:"ABCDEFG" A2G.png
Re: possible bug -direction IM 6.7.0.2 Q16
Hi, the output of convert.exe with -direction right-to-left shows double strokes (or advance skipping):
as well a weird rendering.
It would be nice to get to the end, i could use IM for a new project.
Cheers
as well a weird rendering.
It would be nice to get to the end, i could use IM for a new project.
Cheers
Re: possible bug -direction IM 6.7.0.2 Q16
Try ImageMagick 6.7.0-5. It will be a day or two until we get updated versions of the Windows binaries for this release.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug -direction IM 6.7.0.2 Q16
IM 6.7.0.5 Q16 Mac OSX Tiger.
This command seems to be working nearly correctly now, but the G seems a bit too close to the F. Is that the way it will be?
convert -background lightblue -fill blue -pointsize 48 -font Arial -direction right-to-left label:"ABCDEFG" A2G_reversed2.png
This command seems to be working nearly correctly now, but the G seems a bit too close to the F. Is that the way it will be?
convert -background lightblue -fill blue -pointsize 48 -font Arial -direction right-to-left label:"ABCDEFG" A2G_reversed2.png
Re: possible bug -direction IM 6.7.0.2 Q16
We just write the characters from right to left and use the font metrics to decide where to place each character. A couple of solutions would be to 1) reverse the string and place the letters left to right; 2) use a proper text layout manager such as Pango; or 3) ImageMagick could reverse the string and then place the characters left to right.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug -direction IM 6.7.0.2 Q16
For me this was only a simple test case to help you and that other person with the arabic characters. So if it works out for the arabic characters, then I am not overly concerned. If I had to do it for English from your suggestions, I would probably try your option 3)magick wrote:We just write the characters from right to left and use the font metrics to decide where to place each character. A couple of solutions would be to 1) reverse the string and place the letters left to right; 2) use a proper text layout manager such as Pango; or 3) ImageMagick could reverse the string and then place the characters left to right.
Thanks.
Fred
Re: possible bug -direction IM 6.7.0.2 Q16
The advance metric is determined by looking at two side-by-side characters. For right-to-left we need to look at the next character rather than the last. We'll add a patch to ImageMagick within a day or two.
Re: possible bug -direction IM 6.7.0.2 Q16
IM 6.7.0-5 makes better rendering but -direction right-to-left is always broke.
Screen shots and process output:
1 - Screen grab of original strings (OUTLOOK MAIL):
2 - IM 6.7.0-5 No RTL, no pre-invertion:
3 - IM 6.7.0-5 with -direction RTL:
4 - IM 6.7.0-5 No RTL but pre-inverted by friend code:
Images 1 & 2 does not need any explanation, image 3 is RTL as made by IM; here i notice a wrong interpretation of glyph ligatures. Image 4 is almost prefect (if string is single line), but is pre-processed in alien application and no RTL is applied by IM.
Just for your possible curiosity, the ARABIC UNICODE string reverser that works can be found at: http://omar84.com/, Arabic Writer.
Interesting, it has full code exposed in its html.
Update: as bidirectional text is a complex subject and here is only Arabic, one of choice, I think reversing string is just a shortcoming effect to render correctly. Do there is any plan to include i18n library into IM? May be Pango...
Thanks all for your efforts.
Screen shots and process output:
1 - Screen grab of original strings (OUTLOOK MAIL):
2 - IM 6.7.0-5 No RTL, no pre-invertion:
3 - IM 6.7.0-5 with -direction RTL:
4 - IM 6.7.0-5 No RTL but pre-inverted by friend code:
Images 1 & 2 does not need any explanation, image 3 is RTL as made by IM; here i notice a wrong interpretation of glyph ligatures. Image 4 is almost prefect (if string is single line), but is pre-processed in alien application and no RTL is applied by IM.
Just for your possible curiosity, the ARABIC UNICODE string reverser that works can be found at: http://omar84.com/, Arabic Writer.
Interesting, it has full code exposed in its html.
Update: as bidirectional text is a complex subject and here is only Arabic, one of choice, I think reversing string is just a shortcoming effect to render correctly. Do there is any plan to include i18n library into IM? May be Pango...
Thanks all for your efforts.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: possible bug -direction IM 6.7.0.2 Q16
The real problem with the dashes being placed on the wrong side is that the font switches direction.
I doubt IM could handle such change of direction, as it has no understanding that certian unicodes are performed in the oppiste direction. This is the job of a text processing package such as Pango, Not an Image processing package.
Prehaps an optional 'delegate' can be defined to call pango as a new type of text to image handling.
Something like pango:"text that may have some RTL text in it"
This way IM can make use of pango if available, but does not require it installed (not available in windows for example) to work for everything else. Just as it does for Postscript, and PDF file handling.
I doubt IM could handle such change of direction, as it has no understanding that certian unicodes are performed in the oppiste direction. This is the job of a text processing package such as Pango, Not an Image processing package.
Prehaps an optional 'delegate' can be defined to call pango as a new type of text to image handling.
Something like pango:"text that may have some RTL text in it"
This way IM can make use of pango if available, but does not require it installed (not available in windows for example) to work for everything else. Just as it does for Postscript, and PDF file handling.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: possible bug -direction IM 6.7.0.2 Q16
I found Pango library interesting but as all open source project difficult to implement (at least for me).
Interesting, I found another viewer (very popular and free) doing what i was expecting, that is RTL text overlays, at some costs in regard quality of anti-aliasing and easy of use (no arguments, mangling .ini instead).
I make my best wishes to all people that help in finding the solution.
Cheers.
Interesting, I found another viewer (very popular and free) doing what i was expecting, that is RTL text overlays, at some costs in regard quality of anti-aliasing and easy of use (no arguments, mangling .ini instead).
I make my best wishes to all people that help in finding the solution.
Cheers.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: possible bug -direction IM 6.7.0.2 Q16
Would you like to share the name of that utility?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: possible bug -direction IM 6.7.0.2 Q16
Yes irfanview.