summaryrefslogtreecommitdiff
path: root/testautomation/graphics/optional/includes/global/g_character.inc
blob: 31b4f364c50c12403eeedaf695762d81fc5ea271 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Lesser General Public License version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org.  If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@sun.com
'*
'* short description :
'*
'*******************************************************************
'*
' #1 tFormatCharacter
' #1 tDialogCharacter
' #1 tSetFormatCharacter
' #1 tGetFormatCharacter
'*
'\*******************************************************************
testcase tFormatCharacter

   dim sTemp as string
   dim iTemp as integer

   '/// open application ///'
   Call hNewDocument
   sleep 1

   '/// create a textframe with content ///'
   hTextrahmenErstellen ("This is a check, a check, a check.",10,10,60,30)
   '/// type with keys [strg]+[home] [shift]+[end] to select the inserted text ///'
   hTypeKeys "<MOD1 HOME><shift end>"
   sleep 1

   '/// Format->Character ///'
   FormatCharacter
      sleep 1
      '/// switch to tabpage 'Font' ///'
      Kontext
      Messagebox.SetPage TabFont
      Kontext "TabFont"
      sleep 1

      '/// switch to tabpage 'Font Effects' ///'
      Kontext
      Messagebox.SetPage TabFontEffects
      kontext "TabFontEffects"
      sleep 1

      '/// switch to tabpage 'Position' ///'
      Kontext
      Messagebox.SetPage TabFontPosition
      Kontext "TabFontPosition"
      sleep 1

      '/// close dialog 'Character' with 'OK' ///'
      TabFontPosition.OK
   '/// close application ///'
   Call hCloseDocument
   
endcase 'tFormatCharacter
'---------------------------------------------------------
testcase tDialogCharacter

    Dim i as integer
    Dim y as integer
    Dim z as integer
    Dim CountOfThem as integer
    Dim CountOfColors as integer
    Dim Xtext as string
    Dim Tcolor as string
    Dim TestColorString as string
    Dim ThisIsMyTextFromControl as string
    Dim Asiansupportsetting as string

    Printlog "DialogCharacter starts"

    Call hNewDocument

    sleep 3
    ToolsOptions
    hToolsOptions ( "LanguageSettings", "Languages" )

    if Aktivieren.IsChecked then                                  '/// Check in what state Asian support is ///'
       Asiansupportsetting = TRUE
    else
       Asiansupportsetting = FALSE
       Aktivieren.Check                                           '/// Activate if not already activated ///'
    end if

    Kontext "ExtrasOptionenDlg"
    ExtrasOptionenDlg.OK
    Sleep (3)

    Kontext

    Call hTextrahmenErstellen ( "Some text in a box.", 20, 20, 50, 50 )

    FormatCharacter
    sleep 1
    Kontext '"Active"                  ' insert this, perhaps another
    Active.SetPage TabFont            ' tabpage is active at open
    Kontext "TabFont"
    CountOfThem = FontWest.GetItemCount
    for y = 1 to CountOfThem
    FontWest.Select y
    Xtext = FontWest.GetSelText
'    printlog "This FontWest is: " & Xtext
    next y

    CountOfThem = StyleWest.GetItemCount
        for y = 1 to CountOfThem
        StyleWest.Select y
        Xtext = StyleWest.GetSelText
'        printlog "This StyleWest is: " & Xtext
    next y

    CountOfThem = SizeWest.GetItemCount
    for y = 1 to CountOfThem
        SizeWest.Select y
        Xtext = SizeWest.GetSelText
'        printlog "This SizeWest is: " & Xtext
    next y

    CountOfThem = LanguageWest.GetItemCount
    for y = 1 to CountOfThem
        LanguageWest.Select y
        Xtext = LanguageWest.GetSelText
'        printlog "This LanguageWest is: " & Xtext
    next y

    CountOfThem = FontEast.GetItemCount
    for y = 1 to CountOfThem
        FontEast.Select y
        Xtext = FontEast.GetSelText
'        printlog "This FontEast is: " & Xtext
    next y

    CountOfThem = StyleEast.GetItemCount
    for y = 1 to CountOfThem
        StyleEast.Select y
        Xtext = StyleEast.GetSelText
