caption: russian text word wrapping
caption: russian text word wrapping
Hi! I'm stick on a problem with russian words wrap.
When I try to use "caption:" it wraps, but in a strange way. Please take a look on an attached pictures:
/usr/bin/convert -size 500x -font Times-Roman -background lightblue -pointsize 32 caption:'LORUM IPSUM dolor sit amet, consectetuer adipiscing elit, sed diam nonummy' latin.png
/usr/bin/convert -background transparent -size 500x -font Times-Roman -background lightblue -encoding Unicode -pointsize 32 caption:'Лорем ипсуп долор сит амет. консектетуер адиписцинг элит, сед диам нонумми' russian.png
What I'we gotta do?
--
Thanx
When I try to use "caption:" it wraps, but in a strange way. Please take a look on an attached pictures:
/usr/bin/convert -size 500x -font Times-Roman -background lightblue -pointsize 32 caption:'LORUM IPSUM dolor sit amet, consectetuer adipiscing elit, sed diam nonummy' latin.png
/usr/bin/convert -background transparent -size 500x -font Times-Roman -background lightblue -encoding Unicode -pointsize 32 caption:'Лорем ипсуп долор сит амет. консектетуер адиписцинг элит, сед диам нонумми' russian.png
What I'we gotta do?
--
Thanx
Re: caption: russian text word wrapping
So, any one can tell about this bug salvation? May be hint or just any reaction?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: caption: russian text word wrapping
Seems to be a bug caused by the difference between multi-byte UTF characters (3 bytes per russian character), and the normal old ASCII characters.
IM 'caption:' probably needs to be modified to get character lengths usinf a UTF methods instead of a simple byte count.
Now these are guesses on my part, but that it what it looks like.
IM 'caption:' probably needs to be modified to get character lengths usinf a UTF methods instead of a simple byte count.
Now these are guesses on my part, but that it what it looks like.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: caption: russian text word wrapping
Thank you very much! I'm looking forward to download fixed version.
Re: caption: russian text word wrapping
It is almost problem #1
I'm so ashame I have no XP to find & fix it.
I'm so ashame I have no XP to find & fix it.
Re: caption: russian text word wrapping
This is a bug in ImageMagick. We treat the string as single bytes rather than as a unicode group when we compute the text width. This problem is on our bug fix list with currently no ETA. If a user wants to submit a patch in the mean-time, well that would be just grand.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: caption: russian text word wrapping
For caption the main problem is to find out what is the Unicode way to do word wrapping. The only guaranteed word break is newline, and the only word wrap points IM currently understands is spaces and tabs.
For English, words are white space separated making word wrapping easy, in Chinese (and this is only a rough guess) each Chinese symbol can regarded as a word so word wrap can be done on either side of any Chinese symbol.
The same could probably be said for more other Unicode symbols that may be used in English text.
Though typically their are also rules for this, breaking around currently symbols for example is generally not a good idea. I have no idea at all about Russian!
Again what is needed is the word wrapping rules for Unicode in general. Where can strings be broken to make them shorter to try and better fit a specific image width for a specific font and point size?
If anyone knows or has some knowledge of this great.
ASIDE: which raises the question, that if the implementation is too complex then may be Im should not bother with it. As I have said many times in IM Examples on text handling, ImageMagick is not a word processor, but a image processor.
The better solution is to use a proper text processing package such as TeX. This is a full text processing system (and thus very complex) that can batch process (no GUI requirement). If you are truly serious about text formatting in multiple fonts, styles, languages, than this is what you should be using. Its image (postscript) output can then be handled by IM for merging with other images or further image processing.
For English, words are white space separated making word wrapping easy, in Chinese (and this is only a rough guess) each Chinese symbol can regarded as a word so word wrap can be done on either side of any Chinese symbol.
The same could probably be said for more other Unicode symbols that may be used in English text.
Though typically their are also rules for this, breaking around currently symbols for example is generally not a good idea. I have no idea at all about Russian!
Again what is needed is the word wrapping rules for Unicode in general. Where can strings be broken to make them shorter to try and better fit a specific image width for a specific font and point size?
If anyone knows or has some knowledge of this great.
ASIDE: which raises the question, that if the implementation is too complex then may be Im should not bother with it. As I have said many times in IM Examples on text handling, ImageMagick is not a word processor, but a image processor.
The better solution is to use a proper text processing package such as TeX. This is a full text processing system (and thus very complex) that can batch process (no GUI requirement). If you are truly serious about text formatting in multiple fonts, styles, languages, than this is what you should be using. Its image (postscript) output can then be handled by IM for merging with other images or further image processing.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: caption: russian text word wrapping
Thanx for variant. Unfortunately, I have no TeX installed on hosting. I'll try to do something.
Way my brother find -- to set width * 2
Way my brother find -- to set width * 2
Re: caption: russian text word wrapping
We can reproduce the text work wrapping problem and have a patch in ImageMagick 6.5.2-5 Beta available sometime tomorrow. Thanks.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: caption: russian text word wrapping
Can someone give me some russian text to play with?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: caption: russian text word wrapping
Можешь найти его в первом посте, или использовать этот, на твой вкус
Всегда рад оказать помощь
Всегда рад оказать помощь
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: caption: russian text word wrapping
I can verify that russian is now word wrapping.
convert -size 100x caption:'Можешь найти его в первом посте, или использовать этот, на твой вкус' show:
convert -size 100x caption:'Можешь найти его в первом посте, или использовать этот, на твой вкус' show:
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: caption: russian text word wrapping
convert -size 200x -background red caption:'(Чтение базы данных... на данный момент установлено 88031 файлов и каталогов.)' /var/www/a.png# apt-get install imagemagick
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Пакеты, которые будут обновлены:
imagemagick
обновлено 1, установлено 0 новых пакетов, для удаления отмечено 0 пакетов, и 90 пакетов не обновлено.
Необходимо скачать 1425kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 0B.
Получено:1 http://ftp.ru.debian.org lenny/main imagemagick 7:6.3.7.9.dfsg2-1~lenny1 [1425kB]
Получено 1425kБ за 44s (31,9kБ/c)
(Чтение базы данных... на данный момент установлено 88031 файлов и каталогов.)
Подготовка к замене пакета imagemagick 7:6.3.7.9.dfsg1-3~lenny1 (используется файл .../imagemagick_7%3a6.3.7.9.dfsg2-1~lenny1_amd64.deb)...
Распаковывается замена для пакета imagemagick ...
Обрабатываются триггеры для man-db ...
Настраивается пакет imagemagick (7:6.3.7.9.dfsg2-1~lenny1) ...
http://derevenka.net.ua/a.png
Sorry, still the same trouble.
Or I should build from SVN? Then when stable come?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: caption: russian text word wrapping
We are using SVN, so the change will be in the next point release when it comes out.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: caption: russian text word wrapping
bad. Hosters wouldn't build from scratch. They will wait for release, so and I.
But, however, problem is solved and it is magic news
Thank you very much!
But, however, problem is solved and it is magic news
Thank you very much!