cvsimport
[fvwm-themes.git] / scripts / FvwmScript-FontSelector
blob0cba8276c3c47746c22fe1205a230ac3caceaaa9
1 # This script is free software; you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation; either version 2 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16 #-----------------------------------------------------------------------------
17 #     Copyright 2000, Olivier Chapuis
18 #-----------------------------------------------------------------------------
20 WindowTitle {Font Selector}
21 WindowSize 600 400
22 Font    -adobe-helvetica-bold-r-*-*-12-*
24 Init
25 Begin
26     Set $Lang = {}
27     Set $Color = {}
28     Set $Launched = 0
29     Set $return = {}
30     Set $TextColorset = {}
31     # Arguments
32     Set $i = 1
33     Set $arg = (GetScriptArgument $i)
34     While $arg <> {} Do
35     Begin
36         Set $j = (Add $i 1)
37         If $arg == {--text-colorset} Then
38             Set $TextColorset = (GetScriptArgument $j)
39         If $arg == {--launched} Then
40             Set $Launched = (GetScriptArgument $j)
41         If $arg == {--lang} Then
42             Set $Lang = (GetScriptArgument $j)
43         If $arg == {--font} Then
44             Set $Color = (GetScriptArgument $j)
45         Set $i = (Add $i 2)
46         Set $arg = (GetScriptArgument $i)
47     End
49     If $TextColorset <> {} Then
50     Begin
51         ChangeColorset 11 $TextColorset
52         ChangeColorset 110 $TextColorset
53         ChangeColorset 111 $TextColorset
54         ChangeColorset 112 $TextColorset
55         ChangeColorset 113 $TextColorset
56         ChangeColorset 114 $TextColorset
57         ChangeColorset 201 $TextColorset
58         ChangeColorset 311 $TextColorset
59         ChangeColorset 381 $TextColorset
60     End
62     # luanched or not
63     If $Launched == 0 Then
64     Begin
65         ShowWidget 3
66     End
67     Else
68     Begin
69         ShowWidget 2
70     End
72     # Internationalization
73     Set $IsAdjustable = {The selected font is adjustable}
74     Set $NotAdjustable = {The selected font is not adjustable}
75     
76     # The Font description
77     Set $Foundry = {misc}
78     Set $Family = {fixed}
79     Set $Weight = {*}
80     Set $Slant = {*}
81     Set $Width = {*}
82     Set $Style = {*}
83     Set $PixSize = {*}
84     Set $PtSize = {*}
85     Set $XRes = {*}
86     Set $YRes = {*}
87     Set $Spacing = {*}
88     Set $AvgWidth = {*}
89     Set $Charset = {*-*}
91     # More description:
92     Set $ScaleAdjust = 0
94     Set $TheFont = {-}$Foundry{-}$Family{-}$Weight{-}$Slant{-}$Width{-}$Style{-}$PixSize{-}$PtSize{-}$XRes{-}$YRes{-}$Spacing{-}$AvgWidth{-}$Charset
96     # list of fonts here a font is $Family ($Foundry):
97     Set $FontList = {}
99     # Then we have the filter for $FontList
100     Set $FilterFoundry = {*}
101     Set $FilterFamily = {*}
102     Set $FilterWeight = {*}
103     Set $FilterSlant = {*}
104     Set $FilterWidth = {*}
105     Set $FilterStyle = {*}
106     Set $FilterPixSize = {*}
107     Set $FilterPtSize = {*}
108     Set $FilterXRes = {*}
109     Set $FilterYRes = {*}
110     Set $FilterSpacing = {*}
111     Set $FilterAvgWidth = {*}
112     Set $FilterCharset = {*-*}
114     # More description:
115     Set $FilterScaleAdjust = 0
117     Set $FontFilter = {-}$FilterFoundry{-}$FilterFamily{-}$FilterWeight{-}$FilterSlant{-}$FilterWidth{-}$FilterStyle{-}$FilterPixSize{-}$FilterPtSize{-}$FilterXRes{-}$FilterYRes{-}$FilterSpacing{-}$FilterAvgWidth{-}$FilterCharset
119     # Then we have two lists:
121     # First list is the current state: the value that can be modified
122     # directely relatively to the $TheFont
123     Set $FoundryList = {*}
124     Set $FamilyList = {*}
125     Set $WeightList = {*}
126     Set $SlantList = {*}
127     Set $WidthList = {*}
128     Set $StyleList = {*}
129     Set $PixSizeList = {*}
130     Set $PtSizeList = {*}
131     Set $XResList = {*}
132     Set $YResList = {*}
133     Set $SpacingList = {*}
134     Set $AvgWidthList = {*}
135     Set $CharsetList = {*-*}
137     # Second list is the list of all possible value for setting the filter
138     Set $FilterFoundryList = {*}
139     Set $FilterFamilyList = {*}
140     Set $FilterWeightList = {*}
141     Set $FilterSlantList = {*}
142     Set $FilterWidthList = {*}
143     Set $FilterStyleList = {*}
144     Set $FilterPixSizeList = {*}
145     Set $FilterPtSizeList = {*}
146     Set $FilterXResList = {*}
147     Set $FilterYResList = {*}
148     Set $FilterSpacingList = {*}
149     Set $FilterAvgWidthList = {*}
150     Set $FilterCharsetList = {*-*}
152     ChangeValue 311 1
153     ChangeValue 381 1
155     Set $InStart = 1
156     Set $StartCount = 0
157     Set $FontReset = {}
159     Set $Window = {Main}
162 #----------------------------------------------------------------------------
164 PeriodicTasks
165 Begin
167     If $HideMain == 1 Then
168     Begin
169         Set $HideMain = 0
170         HideWidget 10
171         HideWidget 11
172         HideWidget 20
173         HideWidget 21
174         HideWidget 30
175         HideWidget 31
176         HideWidget 35
177         HideWidget 36
178         HideWidget 40
179         HideWidget 41
180         HideWidget 50
181         HideWidget 51
182         HideWidget 60
183         HideWidget 61
184         HideWidget 95
185         HideWidget 96
186         HideWidget 100
187         HideWidget 101
188         HideWidget 110
189         HideWidget 111
190         HideWidget 112
191         HideWidget 113
192         HideWidget 114
193     End
195     If $HideInfo == 1 Then
196     Begin
197         Set $HideInfo = 0
198         HideWidget 200
199         HideWidget 201
200         HideWidget 202
201     End
203     If $HideFilter == 1 Then
204     Begin
205         Set $HideFilter = 0
206         HideWidget 300
207         HideWidget 310
208         HideWidget 311
209         HideWidget 320
210         HideWidget 321
211         HideWidget 330
212         HideWidget 331
213         HideWidget 340
214         HideWidget 341
215         HideWidget 350
216         HideWidget 351
217         HideWidget 360
218         HideWidget 361
219         HideWidget 370
220         HideWidget 371
221         HideWidget 380
222         HideWidget 381
223         HideWidget 500
224         
225     End
227     If $ShowMain == 1 Then
228     Begin
229         Set $ShowMain = 0
230         ShowWidget 10
231         ShowWidget 11
232         ShowWidget 20
233         ShowWidget 21
234         ShowWidget 30
235         ShowWidget 31
236         ShowWidget 35
237         ShowWidget 36
238         ShowWidget 40
239         ShowWidget 41
240         ShowWidget 50
241         ShowWidget 51
242         ShowWidget 60
243         ShowWidget 61
244         ShowWidget 95
245         ShowWidget 96
246         ShowWidget 100
247         ShowWidget 101
248         Set $ChangeFont = 1
249         Set $Window = {Main}
250     End
252     If $ShowInfo == 1 Then
253     Begin
254         Set $ShowInfo = 0
255         ShowWidget 200
256         ShowWidget 201
257         ShowWidget 202
258         Set $Window = {Info}
259     End
260     
261     If $ShowFilter == 1 Then
262     Begin
263         Set $ShowFilter = 0
264         ShowWidget 300
265         ShowWidget 310
266         ShowWidget 311
267         ShowWidget 320
268         ShowWidget 321
269         ShowWidget 330
270         ShowWidget 331
271         ShowWidget 340
272         ShowWidget 341
273         ShowWidget 350
274         ShowWidget 351
275         ShowWidget 360
276         ShowWidget 361
277         ShowWidget 370
278         ShowWidget 371
279         ShowWidget 380
280         ShowWidget 381
281         ShowWidget 500
282     End
284     # -------------------------------------------------------------------
285     If $InStart == 1 Then
286     Begin
287         Set $StartCount = (Add $StartCount 1)
288         If $StartCount > 9 Then
289         Begin
290             If $StartCount == 10 Then
291             Begin
292                 Set $GetAll = 1
293                 Set $ChangeFont = 1
294             End
295             Else
296             Begin
297                 Set $InStart = 0
298                 Set $IndexIsSet = 1
299                 Set $ParseLists = 1
300                 Set $SetFilterLists = 1
301             End
302         End
303     End
305     #---------------------------------------------------------------------
306     If $UpdateTheFont == 1 Then
307     Begin
309         Set $UpdateTheFont = 0
310         Set $TheFont = {-}$Foundry{-}$Family{-}$Weight{-}$Slant{-}$Width{-}$Style{-}$PixSize {-}$PtSize{-}$XRes{-}$YRes{-}$Spacing{-}$AvgWidth{-}$Charset
312     End
314     #---------------------------------------------------------------------
315     If $GetAll == 1 Then
316     Begin
317         Set $GetAll = 0
318         Set $cmd = {fvwm-themes-script --font --type="font-list-all-list-filter-list" --font-current="}$TheFont{"}$FontReset
319         Set $Config = (GetOutput $cmd 1 -1)
320         Set $ParseFontList = 1
321         Set $ParseLists = 1
322         Set $SetAllLists = 1
323     End
325     #---------------------------------------------------------------------
326     If $GetFontList == 1 Then
327     Begin
328         Set $GetFontList = 0
329         Set $cmd = {fvwm-themes-script --font --type="font-list" --font-filter="}$FontFilter{" --font-current="}$TheFont{"}
330         Set $Config = (GetOutput $cmd 1 -1)
331         Set $ParseFontList = 1
332         #Set $ParseLists = 1
333         #Set $SetAllLists = 1
334         Set $index = 0
335     End
337     #---------------------------------------------------------------------
338     If $GetFontListAndAll == 1 Then
339     Begin
340         Set $GetFontListAndAll = 0
341         Set $cmd = {fvwm-themes-script --font --type="font-list-all-list" --font-filter="}$FontFilter{" --font-current="}$TheFont{"}
342         If $InStart == 1 Then
343             Set $cmd = $cmd { --font-start}
344         Set $Config = (GetOutput $cmd 1 -1)
345         Set $ParseFontList = 1
346         Set $ParseLists = 1
347         Set $SetAllLists = 1
348         
349     End
351     #---------------------------------------------------------------------
352     If $GetAllLists == 1 Then
353     Begin
354         Set $GetAllLists = 0
355         Set $cmd = {fvwm-themes-script --font --type="all-list" --font-filter="}$FontFilter{" --font-current="}$TheFont{" --font-index=}$FontIndex
356         Set $Config = (GetOutput $cmd 1 -1)
357         Set $ParseLists = 1
358         Set $IndexIsSet = 0
359         Set $SetAllLists = 1
360     End
362     #---------------------------------------------------------------------
363     If $ParseFontList == 1 Then
364     Begin
365         Set $ParseFontList = 0
367         Set $FontIndex = (StrCopy $Config 1 3)
368         Set $tmp = (StrCopy $FontIndex 1 1)
369         If $tmp == 0 Then
370         Begin
371             Set $FontIndex = (StrCopy $FontIndex 2 3)
372             Set $tmp = (StrCopy $FontIndex 1 1)
373             If $tmp == 0 Then
374                 Set $FontIndex = (StrCopy $FontIndex 2 2)
375         End
376         ChangeValue 11 $FontIndex
377         ChangeMinValue 11 (Add $FontIndex -3)
378         Set $index = 3
380         Set $notdone = 1
381         Set $FontList = {}
382         While $notdone == 1 Do
383         Begin
384             Set $index = (Add $index 1)
385             Set $id = (StrCopy $Config $index $index)
386             If $id == {!} Then
387                 Set $notdone = 0
388             Else
389                 Set $FontList = $FontList $id
390             If $id == {} Then
391                 Set $notdone = 0
392         End
393         Set $IndexIsSet = 1
394         ChangeTitle 11 $FontList
395         If $FontIndex == 0 Then
396         Begin 
397             Set $SetAllLists = 1
398             Set $SetAllToNull = 1
399          End
401         # --------------- the font filter
402         # font filter Foundry
403         Set $notdone = 1
404         Set $FilterFoundry = {}
405         While $notdone == 1 Do
406         Begin
407             Set $index = (Add $index 1)
408             Set $id = (StrCopy $Config $index $index)
409             If $id == {!} Then
410                 Set $notdone = 0
411             Else
412                 Set $FilterFoundry = $FilterFoundry $id
413             If $id == {} Then
414                 Set $notdone = 0
415         End
417         # font filter family
418         Set $notdone = 1
419         Set $FilterFamily = {}
420         While $notdone == 1 Do
421         Begin
422             Set $index = (Add $index 1)
423             Set $id = (StrCopy $Config $index $index)
424             If $id == {!} Then
425                 Set $notdone = 0
426             Else
427                 Set $FilterFamily = $FilterFamily $id
428             If $id == {} Then
429                 Set $notdone = 0
430         End
432         # font filter weight
433         Set $notdone = 1
434         Set $FilterWeight = {}
435         While $notdone == 1 Do
436         Begin
437             Set $index = (Add $index 1)
438             Set $id = (StrCopy $Config $index $index)
439             If $id == {!} Then
440                 Set $notdone = 0
441             Else
442                 Set $FilterWeight = $FilterWeight $id
443             If $id == {} Then
444                 Set $notdone = 0
445         End
447         # font filter slant
448         Set $notdone = 1
449         Set $FilterSlant = {}
450         While $notdone == 1 Do
451         Begin
452             Set $index = (Add $index 1)
453             Set $id = (StrCopy $Config $index $index)
454             If $id == {!} Then
455                 Set $notdone = 0
456             Else
457                 Set $FilterSlant = $FilterSlant $id
458             If $id == {} Then
459                 Set $notdone = 0
460         End
462         # font filter width
463         Set $notdone = 1
464         Set $FilterWidth = {}
465         While $notdone == 1 Do
466         Begin
467             Set $index = (Add $index 1)
468             Set $id = (StrCopy $Config $index $index)
469             If $id == {!} Then
470                 Set $notdone = 0
471             Else
472                 Set $FilterWidth = $FilterWidth $id
473             If $id == {} Then
474                 Set $notdone = 0
475         End
477         # font filter style
478         Set $notdone = 1
479         Set $FilterStyle = {}
480         While $notdone == 1 Do
481         Begin
482             Set $index = (Add $index 1)
483             Set $id = (StrCopy $Config $index $index)
484             If $id == {!} Then
485                 Set $notdone = 0
486             Else
487                 Set $FilterStyle = $FilterStyle $id
488             If $id == {} Then
489                 Set $notdone = 0
490         End
492         # font filter pixsize
493         Set $notdone = 1
494         Set $FilterPixSize = {}
495         While $notdone == 1 Do
496         Begin
497             Set $index = (Add $index 1)
498             Set $id = (StrCopy $Config $index $index)
499             If $id == {!} Then
500                 Set $notdone = 0
501             Else
502                 Set $FilterPixSize = $FilterPixSize $id
503             If $id == {} Then
504                 Set $notdone = 0
505         End
507         # font filter PtSize
508         Set $notdone = 1
509         Set $FilterPtSize = {}
510         While $notdone == 1 Do
511         Begin
512             Set $index = (Add $index 1)
513             Set $id = (StrCopy $Config $index $index)
514             If $id == {!} Then
515                 Set $notdone = 0
516             Else
517                 Set $FilterPtSize = $FilterPtSize $id
518             If $id == {} Then
519                 Set $notdone = 0
520         End
522         # font filter XRes
523         Set $notdone = 1
524         Set $FilterXRes = {}
525         While $notdone == 1 Do
526         Begin
527             Set $index = (Add $index 1)
528             Set $id = (StrCopy $Config $index $index)
529             If $id == {!} Then
530                 Set $notdone = 0
531             Else
532                 Set $FilterXRes = $FilterXRes $id
533             If $id == {} Then
534                 Set $notdone = 0
535         End
537         # font filter YRes
538         Set $notdone = 1
539         Set $FilterYRes = {}
540         While $notdone == 1 Do
541         Begin
542             Set $index = (Add $index 1)
543             Set $id = (StrCopy $Config $index $index)
544             If $id == {!} Then
545                 Set $notdone = 0
546             Else
547                 Set $FilterYRes = $FilterYRes $id
548             If $id == {} Then
549                 Set $notdone = 0
550         End
552         # font filter Spacing
553         Set $notdone = 1
554         Set $FilterSpacing = {}
555         While $notdone == 1 Do
556         Begin
557             Set $index = (Add $index 1)
558             Set $id = (StrCopy $Config $index $index)
559             If $id == {!} Then
560                 Set $notdone = 0
561             Else
562                 Set $FilterSpacing = $FilterSpacing $id
563             If $id == {} Then
564                 Set $notdone = 0
565         End
567         # font filter AvgWidth
568         Set $notdone = 1
569         Set $FilterAvgWidth = {}
570         While $notdone == 1 Do
571         Begin
572             Set $index = (Add $index 1)
573             Set $id = (StrCopy $Config $index $index)
574             If $id == {!} Then
575                 Set $notdone = 0
576             Else
577                 Set $FilterAvgWidth = $FilterAvgWidth $id
578             If $id == {} Then
579                 Set $notdone = 0
580         End
582         # font filter Charset
583         Set $notdone = 1
584         Set $FilterCharset = {}
585         While $notdone == 1 Do
586         Begin
587             Set $index = (Add $index 1)
588             Set $id = (StrCopy $Config $index $index)
589             If $id == {!} Then
590                 Set $notdone = 0
591             Else
592                 Set $FilterCharset = $FilterCharset $id
593             If $id == {} Then
594                 Set $notdone = 0
595         End
597         Set $FontFilter = {-}$FilterFoundry{-}$FilterFamily{-}$FilterWeight{-}$FilterSlant{-}$FilterWidth{-}$FilterStyle{-}$FilterPixSize{-}$FilterPtSize{-}$FilterXRes{-}$FilterYRes{-}$FilterSpacing{-}$FilterAvgWidth{-}$FilterCharset
598         ChangeTitle 101 $FontFilter
599     End
601     #---------------------------------------------------------------------
602     If $ParseLists == 1 Then
603     Begin
604         Set $ParseLists = 0
605         
606         If $IndexIsSet <> {1} Then
607             Set $index = 0
608         
609         If $SetFilterLists == 1 Then
610         Begin
611             Set $index = (Add $index 1)    
612             Set $TmpFoundryIndex = (StrCopy $Config $index (Add $index 1))
613             Set $index = (Add $index 1)
614             Set $notdone = 1
615             Set $TmpFoundryList = {}
616             While $notdone == 1 Do
617             Begin
618                 Set $index = (Add $index 1)
619                 Set $id = (StrCopy $Config $index $index)
620                 If $id == {!} Then
621                     Set $notdone = 0
622                 Else
623                     Set $TmpFoundryList = $TmpFoundryList $id
624                 If $id == {} Then
625                     Set $notdone = 0
626             End
627             #Do {Echo TFL:}$TmpFoundryList
628         End
630         # weight
631         Set $index = (Add $index 1)    
632         Set $TmpWeightIndex = (StrCopy $Config $index (Add $index 1))
633         Set $index = (Add $index 1)
634         Set $notdone = 1
635         Set $TmpWeightList = {}
636         While $notdone == 1 Do
637         Begin
638             Set $index = (Add $index 1)
639             Set $id = (StrCopy $Config $index $index)
640             If $id == {!} Then
641                 Set $notdone = 0
642             Else
643                 Set $TmpWeightList = $TmpWeightList $id
644             If $id == {} Then
645                 Set $notdone = 0
646         End
647         
648         If $TmpWeightList == {No fonts} Then
649         Begin
650             Set $SetAllLists = 0
651             Set $SetFilterLists = 0
652             ChangeTitle 11 {No fonts}
653         End
654             
655         # slant
656         Set $index = (Add $index 1)
657         Set $TmpSlantIndex = (StrCopy $Config $index (Add $index 1))
658         Set $index = (Add $index 1)
659         Set $notdone = 1
660         Set $TmpSlantList = {}
661         While $notdone == 1 Do
662         Begin
663             Set $index = (Add $index 1)
664             Set $id = (StrCopy $Config $index $index)
665             If $id == {!} Then
666                 Set $notdone = 0
667             Else
668                 Set $TmpSlantList = $TmpSlantList $id
669             If $id == {} Then
670                 Set $notdone = 0
671         End
672         
673         # width
674         Set $index = (Add $index 1)
675         Set $TmpWidthIndex = (StrCopy $Config $index (Add $index 1))
676         Set $index = (Add $index 1)
677         Set $notdone = 1
678         Set $TmpWidthList = {}
679         While $notdone == 1 Do
680         Begin
681             Set $index = (Add $index 1)
682             Set $id = (StrCopy $Config $index $index)
683             If $id == {!} Then
684                 Set $notdone = 0
685             Else
686                 Set $TmpWidthList = $TmpWidthList $id
687             If $id == {} Then
688                 Set $notdone = 0
689         End
691         # style
692         Set $index = (Add $index 1)
693         Set $TmpStyleIndex = (StrCopy $Config $index (Add $index 1))
694         Set $index = (Add $index 1)
695         Set $notdone = 1
696         Set $TmpStyleList = {}
697         While $notdone == 1 Do
698         Begin
699             Set $index = (Add $index 1)
700             Set $id = (StrCopy $Config $index $index)
701             If $id == {!} Then
702                 Set $notdone = 0
703             Else
704                 Set $TmpStyleList = $TmpStyleList $id
705             If $id == {} Then
706                 Set $notdone = 0
707         End
709         # pixsize
710         Set $index = (Add $index 1)
711         Set $TmpPixSizeIndex = (StrCopy $Config $index (Add $index 1))
712         Set $index = (Add $index 1)
713         Set $notdone = 1
714         Set $TmpPixSizeList = {}
715         While $notdone == 1 Do
716         Begin
717             Set $index = (Add $index 1)
718             Set $id = (StrCopy $Config $index $index)
719             If $id == {!} Then
720                 Set $notdone = 0
721             Else
722                 Set $TmpPixSizeList = $TmpPixSizeList $id
723             If $id == {} Then
724                 Set $notdone = 0
725         End
726         
727         # ptsize
728         Set $index = (Add $index 1)
729         Set $TmpPtSizeIndex = (StrCopy $Config $index (Add $index 1))
730         Set $index = (Add $index 1)
731         Set $notdone = 1
732         Set $TmpPtSizeList = {}
733         While $notdone == 1 Do
734         Begin
735             Set $index = (Add $index 1)
736             Set $id = (StrCopy $Config $index $index)
737             If $id == {!} Then
738                 Set $notdone = 0
739             Else
740                 Set $TmpPtSizeList = $TmpPtSizeList $id
741             If $id == {} Then
742                 Set $notdone = 0
743         End
745         # xres
746         Set $index = (Add $index 1)
747         Set $TmpXResIndex = (StrCopy $Config $index (Add $index 1))
748         Set $index = (Add $index 1)
749         Set $notdone = 1
750         Set $TmpXResList = {}
751         While $notdone == 1 Do
752         Begin
753             Set $index = (Add $index 1)
754             Set $id = (StrCopy $Config $index $index)
755             If $id == {!} Then
756                 Set $notdone = 0
757             Else
758                 Set $TmpXResList = $TmpXResList $id
759             If $id == {} Then
760                 Set $notdone = 0
761         End
763         # yres
764         Set $index = (Add $index 1)
765         Set $TmpYResIndex = (StrCopy $Config $index (Add $index 1))
766         Set $index = (Add $index 1)
767         Set $notdone = 1
768         Set $TmpYResList = {}
769         While $notdone == 1 Do
770         Begin
771             Set $index = (Add $index 1)
772             Set $id = (StrCopy $Config $index $index)
773             If $id == {!} Then
774                 Set $notdone = 0
775             Else
776                 Set $TmpYResList = $TmpYResList $id
777             If $id == {} Then
778                 Set $notdone = 0
779         End
781         # Spacing
782         Set $index = (Add $index 1)
783         Set $TmpSpacingIndex = (StrCopy $Config $index (Add $index 1))
784         Set $index = (Add $index 1)
785         Set $notdone = 1
786         Set $TmpSpacingList = {}
787         While $notdone == 1 Do
788         Begin
789             Set $index = (Add $index 1)
790             Set $id = (StrCopy $Config $index $index)
791             If $id == {!} Then
792                 Set $notdone = 0
793             Else
794                 Set $TmpSpacingList = $TmpSpacingList $id
795             If $id == {} Then
796                 Set $notdone = 0
797         End
799         # AvgWidth
800         Set $index = (Add $index 1)
801         Set $TmpAvgWidthIndex = (StrCopy $Config $index (Add $index 1))
802         Set $index = (Add $index 1)
803         Set $notdone = 1
804         Set $TmpAvgWidthList = {}
805         While $notdone == 1 Do
806         Begin
807             Set $index = (Add $index 1)
808             Set $id = (StrCopy $Config $index $index)
809             If $id == {!} Then
810                 Set $notdone = 0
811             Else
812                 Set $TmpAvgWidthList = $TmpAvgWidthList $id
813             If $id == {} Then
814                 Set $notdone = 0
815         End
817         # charset
818         Set $index = (Add $index 1)
819         Set $TmpCharsetIndex = (StrCopy $Config $index (Add $index 1))
820         Set $index = (Add $index 1)
821         Set $notdone = 1
822         Set $TmpCharsetList = {}
823         While $notdone == 1 Do
824         Begin
825             Set $index = (Add $index 1)
826             Set $id = (StrCopy $Config $index $index)
827             If $id == {!} Then
828                 Set $notdone = 0
829             Else
830                 Set $TmpCharsetList = $TmpCharsetList $id
831             If $id == {} Then
832                 Set $notdone = 0
833         End
835         # current Foundry
836         Set $notdone = 1
837         Set $TmpFoundry = {}
838         While $notdone == 1 Do
839         Begin
840             Set $index = (Add $index 1)
841             Set $id = (StrCopy $Config $index $index)
842             If $id == {!} Then
843                 Set $notdone = 0
844             Else
845                 Set $TmpFoundry = $TmpFoundry $id
846             If $id == {} Then
847                 Set $notdone = 0
848         End
850         # current family
851         Set $notdone = 1
852         Set $TmpFamily = {}
853         While $notdone == 1 Do
854         Begin
855             Set $index = (Add $index 1)
856             Set $id = (StrCopy $Config $index $index)
857             If $id == {!} Then
858                 Set $notdone = 0
859             Else
860                 Set $TmpFamily = $TmpFamily $id
861             If $id == {} Then
862                 Set $notdone = 0
863         End
865         # current weight
866         Set $notdone = 1
867         Set $TmpWeight = {}
868         While $notdone == 1 Do
869         Begin
870             Set $index = (Add $index 1)
871             Set $id = (StrCopy $Config $index $index)
872             If $id == {!} Then
873                 Set $notdone = 0
874             Else
875                 Set $TmpWeight = $TmpWeight $id
876             If $id == {} Then
877                 Set $notdone = 0
878         End
880         # current slant
881         Set $notdone = 1
882         Set $TmpSlant = {}
883         While $notdone == 1 Do
884         Begin
885             Set $index = (Add $index 1)
886             Set $id = (StrCopy $Config $index $index)
887             If $id == {!} Then
888                 Set $notdone = 0
889             Else
890                 Set $TmpSlant = $TmpSlant $id
891             If $id == {} Then
892                 Set $notdone = 0
893         End
895         # current width
896         Set $notdone = 1
897         Set $TmpWidth = {}
898         While $notdone == 1 Do
899         Begin
900             Set $index = (Add $index 1)
901             Set $id = (StrCopy $Config $index $index)
902             If $id == {!} Then
903                 Set $notdone = 0
904             Else
905                 Set $TmpWidth = $TmpWidth $id
906             If $id == {} Then
907                 Set $notdone = 0
908         End
910         # current style
911         Set $notdone = 1
912         Set $TmpStyle = {}
913         While $notdone == 1 Do
914         Begin
915             Set $index = (Add $index 1)
916             Set $id = (StrCopy $Config $index $index)
917             If $id == {!} Then
918                 Set $notdone = 0
919             Else
920                 Set $TmpStyle = $TmpStyle $id
921             If $id == {} Then
922                 Set $notdone = 0
923         End
925         # current pixsize
926         Set $notdone = 1
927         Set $TmpPixSize = {}
928         While $notdone == 1 Do
929         Begin
930             Set $index = (Add $index 1)
931             Set $id = (StrCopy $Config $index $index)
932             If $id == {!} Then
933                 Set $notdone = 0
934             Else
935                 Set $TmpPixSize = $TmpPixSize $id
936             If $id == {} Then
937                 Set $notdone = 0
938         End
940         # current PtSize
941         Set $notdone = 1
942         Set $TmpPtSize = {}
943         While $notdone == 1 Do
944         Begin
945             Set $index = (Add $index 1)
946             Set $id = (StrCopy $Config $index $index)
947             If $id == {!} Then
948                 Set $notdone = 0
949             Else
950                 Set $TmpPtSize = $TmpPtSize $id
951             If $id == {} Then
952                 Set $notdone = 0
953         End
955         # current XRes
956         Set $notdone = 1
957         Set $TmpXRes = {}
958         While $notdone == 1 Do
959         Begin
960             Set $index = (Add $index 1)
961             Set $id = (StrCopy $Config $index $index)
962             If $id == {!} Then
963                 Set $notdone = 0
964             Else
965                 Set $TmpXRes = $TmpXRes $id
966             If $id == {} Then
967                 Set $notdone = 0
968         End
970         # current YRes
971         Set $notdone = 1
972         Set $TmpYRes = {}
973         While $notdone == 1 Do
974         Begin
975             Set $index = (Add $index 1)
976             Set $id = (StrCopy $Config $index $index)
977             If $id == {!} Then
978                 Set $notdone = 0
979             Else
980                 Set $TmpYRes = $TmpYRes $id
981             If $id == {} Then
982                 Set $notdone = 0
983         End
985         # current Spacing
986         Set $notdone = 1
987         Set $TmpSpacing = {}
988         While $notdone == 1 Do
989         Begin
990             Set $index = (Add $index 1)
991             Set $id = (StrCopy $Config $index $index)
992             If $id == {!} Then
993                 Set $notdone = 0
994             Else
995                 Set $TmpSpacing = $TmpSpacing $id
996             If $id == {} Then
997                 Set $notdone = 0
998         End
1000         # current AvgWidth
1001         Set $notdone = 1
1002         Set $TmpAvgWidth = {}
1003         While $notdone == 1 Do
1004         Begin
1005             Set $index = (Add $index 1)
1006             Set $id = (StrCopy $Config $index $index)
1007             If $id == {!} Then
1008                 Set $notdone = 0
1009             Else
1010                 Set $TmpAvgWidth = $TmpAvgWidth $id
1011             If $id == {} Then
1012                 Set $notdone = 0
1013         End
1015         # current Charset
1016         Set $notdone = 1
1017         Set $TmpCharset = {}
1018         While $notdone == 1 Do
1019         Begin
1020             Set $index = (Add $index 1)
1021             Set $id = (StrCopy $Config $index $index)
1022             If $id == {!} Then
1023                 Set $notdone = 0
1024             Else
1025                 Set $TmpCharset = $TmpCharset $id
1026             If $id == {} Then
1027                 Set $notdone = 0
1028         End
1030         Set $index = (Add $index 1)
1031         Set $TmpScaleAdjust = (StrCopy $Config $index $index)
1032         Set $index = (Add $index 2)
1033         Set $HasNoMatch = (StrCopy $Config $index $index)
1034         Set $index = (Add $index 1)
1035         If $HasNoMatch == {1} Then
1036         Begin
1037             Set $SetAllToNull = 1
1038             Set $FontIndex = 0
1039             ChangeValue 11 0
1040             Set $HasNoMatch = 0
1041         End
1042     End
1044     #---------------------------------------------------------------------
1045     If $SetFilterLists == 1 Then
1046     Begin
1047         Set $SetFilterLists = 0
1049         Set $FilterFoundryList = $TmpFoundryList
1050         Set $FilterFoundryIndex = $TmpFoundryIndex
1051         ChangeTitle 311 $FilterFoundryList
1052         ChangeValue 311 $FilterFoundryIndex
1053         ChangeMinValue 311 $FilterFoundryIndex
1055         Set $FilterWeightList = $TmpWeightList
1056         Set $FilterWeightIndex = $TmpWeightIndex
1057         ChangeTitle 321 $FilterWeightList
1058         ChangeValue 321 $FilterWeightIndex
1060         Set $FilterSlantList = $TmpSlantList
1061         ChangeTitle 331 $FilterSlantList
1062         Set $FilterSlantIndex = $TmpSlantIndex
1063         ChangeValue 331 $FilterWeightIndex
1065         Set $FilterWidthList = $TmpWidthList
1066         ChangeTitle 341 $FilterWidthList
1067         Set $FilterWidthIndex = $TmpWidthIndex
1068         ChangeValue 341 $FilterWidthIndex
1070         #Set $FilterStyleList = $TmpStyleList
1071         #Set $FilterPixSizeList = $TmpPixSizeList
1072         #Set $FilterPtSizeList = $TmpPtSizeList
1074         Set $FilterXResList = $TmpXResList
1075         ChangeTitle 351 $FilterXResList
1076         Set $FilterXResIndex = $TmpXResIndex
1077         ChangeValue 351 $FilterXResIndex
1079         Set $FilterYResList = $TmpYResList
1080         ChangeTitle 361 $FilterYResList
1081         Set $FilterYResIndex = $TmpYResIndex
1082         ChangeValue 361 $FilterYResIndex
1084         Set $FilterSpacingList = $TmpSpacingList
1085         ChangeTitle 371 $FilterSpacingList
1086         Set $FilterSpacingIndex = $TmpSpacingIndex
1087         ChangeValue 371 $FilterSpacingIndex
1089         #Set $FilterAvgWidthList = $TmpAvgWidthList
1091         Set $FilterCharsetList = $TmpCharsetList
1092         ChangeTitle 381 $FilterCharsetList
1093         Set $FilterCharsetIndex = $TmpCharsetIndex
1094         ChangeValue 381 $FilterCharsetIndex
1095         ChangeMinValue 381 $FilterCharsetIndex
1097     End
1099     # ----------------------------------------------------------------------
1100     If $SetAllToNull == 1 Then
1101     Begin
1102             Set $SetAllToNull = 0
1103             Set $TmpFoundryIndex = 0
1104             Set $TmpFamilyIndex = 0
1105             Set $TmpWeightIndex = 0
1106             Set $TmpSlantIndex = 0
1107             Set $TmpWidthIndex = 0
1108             Set $TmpStyleIndex = 0
1109             Set $TmpPixSizeIndex = 0
1110             Set $TmpPtSizeIndex = 0
1111             Set $TmpXResIndex = 0
1112             Set $TmpYResIndex = 0
1113             Set $TmpSpacingIndex = 0
1114             Set $TmpAvgWidthIndex = 0
1115             Set $TmpCharsetIndex = 0
1116             Set $TmpFoundryList = {*}
1117             Set $TmpFamilyList = {*}
1118             Set $TmpWeightList = {*}
1119             Set $TmpSlantList = {*}
1120             Set $TmpWidthList = {*}
1121             Set $TmpStyleList = {*}
1122             Set $TmpPixSizeList = {*}
1123             Set $TmpPtSizeList = {*}
1124             Set $TmpXResList = {*}
1125             Set $TmpYResList = {*}
1126             Set $TmpSpacingList = {*}
1127             Set $TmpAvgWidthList = {*}
1128             Set $TmpCharsetList = {*-*}
1129     End
1130     #---------------------------------------------------------------------
1131     If $SetAllLists == 1 Then
1132     Begin
1133         Set $SetAllLists = 0
1135         Set $WeightList = $TmpWeightList
1136         ChangeTitle 31 $WeightList
1137         Set $WeightIndex = $TmpWeightIndex
1138         ChangeValue 31 $WeightIndex
1140         Set $SlantList = $TmpSlantList
1141         ChangeTitle 41 $SlantList
1142         Set $SlantIndex = $TmpSlantIndex
1143         ChangeValue 41 $SlantIndex
1145         Set $WidthList = $TmpWidthList
1146         ChangeTitle 51 $WidthList
1147         Set $WidthIndex = $TmpWidthIndex
1148         ChangeValue 51 $WidthIndex
1150         Set $StyleList = $TmpStyleList
1152         Set $PixSizeList = $TmpPixSizeList
1153         ChangeTitle 21 $PixSizeList
1154         Set $PixSizeIndex = $TmpPixSizeIndex
1155         ChangeValue 21 $PixSizeIndex
1157         Set $PtSizeList = $TmpPtSizeList
1158         Set $XResList = $TmpXResList
1159         Set $YResList = $TmpYResList
1161         Set $SpacingList = $TmpSpacingList
1162         ChangeTitle 36 $SpacingList
1163         Set $SpacingIndex = $TmpSpacingIndex
1164         ChangeValue 36 $SpacingIndex
1166         Set $AvgWidthList = $TmpAvgWidthList
1168         Set $CharsetList = $TmpCharsetList
1169         ChangeTitle 61 $CharsetList
1170         Set $CharsetIndex = $TmpCharsetIndex
1171         ChangeValue 61 $CharsetIndex
1173         If $FontIndex <> 0 Then
1174         Begin
1175             Set $Foundry = $TmpFoundry
1176             Set $Family = $TmpFamily
1177             Set $Weight = $TmpWeight
1178             Set $Slant = $TmpSlant
1179             Set $Width = $TmpWidth
1180             Set $Style = $TmpStyle
1181             Set $PixSize = $TmpPixSize
1182             Set $PtSize = $TmpPtSize
1183             Set $XRes = $TmpXRes
1184             Set $YRes = $TmpYRes
1185             Set $Spacing = $TmpSpacing
1186             Set $AvgWidth = $TmpAvgWidth
1187             Set $Charset = $TmpCharset
1189             Set $ScaleAdjust = $TmpScaleAdjust
1190             If $ScaleAdjust == 2 Then
1191             Begin
1192                 ChangeTitle 95 $IsAdjustable
1193             End
1194             Else
1195             Begin
1196                 ChangeTitle 95 $NotAdjustable
1197             End
1198         End
1199     End
1201     #---------------------------------------------------------------------
1202     If $ChangeFont == 1 Then
1203     Begin
1204         Set $ChangeFont = 0
1206         Set $TheFont = {-}$Foundry{-}$Family{-}$Weight{-}$Slant{-}$Width{-}$Style{-}$PixSize {-}$PtSize{-}$XRes{-}$YRes{-}$Spacing{-}$AvgWidth{-}$Charset
1207         
1208         ChangeTitle 2 $TheFont
1209         ChangeTitle 3 $TheFont
1211         Set $tmp = 110
1212         While $tmp <> 115 Do
1213         Begin
1214             ChangeFont $tmp $TheFont
1215             HideWidget $tmp
1216             Set $tmp = (Add $tmp 1)
1217         End
1218         Set $tmp = 0
1219         If $PixSize < 13 Then
1220             Set $tmp = 110
1221         If $PixSize < 25 Then
1222         Begin
1223             If $tmp == 0 Then
1224                 Set $tmp = 111
1225         End
1226         If $PixSize < 37 Then
1227         Begin
1228             If $tmp == 0 Then
1229                 Set $tmp = 112
1230         End
1231         If $PixSize < 51 Then
1232         Begin
1233             If $tmp == 0 Then
1234                 Set $tmp = 113
1235         End
1236         If $tmp == 0 Then
1237             Set $tmp = 114
1239         ShowWidget $tmp
1241     End
1243     If $BuildAgain == 1 Then
1244     Begin
1245         Set $BuildAgain = 0
1246         Set $GetAllLists = 1
1247         Set $ChangeFont = 1
1248     End
1252 #----------------------------------------------------------------------------
1253 # The widgets
1254 #----------------------------------------------------------------------------
1256 # Title for selected fonts Launched
1257 Widget 1
1258 Property
1259     Flags NoReliefString
1260     Position 10 9
1261     Type ItemDraw
1262     Title {Selected Fonts:     }
1263 Main
1264 Case message of
1265  SingleClic :
1266  Begin
1267  End
1270 # The selected fonts not Lauched
1271 Widget 3
1272 Property
1273     Font -*-fixed-medium-r-semicondensed-*-13-*
1274     Flags NoReliefString Hidden
1275     Position 130 5
1276     Size 400 20 
1277     Type TextField
1278     Title {                                                                       }
1279 Main
1280 Case message of
1281  SingleClic :
1282  Begin
1283  End
1286 # the selected font launched
1287 Widget 2
1288 Property
1289     Flags NoReliefString Hidden
1290     Font -*-fixed-medium-r-semicondensed-*-13-*
1291     Position 130 9
1292     Size 420 20
1293     Type ItemDraw
1294     Title {}
1295 Main
1296 Case message of
1297  SingleClic :
1298  Begin
1299  End
1302 # the selected font launched
1303 Widget 5
1304 Property
1305     Position 5 35
1306     Size 590 320
1307     Type Rectangle
1308     Title {}
1309 Main
1310 Case message of
1311  SingleClic :
1312  Begin
1313  End
1316 # ---------------------------- Fonts lists
1318 # Title for fonts
1319 Widget 10
1320 Property
1321     Flags NoReliefString
1322     Position 15 40
1323     Size 200 20
1324     Type ItemDraw
1325     Title {Fonts:}
1326 Main
1327 Case message of
1328  SingleClic :
1329  Begin
1330  End
1334 # List of fonts
1335 Widget 11
1336 Property
1337     Flags NoReliefString
1338     Font -*-fixed-medium-r-semicondensed-*-13-*
1339     Position 15 60
1340     Size 200 150
1341     Type List
1342     Title {|||LOADING FONTS ...}
1343 Main
1344 Case message of
1345  SingleClic :
1346  Begin
1347     Set $tmp = (GetValue 11)
1348     If $tmp <> $FontIndex Then
1349     Begin
1350         Set $FontIndex = $tmp
1351         Set $GetAllLists = 1
1352         Set $ChangeFont = 1
1353         # For simplification conserve only the size
1354         #Set $Foundry = {*}
1355         #Set $Family = {*}
1356         #Set $Weight = {*}
1357         #Set $Slant = {*}
1358         #Set $Width = {*}
1359         #Set $Style = {*}
1360         #Set $PixSize = {*}
1361         #Set $PtSize = {*}
1362         #Set $XRes = {*}
1363         #Set $YRes = {*}
1364         #Set $Spacing = {*}
1365         #Set $AvgWidth = {*}
1366         #Set $Charset = {*-*}
1367         #Set $UpdateTheFont = 1
1368         #Set $BuildAgain = 1
1369     End
1370  End
1373 # ---------------------------- Font Parameters
1375 # Title for Size
1376 Widget 20
1377 Property
1378     Flags NoReliefString
1379     Position 230 60
1380     Type ItemDraw
1381     Title {Size:           }
1382 Main
1383 Case message of
1384  SingleClic :
1385  Begin
1386  End
1389 # Popup for Size
1390 Widget 21
1391 Property
1392     Font 6x10
1393     Flags NoReliefString
1394     Position 320 55
1395     Type PopupMenu
1396     Title {     }
1397 Main
1398 Case message of
1399  SingleClic :
1400  Begin
1401     Set $tmpind = (Add (GetValue 21) -1)
1402     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$PixSizeList{");$a=$l[}$tmpind{];print "$a\n"'}
1403     Set $tmp = (GetOutput $cmd 1 -1)
1404     If $tmp <> $PixSize Then
1405     Begin
1406         Set $PixSize = $tmp
1407         Set $PixSizeIndex = $tmpind
1408         Set $LastChange = {PixSize}
1409         Set $UpdateTheFont = 1
1410         Set $GetAllLists = 1
1411         Set $ChangeFont = 1
1412     End
1413  End
1416 # Title for Weight
1417 Widget 30
1418 Property
1419     Flags NoReliefString
1420     Position 230 90
1421     Type ItemDraw
1422     Title {Weight:           }
1423 Main
1424 Case message of
1425  SingleClic :
1426  Begin
1427  End
1430 # Popup for Weight
1431 Widget 31
1432 Property
1433     Font -*-fixed-medium-r-semicondensed-*-13-*
1434     Flags NoReliefString
1435     Position 320 85
1436     Type PopupMenu
1437     Title {        }
1438 Main
1439 Case message of
1440  SingleClic :
1441  Begin
1442     Set $tmpind = (Add (GetValue 31) -1)
1443     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$WeightList{");$a=$l[}$tmpind{];print "$a\n"'}
1444     Set $tmp = (GetOutput $cmd 1 -1)
1445     If $tmp <> $Weight Then
1446     Begin
1447         Set $Weight = $tmp
1448         Set $SizeIndex = $tmpind
1449         Set $LastChange = {Weight}
1450         Set $GetAllLists = 1
1451         Set $ChangeFont = 1
1452         Set $UpdateTheFont = 1
1453     End
1454  End
1457 # Title for Spacing
1458 Widget 35
1459 Property
1460     Flags NoReliefString
1461     Position 425 90
1462     Type ItemDraw
1463     Title {Spacing:         }
1464 Main
1465 Case message of
1466  SingleClic :
1467  Begin
1468  End
1471 # Popup for Spacing
1472 Widget 36
1473 Property
1474     Font -*-fixed-medium-r-semicondensed-*-13-*
1475     Flags NoReliefString
1476     Position 515 85
1477     Type PopupMenu
1478     Title {     }
1479 Main
1480 Case message of
1481  SingleClic :
1482  Begin
1483     Set $tmpind = (Add (GetValue 36) -1)
1484     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$SpacingList{");$a=$l[}$tmpind{];print "$a\n"'}
1485     Set $tmp = (GetOutput $cmd 1 -1)
1486     If $tmp <> $Spacing Then
1487     Begin
1488         Set $Spacing = $tmp
1489         Set $SpacingIndex = $tmpind
1490         Set $LastChange = {Spacing}
1491         Set $GetAllLists = 1
1492         Set $ChangeFont = 1
1493         Set $UpdateTheFont = 1
1494     End
1495  End
1498 # Title for Slant
1499 Widget 40
1500 Property
1501     Flags NoReliefString
1502     Position 425 60
1503     Type ItemDraw
1504     Title {Slant:           }
1505 Main
1506 Case message of
1507  SingleClic :
1508  Begin
1509  End
1512 # Popup for Slant
1513 Widget 41
1514 Property
1515     Font -*-fixed-medium-r-semicondensed-*-13-*
1516     Flags NoReliefString
1517     Position 515 55
1518     Type PopupMenu
1519     Title {     }
1520 Main
1521 Case message of
1522  SingleClic :
1523  Begin
1524     Set $tmpind = (Add (GetValue 41) -1)
1525     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$SlantList{");$a=$l[}$tmpind{];print "$a\n"'}
1526     Set $tmp = (GetOutput $cmd 1 -1)
1527     If $tmp <> $Slant Then
1528     Begin
1529         Set $Slant = $tmp
1530         Set $SizeIndex = $tmpind
1531         Set $LastChange = {Slant}
1532         Set $GetAllLists = 1
1533         Set $ChangeFont = 1
1534         Set $UpdateTheFont = 1
1535     End
1536  End
1539 # Title for Width
1540 Widget 50
1541 Property
1542     Flags NoReliefString
1543     Position 230 120
1544     Type ItemDraw
1545     Title {Width:           }
1546 Main
1547 Case message of
1548  SingleClic :
1549  Begin
1550  End
1553 # Popup for Width
1554 Widget 51
1555 Property
1556     Font -*-fixed-medium-r-semicondensed-*-13-*
1557     Flags NoReliefString
1558     Position 320 115
1559     Type PopupMenu
1560     Title {                   }
1561 Main
1562 Case message of
1563  SingleClic :
1564  Begin
1565     Set $tmpind = (Add (GetValue 51) -1)
1566     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$WidthList{");$a=$l[}$tmpind{];print "$a\n"'}
1567     Set $tmp = (GetOutput $cmd 1 -1)
1568     If $tmp <> $Width Then
1569     Begin
1570         Set $Width = $tmp
1571         Set $SizeIndex = $tmpind
1572         Set $LastChange = {Width}
1573         Set $GetAllLists = 1
1574         Set $ChangeFont = 1
1575         Set $UpdateTheFont = 1
1576     End
1577  End
1580 # Title for Charset
1581 Widget 60
1582 Property
1583     Flags NoReliefString
1584     Position 230 150
1585     Type ItemDraw
1586     Title {Charset:         }
1587 Main
1588 Case message of
1589  SingleClic :
1590  Begin
1591  End
1594 # Popup for Charset
1595 Widget 61
1596 Property
1597     Font -*-fixed-medium-r-semicondensed-*-13-*
1598     Flags NoReliefString
1599     Position 320 145
1600     Type PopupMenu
1601     Title {                   }
1602 Main
1603 Case message of
1604  SingleClic :
1605  Begin
1606     Set $tmpind = (Add (GetValue 61) -1)
1607     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$CharsetList{");$a=$l[}$tmpind{];print "$a\n"'}
1608     Set $tmp = (GetOutput $cmd 1 -1)
1609     If $tmp <> $Charset Then
1610     Begin
1611         Set $Charset = $tmp
1612         Set $SizeIndex = $tmpind
1613         Set $LastChange = {Charset}
1614         Set $GetAllLists = 1
1615         Set $ChangeFont = 1
1616         Set $UpdateTheFont = 1
1617     End
1618  End
1621 # ---------------------------- Info for the main window
1623 # Is/Not Adjustable
1624 Widget 95
1625 Property
1626     Flags NoReliefString
1627     Position 230 185
1628     Type ItemDraw
1629     Title {                                                        }
1630 Main
1631 Case message of
1632  SingleClic :
1633  Begin
1634  End
1637 # Button for More Info
1638 Widget 96
1639 Property
1640     Flags NoReliefString
1641     Position 480 180
1642     Size 100 20
1643     Type PushButton
1644     Title {More Info}
1645 Main
1646 Case message of
1647  SingleClic :
1648  Begin
1649     Set $ShowInfo = 1
1650     Set $HideMain = 1
1651     If $TheFont <> $InfoFont Then
1652     Begin
1653         Set $InfoFont = $TheFont
1654         Set $cmd = {fvwm-themes-script --font-info --font-current="}$TheFont{"}
1655         Set $Info = (GetOutput $cmd 1 -1)
1656         ChangeTitle 201 $Info
1657         ChangeMinValue 201 1
1658         ChangeValue 201 0
1659     End
1660  End
1663 # ---------------------------- Filter for the main window
1665 # Title for the filter
1666 Widget 100
1667 Property
1668     Flags NoReliefString
1669     Position 15 220
1670     Size 80 20
1671     Type PushButton
1672     Title {Filter:}
1673 Main
1674 Case message of
1675  SingleClic :
1676  Begin
1677     Set $ShowFilter = 1
1678     Set $HideMain = 1
1679  End
1682 # The filter
1683 Widget 101
1684 Property
1685     Font -*-fixed-medium-r-semicondensed-*-13-*
1686     Flags NoReliefString
1687     Position 130 228
1688     Size 460 20
1689     Type ItemDraw
1690     Title {-*-*-*-*-*-*-*-*-*-*-*-*-*-*}
1691 Main
1692 Case message of
1693  SingleClic :
1694  Begin
1695  End
1698 # ---------------------------- The Examples
1700 # Exemple 0 - 12
1701 Widget 110
1702 Property
1703     #Font -misc-fixed-medium-r-normal--12-*-*-*-*-*-iso10646-1
1704 #    Font -adobe-utopia-bold-r-normal-*-13-*-*-*-p-*-*-*        
1705     Font -adobe-*-bold-r-normal-*-13-*-*-*-p-*-*-*      
1706     Position 120 290
1707     Size 300 50
1708     Type TextField
1709     Title {abcdefghijk ABCDEFGHIJK Ã©Ã§Ã Ã®Ã« Ã‰ÃˆÃ‡Ã€ÃŽÃ‹                        }
1710 Main
1711 Case message of
1712  SingleClic :
1713  Begin
1714  End
1717 # Exemple 13-24
1718 Widget 111
1719 Property
1720     #Font -misc-fixed-medium-r-normal--24-*-*-*-*-*-iso10646-1
1721 #    Font -adobe-utopia-bold-r-normal-*-25-*-*-*-p-*-*-*        
1722     Font -adobe-*-bold-r-normal-*-25-*-*-*-p-*-*-*      
1723     Flags Hidden
1724     Position 38 280
1725     Size 300 50
1726     Type TextField
1727     Title {abcdefghijk ABCDEFGHIJK Ã©Ã§Ã Ã®Ã« Ã‰ÃˆÃ‡Ã€ÃŽÃ‹}
1728 Main
1729 Case message of
1730  SingleClic :
1731  Begin
1732  End
1735 # Exemple 25-36
1736 Widget 112
1737 Property
1738     #Font -misc-fixed-medium-r-normal--36-*-*-*-*-*-iso10646-1
1739 #    Font -adobe-utopia-bold-r-normal-*-36-*-*-*-p-*-*-*        
1740     Font -adobe-*-bold-r-normal-*-36-*-*-*-p-*-*-*      
1741     Flags Hidden
1742     Position 20 272
1743     #Size 300 50
1744     Type TextField
1745     Title {abcdijk ABCDIJK Ã©Ã¨Ã§Ã Ã®Ã« Ã€Ã‰Ã‡ÃŽÃŠ}
1746 Main
1747 Case message of
1748  SingleClic :
1749  Begin
1750  End
1753 # Exemple 37 - 50
1754 Widget 113
1755 Property
1756     #Font -misc-fixed-medium-r-normal--50-*-*-*-*-*-iso10646-1
1757 #    Font -adobe-utopia-bold-r-normal-*-50-*-*-*-p-*-*-*        
1758     Font -adobe-*-bold-r-normal-*-50-*-*-*-p-*-*-*      
1759     Flags Hidden
1760     Position 17 265
1761     #Size 300 50
1762     Type TextField
1763     Title {abcijk ABCIJK Ã©Ã§Ã  Ã€Ã‰Ã‡}
1764 Main
1765 Case message of
1766  SingleClic :
1767  Begin
1768  End
1771 # Exemple 51 - 64
1772 Widget 114
1773 Property
1774     #Font -misc-fixed-medium-r-normal--64-*-*-*-*-*-iso10646-1
1775 #    Font -adobe-utopia-bold-r-normal-*-65-*-*-*-p-*-*-*        
1776     Font -adobe-*-bold-r-normal-*-65-*-*-*-p-*-*-*      
1777     Flags Hidden
1778     Position 17 258
1779     #Size 300 50
1780     Type TextField
1781     Title {abijk ABIJK Ã©Ã§ Ã€Ã‰}
1782 Main
1783 Case message of
1784  SingleClic :
1785  Begin
1786  End
1789 #-----------------------------------------------------------------------------
1790 # Info
1792 # the font
1793 Widget 200
1794 Property
1795     Flags NoReliefString Hidden
1796     Position 15 40
1797     Size 570 20
1798     Type ItemDraw
1799     Title {Obtained font:}
1800 Main
1801 Case message of
1802  SingleClic :
1803  Begin
1804  End
1807 # the infos
1808 Widget 201
1809 Property
1810     Flags NoReliefString Hidden
1811     Position 15 60
1812     Size 570 250
1813     Font -*-fixed-medium-r-semicondensed-*-13-*
1814     Type List
1815     Title {}
1816 Main
1817 Case message of
1818  SingleClic :
1819  Begin
1820  End
1823 # Ok
1824 Widget 202
1825 Property
1826     Flags NoReliefString Hidden
1827     Position 470 320
1828     Size 80 20
1829     Type PushButton
1830     Title {OK}
1831 Main
1832 Case message of
1833  SingleClic :
1834  Begin
1835     Set $HideInfo = 1
1836     Set $ShowMain = 1
1837  End
1840 #-----------------------------------------------------------------------------
1841 # Filter
1843 # title
1844 Widget 300
1845 Property
1846     Flags NoReliefString Hidden
1847     Position 15 40
1848     Size 570 20
1849     Type ItemDraw
1850     Title {Set your font filter:}
1851 Main
1852 Case message of
1853  SingleClic :
1854  Begin
1855  End
1859 # Title for Foundry Filter 
1860 Widget 310
1861 Property
1862     Flags NoReliefString Hidden
1863     Position 20 100
1864     Type ItemDraw
1865     Title {Foundry:        }
1866 Main
1867 Case message of
1868  SingleClic :
1869  Begin
1870  End
1873 # Popup for Foundry Filter 
1874 Widget 311
1875 Property
1876     Font 6x10
1877     Size 150 80
1878     Flags NoReliefString Hidden
1879     Position 120 85
1880     Type List
1881     Title {                  }
1882 Main
1883 Case message of
1884  SingleClic :
1885  Begin
1886     Set $tmpind = (Add (GetValue 311) -1)
1887     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterFoundryList{");$a=$l[}$tmpind{];print "$a\n"'}
1888     Set $tmp = (GetOutput $cmd 1 -1)
1889     If $tmp <> $FilterFoundry Then
1890     Begin
1891         Set $FilterFoundry = $tmp
1892         Set $FilterFoundryIndex = $tmpind
1893     End
1894  End
1897 # Title for Weight Filter 
1898 Widget 320
1899 Property
1900     Flags NoReliefString Hidden
1901     Position 20 190
1902     Type ItemDraw
1903     Title {Weight:        }
1904 Main
1905 Case message of
1906  SingleClic :
1907  Begin
1908  End
1911 # Popup for Weight Filter 
1912 Widget 321
1913 Property
1914     Font 6x10
1915     Flags NoReliefString Hidden
1916     Position 120 185
1917     Type PopupMenu
1918     Title {                  }
1919 Main
1920 Case message of
1921  SingleClic :
1922  Begin
1923     Set $tmpind = (Add (GetValue 321) -1)
1924     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterWeightList{");$a=$l[}$tmpind{];print "$a\n"'}
1925     Set $tmp = (GetOutput $cmd 1 -1)
1926     If $tmp <> $FilterWeight Then
1927     Begin
1928         Set $FilterWeight = $tmp
1929         Set $FilterWeightIndex = $tmpind
1930     End
1931  End
1934 # Title for Slant Filter 
1935 Widget 330
1936 Property
1937     Flags NoReliefString Hidden
1938     Position 20 230
1939     Type ItemDraw
1940     Title {Slant:        }
1941 Main
1942 Case message of
1943  SingleClic :
1944  Begin
1945  End
1948 # Popup for Slant Filter 
1949 Widget 331
1950 Property
1951     Font 6x10
1952     Flags NoReliefString Hidden
1953     Position 120 225
1954     Type PopupMenu
1955     Title {                  }
1956 Main
1957 Case message of
1958  SingleClic :
1959  Begin
1960     Set $tmpind = (Add (GetValue 331) -1)
1961     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterSlantList{");$a=$l[}$tmpind{];print "$a\n"'}
1962     Set $tmp = (GetOutput $cmd 1 -1)
1963     If $tmp <> $FilterSlant Then
1964     Begin
1965         Set $FilterSlant = $tmp
1966         Set $FilterSlantIndex = $tmpind
1967     End
1968  End
1971 # Title for Width Filter 
1972 Widget 340
1973 Property
1974     Flags NoReliefString Hidden
1975     Position 20 270
1976     Type ItemDraw
1977     Title {Width:        }
1978 Main
1979 Case message of
1980  SingleClic :
1981  Begin
1982  End
1985 # Popup for Width Filter 
1986 Widget 341
1987 Property
1988     Font 6x10
1989     Flags NoReliefString Hidden
1990     Position 120 265
1991     Type PopupMenu
1992     Title {                  }
1993 Main
1994 Case message of
1995  SingleClic :
1996  Begin
1997     Set $tmpind = (Add (GetValue 341) -1)
1998     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterWidthList{");$a=$l[}$tmpind{];print "$a\n"'}
1999     Set $tmp = (GetOutput $cmd 1 -1)
2000     If $tmp <> $FilterWidth Then
2001     Begin
2002         Set $FilterWidth = $tmp
2003         Set $FilterWidthIndex = $tmpind
2004     End
2005  End
2008 # Title for XRes Filter 
2009 Widget 350
2010 Property
2011     Flags NoReliefString Hidden
2012     Position 320 190
2013     Type ItemDraw
2014     Title {XRes:        }
2015 Main
2016 Case message of
2017  SingleClic :
2018  Begin
2019  End
2022 # Popup for XRes Filter 
2023 Widget 351
2024 Property
2025     Font 6x10
2026     Flags NoReliefString Hidden
2027     Position 420 185
2028     Type PopupMenu
2029     Title {                  }
2030 Main
2031 Case message of
2032  SingleClic :
2033  Begin
2034     Set $tmpind = (Add (GetValue 351) -1)
2035     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterXResList{");$a=$l[}$tmpind{];print "$a\n"'}
2036     Set $tmp = (GetOutput $cmd 1 -1)
2037     If $tmp <> $FilterXRes Then
2038     Begin
2039         Set $FilterXRes = $tmp
2040         Set $FilterXResIndex = $tmpind
2041     End
2042  End
2045 # Title for YRes Filter 
2046 Widget 360
2047 Property
2048     Flags NoReliefString Hidden
2049     Position 320 230
2050     Type ItemDraw
2051     Title {YRes:        }
2052 Main
2053 Case message of
2054  SingleClic :
2055  Begin
2056  End
2059 # Popup for YRes Filter 
2060 Widget 361
2061 Property
2062     Font 6x10
2063     Flags NoReliefString Hidden
2064     Position 420 225
2065     Type PopupMenu
2066     Title {                  }
2067 Main
2068 Case message of
2069  SingleClic :
2070  Begin
2071     Set $tmpind = (Add (GetValue 361) -1)
2072     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterYResList{");$a=$l[}$tmpind{];print "$a\n"'}
2073     Set $tmp = (GetOutput $cmd 1 -1)
2074     If $tmp <> $FilterYRes Then
2075     Begin
2076         Set $FilterYRes = $tmp
2077         Set $FilterYResIndex = $tmpind
2078     End
2079  End
2082 # Title for Spacing Filter 
2083 Widget 370
2084 Property
2085     Flags NoReliefString Hidden
2086     Position 320 270
2087     Type ItemDraw
2088     Title {Spacing:        }
2089 Main
2090 Case message of
2091  SingleClic :
2092  Begin
2093  End
2096 # Popup for Spacing Filter 
2097 Widget 371
2098 Property
2099     Font 6x10
2100     Flags NoReliefString Hidden
2101     Position 420 265
2102     Type PopupMenu
2103     Title {                  }
2104 Main
2105 Case message of
2106  SingleClic :
2107  Begin
2108     Set $tmpind = (Add (GetValue 371) -1)
2109     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterSpacingList{");$a=$l[}$tmpind{];print "$a\n"'}
2110     Set $tmp = (GetOutput $cmd 1 -1)
2111     If $tmp <> $FilterSpacing Then
2112     Begin
2113         Set $FilterSpacing = $tmp
2114         Set $FilterSpacingIndex = $tmpind
2115     End
2116  End
2119 # Title for Charset Filter 
2120 Widget 380
2121 Property
2122     Flags NoReliefString Hidden
2123     Position 320 100
2124     Type ItemDraw
2125     Title {Charset:        }
2126 Main
2127 Case message of
2128  SingleClic :
2129  Begin
2130  End
2133 # Popup for Charset Filter 
2134 Widget 381
2135 Property
2136     Font 6x10
2137     Size 150 80
2138     Flags NoReliefString Hidden
2139     Position 420 85
2140     Type List
2141     Title {}
2142 Main
2143 Case message of
2144  SingleClic :
2145  Begin
2146     Set $tmpind = (Add (GetValue 381) -1)
2147     Set $cmd={perl -e '@l=split(/\s*\|\s*/,"}$FilterCharsetList{");$a=$l[}$tmpind{];print "$a\n"'}
2148     Set $tmp = (GetOutput $cmd 1 -1)
2149     If $tmp <> $FilterCharset Then
2150     Begin
2151         Set $FilterCharset = $tmp
2152         Set $FilterCharsetIndex = $tmpind
2153     End
2154  End
2158 #------------
2159 # Ok
2160 Widget 500
2161 Property
2162     Flags NoReliefString Hidden
2163     Position 470 320
2164     Size 80 20
2165     Type PushButton
2166     Title {OK}
2167 Main
2168 Case message of
2169  SingleClic :
2170  Begin
2171     Set $HideFilter = 1
2172     Set $ShowMain = 1
2173     Set $tmp = {-}$FilterFoundry{-}$FilterFamily{-}$FilterWeight{-}$FilterSlant{-}$FilterWidth{-}$FilterStyle{-}$FilterPixSize{-}$FilterPtSize{-}$FilterXRes{-}$FilterYRes{-}$FilterSpacing{-}$FilterAvgWidth{-}$FilterCharset
2174     If $tmp <> $FontFilter Then
2175     Begin
2176         Set $FontFilter = $tmp
2177         Set $GetFontListAndAll = 1
2178         ChangeValue 11 0
2179         ChangeMinValue 11 1
2180     End
2181  End
2185 #-----------------------------------------------------------------------------
2186 # Ok, Help, Cancel
2188 # Ok
2189 Widget 992
2190 Property
2191     Flags NoReliefString
2192     Position 30 365
2193     Size 80 20
2194     Type PushButton
2195     Title {OK}
2196 Main
2197 Case message of
2198  SingleClic :
2199  Begin
2200     If $Launched <> 0 Then
2201     Begin
2202         SendToScript (GetScriptFather) $TheFont
2203     End
2204     Quit
2205  End
2208 # Reset
2209 Widget 993
2210 Property
2211     Flags NoReliefString
2212     Position 184 365
2213     Size 80 20
2214     Type PushButton
2215     Title {Reset}
2216 Main
2217 Case message of
2218  SingleClic :
2219  Begin
2220     Set $FontReset = { --font-reset}
2221     Set $InStart = 1
2222     Set $StartCount = 0
2223     ChangeTitle 11 {||Reloading Fonts ...}
2224     ChangeMinValue 11 0
2225     ChangeValue 11 0
2226  End
2229 # Help
2230 Widget 994
2231 Property
2232     Flags NoReliefString
2233     Position 336 365
2234     Size 80 20
2235     Type PushButton
2236     Title {Help}
2237 Main
2238 Case message of
2239  SingleClic :
2240  Begin
2241  End
2244 # Cancel
2245 Widget 995
2246 Property
2247     Flags NoReliefString
2248     Position 490 365
2249     Size 80 20
2250     Type PushButton
2251     Title {Cancel}
2252 Main
2253 Case message of
2254  SingleClic :
2255  Begin
2256     If $Launched <> 0 Then
2257         SendToScript (GetScriptFather) {Cancel}
2258     Quit
2259  End