'        printlog "This StyleEast is: " & Xtext
    next y

    CountOfThem = SizeEast.GetItemCount
    for y = 1 to CountOfThem
        SizeEast.Select y
        Xtext = SizeEast.GetSelText
'        printlog "This SizeEast is: " & Xtext
    next y

    CountOfThem = LanguageEast.GetItemCount
    for y = 1 to CountOfThem
        LanguageEast.Select y
        Xtext = LanguageEast.GetSelText
'        printlog "This LanguageEast is: " & Xtext
    next y

    Kontext
    Active.SetPage TabFontEffects
    Kontext "TabFontEffects"
    if NOT Outline.IsChecked then
        Outline.Check
    end if

    if NOT Shadow.IsChecked then
        Shadow.Check
    end if

    CountOfThem = Underline.GetItemCount
    CountOfColors = Color.GetItemCount

    for y = 2 to CountOfThem
        Underline.Select y
        Xtext = Underline.GetSelText
'        printlog "This Underline is: " & Xtext

        for i = 1 to CountOfColors
            Color.Select i
            TestColorString = Color.GetSelText
'            printlog "This Color is: " & TestColorString
        next i
    next y

    CountOfThem = StrikeThrough.GetItemCount
    for y = 2 to CountOfThem
        StrikeThrough.Select y
        IndividualWords.UnCheck
        Xtext = StrikeThrough.GetSelText
'        printlog "The StrikeThrough is: " & Xtext

        for i = 1 to CountOfColors
            Color.Select i
            TestColorString = Color.GetSelText
'            printlog "And the Color is: " & TestColorString
        next i
    next y

    IndividualWords.Check
    printlog "Individual Words = On"

    CountOfThem = StrikeThrough.GetItemCount
    for y = 2 to CountOfThem
        StrikeThrough.Select y
        Xtext = StrikeThrough.GetSelText
'        printlog "The StrikeThrough is: " & Xtext

        for i = 1 to CountOfColors
            Color.Select i
            TestColorString = Color.GetSelText
'            printlog "And the Color is: " & TestColorString
        next i
    next y

    CountOfThem = Emphasis.GetItemCount
    for y = 2 to CountOfThem
        Emphasis.Select y
        Xtext = Emphasis.GetSelText
'        printlog "The Emphasis is: " & Xtext

        for i = 1 to CountOfColors
            Color.Select i
            TestColorString = Color.GetSelText
'            printlog "And the Color is: " & TestColorString
        next i
    next y

    CountOfThem = Position.GetItemCount
    for y = 1 to CountOfThem
        Position.Select y
        Xtext = Position.GetSelText
'        printlog "The Position is: " & Xtext
        for i = 1 to CountOfColors
            Color.Select i
            TestColorString = Color.GetSelText
'            printlog "And the Color is: " & TestColorString
        next i
    next y

    CountOfThem = FontColor.GetItemCount
     for z = 1 to CountOfThem
        FontColor.Select z
        TestColorString = FontColor.GetSelText
'        printlog "The FontColor is: " & TestColorString
     next z

    CountOfThem = Relief.GetItemCount
    TestColorString = Color.GetSelText
    for y = 1 to CountOfThem
        Relief.Select y
        Xtext = Relief.GetSelText
        TestColorString = Color.GetSelText
'        printlog "The Relief is: " & Xtext
    next y

    Kontext
    Active.SetPage TabFontPosition        '/// Changes the active tab to "Position"
    Kontext "TabFontPosition"
    printlog "TabFontPosition"
    SuperScript.Check
    Super.Check
    RelativeFontSize.ToMin         '/// Testing the "Relative Font Size"-Listbox
    ThisIsMyTextFromControl = RelativeFontSize.GetText
'    printlog "The Relative Font Size minimum is: " & ThisIsMyTextFromControl
    for y = 1 to 99
        RelativeFontSize.TypeKeys "<UP>"
        ThisIsMyTextFromControl = RelativeFontSize.GetText
