Page 1 of 1
Special Characters (Fonts)
Posted: Sun Sep 25, 2011 11:57 pm
by PEB
Hi Andreas,
Could you add the ability to access special characters (for the fonts that support them) such as "smart quotes", em dashes, en dashes, ellipsis, etc.?
Thanks.
Re: Special Characters (Fonts)
Posted: Mon Sep 26, 2011 1:09 pm
by airsoftsoftwair
You should be able to access these characters by using #ENCODING_UTF8 and passing a string in UTF-8 format to
TextOut() or similar functions.
Re: Special Characters (Fonts)
Posted: Tue Sep 27, 2011 1:54 am
by PEB
Sounds good!
Can you give me an example of what a string in UTF-8 format looks like?
Re: Special Characters (Fonts)
Posted: Tue Sep 27, 2011 2:31 pm
by airsoftsoftwair
All ASCII characters are identical in UTF-8 so you only need to create special codes for non ASCII characters. You can look up these codes using Google or use a text editor of your choice and save the text in UTF-8 and then look at the text file using a hex editor. The copyright sign for example has UTF-8 code $c2a9 (= 2 bytes). To use this inside Hollywood, just do the following:
Code: Select all
SetFont(#SANS, 16)
TextOut(#CENTER, #CENTER, Chr($c2) .. Chr($a9) .. " Airsoft Softwair", {Encoding = #ENCODING_UTF8})
Here are some more UTF 8 codes:
http://www.utf8-zeichentabelle.de/
Re: Special Characters (Fonts)
Posted: Tue Sep 27, 2011 3:37 pm
by PEB
Thanks, that works well!
Re: Special Characters (Fonts)
Posted: Thu Dec 12, 2013 1:20 pm
by xabierpayet
is not possible to add the euro character using any method? i try different ways with no luck
Re: Special Characters (Fonts)
Posted: Thu Dec 12, 2013 11:26 pm
by PEB
Try this:
Code: Select all
SetFont(#SANS, 64)
SetFontStyle(#ANTIALIAS)
TextOut(#CENTER, #CENTER, Chr($e2)..Chr($82)..Chr($ac), {Encoding=#ENCODING_UTF8})
Re: Special Characters (Fonts)
Posted: Tue Dec 17, 2013 9:26 am
by xabierpayet
work fine, thank you