summaryrefslogtreecommitdiff
path: root/tests/textblock_intl.lua
blob: 1f0868390dd12a69efa84e4b9a03f8244b5b77fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
local ffi = require("ffi")
local ffi_new = ffi.new
local util = require("util")
local levas = util.get_lib("evas")

local sin, cos = util.sin, util.cos

return function(ui, variant)
    return "text.png", "Textblock Intl", 32.4417, function()
        local text
        local slow = 5
        local win_w, win_h = ui.win_w, ui.win_h
        local w0, h0 = ffi_new("Evas_Coord[1]"), ffi_new("Evas_Coord[1]")
        ui.func_set(function()
            levas.evas_object_del(text)
        end, function(t, f)
            levas.evas_object_textblock_size_native_get(text, w0, h0)
            local w = w0[0]
            local h = h0[0]
            local x = (win_w / 2) - (w / 2)
                + sin(f / (31.1 * slow)) * (w0[0] / (2 * 2))
            local y = (win_h / 2) - (h / 2)
                + cos(f / (19.6 * slow)) * (h0[0] / (2 * 2))
            levas.evas_object_move(text, x, y)
            levas.evas_object_resize(text, w, h)
        end)
        local evas = ui.evas
        text = levas.evas_object_textblock_add(evas)
        local st = levas.evas_textblock_style_new()
        levas.evas_textblock_style_set(st,
            "DEFAULT='font=Sans font_size=10 align=left color=#000000 wrap=word'")
        levas.evas_object_textblock_style_set(text, st)
        levas.evas_textblock_style_free(st)
        levas.evas_object_textblock_clear(text)
        levas.evas_object_textblock_text_markup_set(text,
            "This is a test of International test rendering in Evas<br/>"
            .. "<br/>"
            .. "Danish: 'Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen'<br/>"
            .. "German: 'Heizölrückstoßabdämpfung'<br/>"
            .. "Spanish: 'El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y'<br/>"
            .. "French: 'Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en'<br/>"
            .. "Irish Gaelic: 'D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh'<br/>"
            .. "Hungarian: 'Árvíztűrő tükörfúrógép'<br/>"
            .. "Icelandic: 'Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa'<br/>"
            .. "Japanese (hiragana): 'いろはにほへとちりぬるを'<br/>"
            .. "Japanese (katakana): 'イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム'<br/>"
            .. "Hebrew: 'דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה?‏'<br/>"
            .. "Polish: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig'<br/>"
            .. "Russian: 'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!'<br/>"
            .. "IPA: 'ˈjunɪˌkoːd'<br/>"
            .. "American Dictionary: 'Ūnĭcōde̽'<br/>"
            .. "Anglo-saxon: 'ᛡᚢᚾᛁᚳᚩᛞ'<br/>"
            .. "Arabic: 'يونِكود'<br/>"
            .. "Armenian: 'Յունիկօդ'<br/>"
            .. "Bengali: 'য়ূনিকোড'<br/>"
            .. "Bopomofo: 'ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅'<br/>"
            .. "Canadian Syllabics: 'ᔫᗂᑰᑦ'<br/>"
            .. "Cherokee: 'ᏳᏂᎪᏛ'<br/>"
            .. "Chinese: '萬國碼'<br/>"
            .. "Ethiopic: 'ዩኒኮድ'<br/>"
            .. "Georgian: 'უნიკოდი'<br/>"
            .. "Greek: 'Γιούνικοντ'<br/>"

            --[[ also test the html entity stuff a bit ]]
            .. "Greek continued: '&tau;&upsilon;&lambda;&theta;'<br/>"

            .. "Gujarati: 'યૂનિકોડ'<br/>"
            .. "Gurmukhi: 'ਯੂਨਿਕੋਡ'<br/>"
            .. "Hindi: 'यूनिकोड'<br/>"
            .. "Kannada: 'ಯೂನಿಕೋಡ್'<br/>"
            .. "Khmer: 'យូនីគោដ'<br/>"
            .. "Korean: '유니코드'<br/>"
            .. "Malayalam: 'യൂനികോഡ്'<br/>"
            .. "Ogham: 'ᚔᚒᚅᚔᚉᚑᚇ'<br/>"
            .. "Oriya: 'ୟୂନିକୋଡ'<br/>"
            .. "Persian: 'یونی‌کُد'<br/>"
            .. "Sinhala: 'යණනිකෞද්'<br/>"
            .. "Syriac: 'ܝܘܢܝܩܘܕ'<br/>"
            .. "Tamil:'யூனிகோட்'<br/>"
            .. "Telugu: 'యూనికోడ్'<br/>"
            .. "Thai: 'ยูนืโคด'<br/>"
            .. "Tibetan: 'ཨུ་ནི་ཀོཌྲ།'<br/>"
            .. "Yiddish: 'יוניקאָד'<br/>")
        levas.evas_object_show(text)
    end
end