'        printlog "The Relative Font Size is: " & ThisIsMyTextFromControl
    next y

    Automatic.Check
    ScaleWith.ToMin          '/// Testing the "Scale With"-Listbox
    ThisIsMyTextFromControl = ScaleWith.GetText
    printlog "ScaleWith minimum is:" & ThisIsMyTextFromControl
    ' ScaleWith.TypeKeys "<TAB>"
    for y = 1 to 100
        ScaleWith.TypeKeys "<UP>"
        ThisIsMyTextFromControl = ScaleWith.GetText
'        printlog "ScaleWith is:" & ThisIsMyTextFromControl
    next y

    Normal.Check
    Subscript.Check

    RelativeFontSize.ToMin         '/// Testing the "Reliative Font Size"-Listbox again but this time
    ThisIsMyTextFromControl = RelativeFontSize.GetText      '/// with "Subscript" and "Normal" Checked
    printlog "The Relative Font Size minimum is: " & ThisIsMyTextFromControl
    for y = 1 to 99
        RelativeFontSize.TypeKeys "<UP>"
        ThisIsMyTextFromControl = RelativeFontSize.GetText
'        printlog "The Relative Font Size is: " & ThisIsMyTextFromControl
    next y

    Automatic.Check

    ScaleWith.ToMin          '/// Testing the "ScaleWith"-Listbox
    ThisIsMyTextFromControl = ScaleWith.GetText
    printlog "The ScaleWith Size is: " & ThisIsMyTextFromControl
    for y = 1 to 100
        ScaleWith.TypeKeys "<UP>"
        ThisIsMyTextFromControl = ScaleWith.GetText
'        printlog "The ScaleWith Size is: " & ThisIsMyTextFromControl
    next y

    ThisIsMyTextFromControl = Spacing.GetSelText      '/// Testing the "Spacing"-ListBox
    printlog "The Spacing is first: " & ThisIsMyTextFromControl
    for y = 2 to 3
        Spacing.Select y
        ThisIsMyTextFromControl = Spacing.GetSelText
        printlog "The Spacing is: " & ThisIsMyTextFromControl
        ThisIsMyTextFromControl = SpacingBy.GetText      '/// Testing the "Spacing By"-Scrollbox
'        printlog "The SpacingBy Size minimum is: " & ThisIsMyTextFromControl
        SpacingBy.ToMin
        for z = 1 to 4
            SpacingBy.More
            ThisIsMyTextFromControl = SpacingBy.GetText
'            printlog "The SpacingBy Size is: " & ThisIsMyTextFromControl
        next z
        PairKerning.Check
    next y

    Kontext "TabFontPosition"
    TabFontPosition.Ok

    if Asiansupportsetting = FALSE then
       kontext
       ToolsOptions
       hToolsOptions ( "LanguageSettings", "Languages" )
       Aktivieren.UnCheck                                    '/// Deactivate if not already deactivated ///'
       Printlog "Reseted the Asiansupport-value to it's original state"

       Kontext "ExtrasOptionenDlg"
       ExtrasOptionenDlg.OK
       Sleep (3)

'          ActiveDeactivateAsianSupport = FALSE
    end if

    Printlog "DialogCharacter Ends"
    Call hCloseDocument
    
