Page 1 of 1

Swedish signs - åäö - disappears?

Posted: 2010-01-12T07:16:39-07:00
by Albireo
Hello!
I can't use the Swedish characters with ImageMagick
for example from ASCII-tabell http://www.asciitable.com/
Å -> A with Ring above (ASCII-143),
Ä -> A with Diaeresis above(ASCII-142),
Ö -> O with Diaeresis above(ASCII-153)

This works!

Code: Select all

convert -size 320x100 xc:lightblue -font Candice -pointsize 72 -fill black -annotate +24+64 "Jan" -fill white -annotate +26+66 "Jan" -fill lightblue -annotate +25+65 "Jan" font_stamp.jpg
But this doesn't work!

Code: Select all

convert -size 320x100 xc:lightblue -font Candice -pointsize 72 -fill black -annotate +24+64 "ÅÄÖ" -fill white -annotate +26+66 "ÅÄÖ" -fill lightblue -annotate +25+65 "ÅÄÖ" font_stamp.jpg
(the only thing you can see is the lightblue background)

Is it possible to use ASCII characters > 127?

//Jan

Re: Swedish signs - åäö - disappears?

Posted: 2010-01-12T10:36:50-07:00
by fmw42
your characters are not unicode compatible when typing directly. Put them in a unicode (utf-8) text editor file and then use the @ symbol. see http://www.imagemagick.org/Usage/text/#unicode

this works for me with just Ä in the text file.

convert -background lightblue -fill blue -pointsize 48 label:@aumlaut.txt tmp.png

Re: Swedish signs - åäö - disappears?

Posted: 2010-01-12T15:54:02-07:00
by Albireo
Thank You!

- I Created a text in an editor with de word/signs I wanted to Use
- The editor was "Notepad ++", configurated for UTF-8 (Without BOM).

After that, I running the program below in a batchfile in DOS: (and it works!)

Code: Select all

convert -background lightblue -fill blue -pointsize 48 label:@aumlaut.txt tmp.png
Is there some other way to use "Unicode - characters" directly in the command (without extra file)?

//Jan

Re: Swedish signs - åäö - disappears?

Posted: 2010-01-12T16:19:19-07:00
by fmw42
not unless your terminal window allows utf-8

see http://www.imagemagick.org/Usage/text/#unicode

if you copy and past from the text file, the character codes show in stead. This is an A umlaut:

convert -background lightblue -fill blue -pointsize 48 label:\303\204 atmp.png

and it works, but you have to copy and paste from the text editor file each time. You cannot copy the above line and put in another font without repasting from the text editor (at least, it does not work for me that way --- I have to recopy each time the A umlaut from the text editor).

Re: Swedish signs - åäö - disappears?

Posted: 2010-01-13T16:27:27-07:00
by Albireo
fmw42 wrote:not unless your terminal window allows utf-8
What do you mean with "terminal window" - Is that an UTF-8 editor?
Most of what is on this site is intended for UNIX / LINUX (and didn't feel, to install and learn "pearl" / "printf").
fmw42 wrote:if you copy and past from the text file, the character codes show in stead. This is an A umlaut:

Code: Select all

convert -background lightblue -fill blue -pointsize 48 label:\303\204 atmp.png
and it works, but you have to copy and paste from the text editor file each time. You cannot copy the above line and put in another font without repasting from the text editor (at least, it does not work for me that way --- I have to recopy each time the A umlaut from the text editor).
I understand what you say but I don't know how I can do...
Usually I use "Notepad + +" as editor (that supports UTF-8)"? :)
Can you do something with the program "Charset" In Windows?
(Here you can see the unicode ex. U+0179)

Does anyone know what "editor" to be used in the context? (the best :-)

//Jan

Re: Swedish signs - åäö - disappears?

Posted: 2010-01-13T17:36:36-07:00
by fmw42
What do you mean with "terminal window" - Is that an UTF-8 editor?
That is where you paste your code and see it run. In Unix it is called a terminal window. In Windows it is a DOS window or something like that. I am not a Windows person, so cannot help much. I used BBEdit on a Mac to create the A umlaut and then copy from that into my terminal window where the A umlaut changes to those odd numbers. Or I created a text file with just the A umlaut in it using BBEdit and then referenced it in the IM code with @filename

As far as I know, Notepad may allow utf-8 characters. If not try Wordpad or some other text editor. Check the preferences in the text editor to be sure it creates utf-8 compliant text. That is all I did in BBEdit Nothing I have done needs Perl or other languages. Just a utf-8 compliant text editor.

As far as I know, you cannot just paste in or type unicode characters the way you have referenced them. But I am no expert on fonts and utf-8 or unicode things.