Special Characters (Fonts)

Feature requests for future versions of Hollywood can be voiced here
Post Reply
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Special Characters (Fonts)

Post 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.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Special Characters (Fonts)

Post 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.
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Special Characters (Fonts)

Post by PEB »

Sounds good!
Can you give me an example of what a string in UTF-8 format looks like?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Special Characters (Fonts)

Post 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/
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Special Characters (Fonts)

Post by PEB »

Thanks, that works well!
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Re: Special Characters (Fonts)

Post by xabierpayet »

is not possible to add the euro character using any method? i try different ways with no luck
PEB
Posts: 568
Joined: Sun Feb 21, 2010 1:28 am

Re: Special Characters (Fonts)

Post by PEB »

Try this:

Code: Select all

SetFont(#SANS, 64)
SetFontStyle(#ANTIALIAS)
TextOut(#CENTER, #CENTER, Chr($e2)..Chr($82)..Chr($ac), {Encoding=#ENCODING_UTF8})
xabierpayet
Posts: 267
Joined: Fri Feb 24, 2012 9:34 am

Re: Special Characters (Fonts)

Post by xabierpayet »

work fine, thank you
Post Reply