endcase 'tDialogCharacter
'--------------------------------------------------------
testcase tSetFormatCharacter

    if iSprache = 48 then
        qaerrorlog "Test not adapted to polish, 48."
        goto endsub
    endif
    Dim i as integer
    dim iWest as integer
    dim iAsian as integer
    dim iComplex as integer
    dim bAsian as boolean
    dim bComplex as boolean
    dim sLanguage(500) as string
    dim sFile as string
    dim sTemp as string

   if (gApplication = "IMPRESS") then 
      ExtensionString = "odp"
   else
      ExtensionString = "odg"
   end if

    sFile = convertPath(gTesttoolpath + "graphics\required\input\spellb_" + iSprache + "."+ExtensionString)
    '/// create document, if it doesn't exist, else skip this case :-) ///'
    if (dir(sFile)="") then
        '/// open application ///'
        Call  hNewDocument

        '/// activate all languages in options ///'
        '///+ Tools->Options ///'
        ToolsOptions
        '///+ select tabpage 'Languages' from set 'Language Settings' ///'
        hToolsOptions("LANGUAGESETTINGS","Languages")
        kontext "TabSprachen"
        '///+ save state and check checkbox 'Asian languages support' ///'
        '/// if the language is Asian, skip this part ///'
        printlog "iSprache = " + iSprache
        if bAsianLan = FALSE then
           bAsian = Aktivieren.isEnabled
           Aktivieren.check
        endif
        '///+ save state and  check checkbox 'Complex text layout (CTL) support' ///'
        bComplex = ComplexScriptEnabled.isEnabled
        ComplexScriptEnabled.check
        '///+ close dialog 'Options' with OK ///'
        Kontext "ExtrasOptionenDlg"
        ExtrasOptionenDlg.OK

        '/// get count of languages ///'
        '///+ Format->Character ///'
        FormatCharacter
        sleep 1
        Kontext
        '///+ switch to tabpage 'Font' ///'
        Messagebox.SetPage TabFont
        kontext "TabFont"
        sleep 1
        '///+ get count of languages for Western/Asian/CTL fonts ///'
        iWest    = LanguageWest.getItemCount
        iAsian   = LanguageEast.getItemCount
        iComplex = LanguageCTL.getItemCount
        if bAsianLan = True then
           if (iWest <> 144) then
              Warnlog "Western text font languages count wrong; expected: '113' is: '" + iWest + "'"
           else
              Printlog "Western text font languages count: " + iWest
           endif
           if (iAsian <> 8) then
              Warnlog "Asian text font languages count wrong; expected: '9' is: '" + iAsian + "'"
           else
              Printlog "Asian text font languages count  : " + iAsian
           endif
           if (iComplex <> 50) then
              Warnlog "CTL font languages count wrong; expected: '30' is: '" + iComplex + "'"
           else
              Printlog "CTL font languages count         : " + iComplex
           endif
        else
           if (iWest <> 113) then
              Warnlog "Western text font languages count wrong; expected: '113' is: '" + iWest + "'"
           else
              Printlog "Western text font languages count: " + iWest
           endif
           if (iAsian <> 9) then
              Warnlog "Asian text font languages count wrong; expected: '9' is: '" + iAsian + "'"
           else
              Printlog "Asian text font languages count  : " + iAsian
           endif
           if (iComplex <> 30) then
              Warnlog "CTL font languages count wrong; expected: '30' is: '" + iComplex + "'"
           else
              Printlog "CTL font languages count         : " + iComplex
           endif
        endif
	'///+ close dialog 'Character' with OK ///'
        TabFont.Ok

        WL_SD_TextEinfuegenDraw
        gMouseMove ( 1, 1, 100, 100 )

        '///+ print the language counts into the first line of the document ///'
        hTypeKeys(" "+iWest+" "+iAsian+" "+iComplex+"<return>")


        '/// set all languages to '[None]' ///'
        '///+ Format->Character ///'
        FormatCharacter
        kontext "TabFont"
        '///+ select '[None]' (should be the first entry in every listbox) ///'
        LanguageWest.select 1
        LanguageEast.select 1
        LanguageCTL.select 1
        '///+ close dialog 'Character' with OK ///'
        TabFont.Ok

        '/// print one line with language formated text for every language ///'
        for i = 1 to iWest
            '///+ Format->Character ///'
            FormatCharacter
                kontext "TabFont"
                '///+ select the next language ///'
                LanguageWest.select i
                sTemp = LanguageWest.getItemText (i)
                ListAppend(sLanguage(), sTemp)
                '///+ close dialog 'Character' with OK ///'
            TabFont.Ok
            '///+ type [return][number of language in list][Tab][Language name][Tab] ///'
            hTypeKeys(""+i+"<tab>"+sTemp+"<tab><return>")
        next i

        FormatCharacter
        kontext "TabFont"
        LanguageWest.select 1
        LanguageEast.select 1
        languageCTL.select 1
        TabFont.Ok

        for i = 1 to iAsian
            FormatCharacter
                Kontext
                kontext "TabFont"
                LanguageEast.select i
                sTemp = LanguageEast.getItemText (i)
                ListAppend(sLanguage(), sTemp)
            TabFont.Ok
            hTypeKeys(""+i+"<tab>"+sTemp+"<tab><return>")
        next i

        FormatCharacter
        kontext "TabFont"
        LanguageWest.select 1
        LanguageEast.select 1
        languageCTL.select 1
        TabFont.Ok

        for i = 1 to iComplex
            FormatCharacter
                Kontext
                kontext "TabFont"
                LanguageCTL.select i
                sTemp = LanguageCTL.getItemText (i)
                ListAppend(sLanguage(), sTemp)
            TabFont.Ok
            hTypeKeys(""+i+"<tab>"+sTemp+"<tab><return>")
        next i

        '/// save the created document & the languages list if they don't exists ///'
        hFileSaveAs (sFile)
        qaErrorLog "Created file. Please check it and then commit it! " + sTemp
        sTemp = convertPath(gTesttoolpath + "graphics\required\input\spellb_" + iSprache + ".txt")
        if (dir(sTemp)="") then
            ListWrite(sLanguage(), sTemp,"utf8")
        endif

        '/// restore the options ///'
        '///+ Tools->Options ///'
        ToolsOptions
        '///+ select tabpage 'Languages' from set 'Language Settings' ///'
        hToolsOptions("LANGUAGESETTINGS","Languages")
        kontext "TabSprachen"

        '///+ restore state of checkbox 'Asian languages support' ///'
        '/// if the language is Asian, skip this part ///'
        if bAsianLan = FALSE then
           if (bAsian <> TRUE) then
               Aktivieren.UNcheck
           endif
        endif
        '///+ restore state of checkbox 'Complex text layout (CTL) support' ///'
        if (bComplex <> TRUE) then
            ComplexScriptEnabled.UNcheck
        endif
        '///+ close dialog 'Options' with OK ///'
        Kontext "ExtrasOptionenDlg"
        ExtrasOptionenDlg.OK

        '/// close application ///'
        Call hCloseDocument
    endif
    
