13.12.2012 Views

emWin - SEGGER Microcontroller

emWin - SEGGER Microcontroller

emWin - SEGGER Microcontroller

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

904 CHAPTER Foreign Language Support<br />

The following example shows how bidirectional text is rendered by <strong>emWin</strong>:<br />

28.3.4 Requirements<br />

Arabic language support is part of the <strong>emWin</strong> basic package. <strong>emWin</strong> standard fonts<br />

do not contain Arabic characters. Font files containing Arabic characters can be created<br />

using the Font Converter.<br />

Memory<br />

The bidirectional text alignment and Arabic character transformation uses app. 60 KB<br />

of ROM and app. 800 bytes of additional stack.<br />

28.3.5 How to enable Arabic support<br />

Per default <strong>emWin</strong> writes text always from the left to the right and there will be no<br />

Arabic character transformation as described above. To enable support for bidirectional<br />

text and Arabic character transformation, add the following line to your application:<br />

GUI_UC_EnableBIDI(1);<br />

If enabled, <strong>emWin</strong> follows the rules of the bidirectional algorithm, described by the<br />

Unicode consortium, to get the right visual order before drawing text.<br />

28.3.6 Example<br />

UTF-8 text Rendering<br />

\xd8\xb9\xd9\x84\xd8\xa7 1, 2, 345<br />

\xd8\xba\xd9\x86\xd9\x8a XYZ<br />

\xd8\xa3\xd9\x86\xd8\xa7<br />

The Sample folder contains the example FONT_Arabic, which shows how to draw Arabic<br />

text. It contains an <strong>emWin</strong> font with Arabic characters and some small Arabic text<br />

examples.<br />

28.3.7 Font files used with Arabic text<br />

Font files used to render Arabic languages need to include at least all characters<br />

defined in the ’Arabic’ range 0x600-0x6FF and the notation forms and ligatures listed<br />

in the tables of this chapter.<br />

UM03001 User & Reference Guide for <strong>emWin</strong> V5.18 © 1997 - 2012 <strong>SEGGER</strong> <strong>Microcontroller</strong> GmbH & Co. KG

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!