endcase 'tSetFormatCharacter
'--------------------------------------------------------
testcase tGetFormatCharacter

    qaerrorlog "tGetFormatCharacter outcommented due to too many qaerrorlogs"
    goto endsub
    Dim i as integer
    dim iWest(2) as integer
    dim iAsian(2) as integer
    dim iComplex(2) as integer
    dim bAsian as boolean
    dim bComplex as boolean
    dim sLanguage(500) as string
    dim sLanguageR(500) as string
    dim sTemp as string
    dim iTemp as integer
    dim sSpellBooks(30) as string

    if (gApplication = "IMPRESS") then 
       ExtensionString = "odp"
    else
       ExtensionString = "odg"
    end if
    
    '/// open the english document with all languages ///'
    hDateiOeffnen (convertPath(gTesttoolpath + "graphics\required\input\spellb_" + iSprache + "."+ExtensionString)
    ListRead(sLanguageR(), convertPath(gTesttoolpath + "graphics\required\input\spellb_1.txt"),"utf8")

    '/// activate all languages in options ///'
    '///+ Tools->Options ///'
    ToolsOptions
    '///+ select tabpage 'Languages' from set 'Language Settings' ///'
    hToolsOptions("LANGUAGESETTINGS","Languages")
    kontext "TabSprachen"
    '///+ save state and check checkbox 'Asian languages support' ///'
    bAsian = Aktivieren.isEnabled
    Aktivieren.check
    '///+ save state and  check checkbox 'Complex text layout (CTL) support' ///'
    bComplex = ComplexScriptEnabled.isEnabled
    ComplexScriptEnabled.check
    '///+ close dialog 'Options' with OK ///'
    Kontext "ExtrasOptionenDlg"
    ExtrasOptionenDlg.OK
    sleep (1)
    '/// get count of languages ///'
    hTypeKeys("<tab><f2>")
    '///+ first how many are in the reference document (printed in the first line)///'
    hTypeKeys("<mod1 home><shift end>")
    sleep (1)
    editcopy
    sTemp = getClipboard
    iTemp = inStr(2,sTemp, " ")
    iWest(1) = mid(sTemp, 2, iTemp-2)
    i = inStr(iTemp+1,sTemp, " ")
    iAsian(1) = mid(sTemp, iTemp+1, iTemp-i)
    iComplex(1) = right(sTemp, Len(sTemp) - i)
    sleep (1)
    '///+ Format->Character ///'
    FormatCharacter
    sleep 1
    Kontext
    '///+ switch to tabpage 'Font' ///'
    Messagebox.SetPage TabFont
    kontext "TabFont"
    sleep 1
    '///+ get count of languages for Western/Asian/CTL fonts ///'
    iWest(2)    = LanguageWest.getItemCount
    iAsian(2)   = LanguageEast.getItemCount
    iComplex(2) = LanguageCTL.getItemCount
    if (iWest(2) <> iWest(1)) then
        Warnlog "Western text font languages count wrong; expected: '" + iWest(1) + "' is: '" + iWest(2) + "'"
    else
        Printlog "Western text font languages count: " + iWest(2)
    endif
    if (iAsian(2) <> iAsian(1)) then
        Warnlog "Asian text font languages count wrong; expected: '" + iAsian(1) + "' is: '" + iAsian(2) + "'"
    else
        Printlog "Asian text font languages count  : " + iAsian(2)
    endif
    if (iComplex(2) <> iComplex(1)) then
        Warnlog "CTL font languages count wrong; expected: '" + iComplex(1) + "' is: '" + iComplex(2) + "'"
    else
        Printlog "CTL font languages count         : " + iComplex(2)
    endif
    '///+ close dialog 'Character' with OK ///'
    TabFont.Ok

    '/// write the language for every line in the current language ///'
    hTypeKeys("<mod1 home><down><home>")
    for i = 1 to iWest(2)
        FormatCharacter
            Kontext
            kontext "TabFont"
            iTemp = LanguageWest.getSelIndex
            sTemp = LanguageWest.getSelText
            ListAppend(sLanguage(), sTemp)
        TabFont.Ok
        '///+ type [end][number of language in list][Tab][Language name][down][home] ///'
        hTypeKeys("<end>"+iTemp+"<tab>"+sTemp+"<down><home>")
    next i

    for i = 1 to iAsian(2)
        FormatCharacter
            Kontext
            kontext "TabFont"
            iTemp = LanguageEast.getSelIndex
            sTemp = LanguageEast.getSelText
            ListAppend(sLanguage(), sTemp)
        TabFont.Ok
        hTypeKeys("<end>"+iTemp+"<tab>"+sTemp+"<down><home>")
    next i

    for i = 1 to iComplex(2)
        FormatCharacter
            Kontext
            kontext "TabFont"
            iTemp = LanguageCTL.getSelIndex
            sTemp = LanguageCTL.getSelText
            ListAppend(sLanguage(), sTemp)
        TabFont.Ok
        hTypeKeys("<end>"+iTemp+"<tab>"+sTemp+"<down><home>")
    next i

    '/// save the created document & the languages list ///'
    sTemp = convertPath(gOfficePath + "user\work\spellb_" + iSprache)
    hFileSaveAsKill (sTemp)
    sTemp = convertPath(gOfficePath + "user\work\spellb_" + iSprache + ".txt")
    if (dir(sTemp)<>"") then
        kill (sTemp)
    endif
    ListWrite(sLanguage(), sTemp,"utf8")

    for i = 1 to ListCount(sLanguageR())
        select case i
            case 1:printlog " * Western text font languages"
            case iWest(2)+1:printlog " * Asian text font languages"
            case iWest(2)+iAsian(2)+1:printlog " * CTL font languages"
        end select
        if (sLanguageR(i) <> sLanguage(i)) then
            if (instr(sLanguage(i), "[") > 0) then ' [None] - Entry ?
                qaErrorlog "#i15863# - " + i + " '" + sLanguageR(i) + "' : '" + sLanguage(i) + "'"
            else
                qaErrorlog "#112362# - " + i + " '" + sLanguageR(i) + "' : '" + sLanguage(i) + "'"
            endif
        endif
    next i

    '/// close application ///'
    Call hCloseDocument
endcase 'tGetFormatCharacter