1 /* FontSimple.c- simplified font configuration panel
3 * WPrefs - Window Maker Preferences Program
5 * Copyright (c) 1998-2004 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <fontconfig/fontconfig.h>
26 /* workaround for older fontconfig, that doesn't define these constants */
27 #ifndef FC_WEIGHT_NORMAL
29 # define FC_WEIGHT_THIN 10
30 # define FC_WEIGHT_EXTRALIGHT 40
31 # define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
32 # define FC_WEIGHT_REGULAR 80
33 # define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
34 # define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
35 # define FC_WEIGHT_EXTRABOLD 205
36 # define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
37 # define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
39 # define FC_WIDTH "width"
40 # define FC_WIDTH_ULTRACONDENSED 50
41 # define FC_WIDTH_EXTRACONDENSED 63
42 # define FC_WIDTH_CONDENSED 75
43 # define FC_WIDTH_SEMICONDENSED 87
44 # define FC_WIDTH_NORMAL 100
45 # define FC_WIDTH_SEMIEXPANDED 113
46 # define FC_WIDTH_EXPANDED 125
47 # define FC_WIDTH_EXTRAEXPANDED 150
48 # define FC_WIDTH_ULTRAEXPANDED 200
51 #define SAMPLE_TEXT "The Lazy Fox Jumped Ipsum Foobar 1234 - 56789"
70 typedef struct _Panel
{
76 CallbackRec callbacks
;
80 WMPopUpButton
*optionP
;
92 #define ICON_FILE "fonts"
99 "WindowTitleFont", N_("Window Title")}, {
100 "MenuTitleFont", N_("Menu Title")}, {
101 "MenuTextFont", N_("Menu Text")}, {
102 "IconTitleFont", N_("Icon Title")}, {
103 "ClipTitleFont", N_("Clip Title")}, {
104 "LargeDisplayFont", N_("Desktop Caption")}, {
105 "SystemFont", N_("System Font")}, {
106 "BoldSystemFont", N_("Bold System Font")}, {
109 static const char *standardSizes
[] = {
133 static const struct {
138 FC_WEIGHT_THIN
, "Thin"}, {
139 FC_WEIGHT_EXTRALIGHT
, "ExtraLight"}, {
140 FC_WEIGHT_LIGHT
, "Light"}, {
141 FC_WEIGHT_NORMAL
, "Normal"}, {
142 FC_WEIGHT_MEDIUM
, ""}, /*"medium"}, */
144 FC_WEIGHT_DEMIBOLD
, "DemiBold"}, {
145 FC_WEIGHT_BOLD
, "Bold"}, {
146 FC_WEIGHT_EXTRABOLD
, "ExtraBold"}, {
147 FC_WEIGHT_BLACK
, "Black"}, {
151 static const struct {
156 FC_SLANT_ROMAN
, ""}, /*"Roman"}, */
158 FC_SLANT_ITALIC
, "Italic"}, {
159 FC_SLANT_OBLIQUE
, "Oblique"}, {
163 static const struct {
168 FC_WIDTH_ULTRACONDENSED
, "UltraCondensed"}, {
169 FC_WIDTH_EXTRACONDENSED
, "ExtraCondensed"}, {
170 FC_WIDTH_CONDENSED
, "Condensed"}, {
171 FC_WIDTH_SEMICONDENSED
, "SemiCondensed"}, {
172 FC_WIDTH_NORMAL
, ""}, /*"normal"}, */
174 FC_WIDTH_SEMIEXPANDED
, "SemiExpanded"}, {
175 FC_WIDTH_EXPANDED
, "Expanded"}, {
176 FC_WIDTH_EXTRAEXPANDED
, "ExtraExpanded"}, {
177 FC_WIDTH_ULTRAEXPANDED
, "UltraExpanded"}, {
181 static int compare_family(const void *a
, const void *b
)
183 FontFamily
*fa
= (FontFamily
*) a
;
184 FontFamily
*fb
= (FontFamily
*) b
;
185 return strcmp(fa
->name
, fb
->name
);
188 static int compare_styles(const void *a
, const void *b
)
190 FontStyle
*sa
= (FontStyle
*) a
;
191 FontStyle
*sb
= (FontStyle
*) b
;
194 compare
= sa
->weight
- sb
->weight
;
197 compare
= sa
->slant
- sb
->slant
;
200 return (sa
->width
- sb
->width
);
203 static void lookup_available_fonts(_Panel
* panel
)
205 FcPattern
*pat
= FcPatternCreate();
210 os
= FcObjectSetBuild(FC_FAMILY
, FC_WEIGHT
, FC_WIDTH
, FC_SLANT
, NULL
);
212 fonts
= FcFontList(0, pat
, os
);
217 panel
->fonts
= wmalloc(sizeof(FontList
));
218 panel
->fonts
->familyn
= 0;
219 panel
->fonts
->families
= wmalloc(sizeof(FontFamily
) * fonts
->nfont
);
221 for (i
= 0; i
< fonts
->nfont
; i
++) {
223 int weight
, slant
, width
;
226 if (FcPatternGetString(fonts
->fonts
[i
], FC_FAMILY
, 0, (FcChar8
**) & name
) !=
230 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_WEIGHT
, 0, &weight
) != FcResultMatch
)
231 weight
= FC_WEIGHT_MEDIUM
;
233 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_WIDTH
, 0, &width
) != FcResultMatch
)
234 width
= FC_WIDTH_NORMAL
;
236 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_SLANT
, 0, &slant
) != FcResultMatch
)
237 slant
= FC_SLANT_ROMAN
;
240 for (j
= 0; j
< panel
->fonts
->familyn
&& found
< 0; j
++)
241 if (strcasecmp(panel
->fonts
->families
[j
].name
, name
) == 0)
245 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup(name
);
246 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
248 family
->styles
= NULL
;
250 family
= panel
->fonts
->families
+ found
;
253 family
->styles
= wrealloc(family
->styles
, sizeof(FontStyle
) * family
->stylen
);
254 family
->styles
[family
->stylen
- 1].weight
= weight
;
255 family
->styles
[family
->stylen
- 1].slant
= slant
;
256 family
->styles
[family
->stylen
- 1].width
= width
;
258 qsort(panel
->fonts
->families
, panel
->fonts
->familyn
, sizeof(FontFamily
), compare_family
);
260 for (i
= 0; i
< panel
->fonts
->familyn
; i
++) {
261 qsort(panel
->fonts
->families
[i
].styles
, panel
->fonts
->families
[i
].stylen
,
262 sizeof(FontStyle
), compare_styles
);
265 FcFontSetDestroy(fonts
);
268 FcObjectSetDestroy(os
);
270 FcPatternDestroy(pat
);
272 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup("sans serif");
273 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
274 family
->styles
= wmalloc(sizeof(FontStyle
) * 2);
276 family
->styles
[0].weight
= FC_WEIGHT_MEDIUM
;
277 family
->styles
[0].slant
= FC_SLANT_ROMAN
;
278 family
->styles
[0].width
= FC_WIDTH_NORMAL
;
279 family
->styles
[1].weight
= FC_WEIGHT_BOLD
;
280 family
->styles
[1].slant
= FC_SLANT_ROMAN
;
281 family
->styles
[1].width
= FC_WIDTH_NORMAL
;
283 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup("serif");
284 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
285 family
->styles
= wmalloc(sizeof(FontStyle
) * 2);
287 family
->styles
[0].weight
= FC_WEIGHT_MEDIUM
;
288 family
->styles
[0].slant
= FC_SLANT_ROMAN
;
289 family
->styles
[0].width
= FC_WIDTH_NORMAL
;
290 family
->styles
[1].weight
= FC_WEIGHT_BOLD
;
291 family
->styles
[1].slant
= FC_SLANT_ROMAN
;
292 family
->styles
[1].width
= FC_WIDTH_NORMAL
;
295 static char *getSelectedFont(_Panel
* panel
, FcChar8
* curfont
)
302 pat
= FcNameParse(curfont
);
304 pat
= FcPatternCreate();
306 item
= WMGetListSelectedItem(panel
->familyL
);
308 FcPatternDel(pat
, FC_FAMILY
);
309 FcPatternAddString(pat
, FC_FAMILY
, (FcChar8
*) item
->text
);
312 item
= WMGetListSelectedItem(panel
->styleL
);
314 FontStyle
*style
= (FontStyle
*) item
->clientData
;
316 FcPatternDel(pat
, FC_WEIGHT
);
317 FcPatternAddInteger(pat
, FC_WEIGHT
, style
->weight
);
319 FcPatternDel(pat
, FC_WIDTH
);
320 FcPatternAddInteger(pat
, FC_WIDTH
, style
->width
);
322 FcPatternDel(pat
, FC_SLANT
);
323 FcPatternAddInteger(pat
, FC_SLANT
, style
->slant
);
326 item
= WMGetListSelectedItem(panel
->sizeL
);
328 FcPatternDel(pat
, FC_PIXEL_SIZE
);
329 FcPatternAddDouble(pat
, FC_PIXEL_SIZE
, atoi(item
->text
));
332 name
= (char *)FcNameUnparse(pat
);
333 FcPatternDestroy(pat
);
338 static void updateSampleFont(_Panel
* panel
)
340 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
,
341 WMGetPopUpButtonSelectedItem(panel
->optionP
));
342 char *fn
= WMGetMenuItemRepresentedObject(item
);
345 WMFont
*font
= WMCreateFont(WMWidgetScreen(panel
->box
), fn
);
347 WMSetTextFieldFont(panel
->sampleT
, font
);
353 static void selectedFamily(WMWidget
* w
, void *data
)
355 _Panel
*panel
= (_Panel
*) data
;
357 FontStyle
*oldStyle
= NULL
;
360 /* Parameter not used, but tell the compiler that it is ok */
363 item
= WMGetListSelectedItem(panel
->styleL
);
365 oldStyle
= (FontStyle
*) item
->clientData
;
367 item
= WMGetListSelectedItem(panel
->familyL
);
370 FontFamily
*family
= (FontFamily
*) item
->clientData
;
371 int i
, oldi
= 0, oldscore
= 0;
373 WMClearList(panel
->styleL
);
374 for (i
= 0; i
< family
->stylen
; i
++) {
376 const char *weight
= "", *slant
= "", *width
= "";
379 for (j
= 0; fontWeights
[j
].name
; j
++)
380 if (fontWeights
[j
].weight
== family
->styles
[i
].weight
) {
381 weight
= fontWeights
[j
].name
;
384 for (j
= 0; fontWidths
[j
].name
; j
++)
385 if (fontWidths
[j
].width
== family
->styles
[i
].width
) {
386 width
= fontWidths
[j
].name
;
389 for (j
= 0; fontSlants
[j
].name
; j
++)
390 if (fontSlants
[j
].slant
== family
->styles
[i
].slant
) {
391 slant
= fontSlants
[j
].name
;
394 sprintf(buffer
, "%s%s%s%s%s",
395 weight
, *weight
? " " : "", slant
, (*slant
|| *weight
) ? " " : "", width
);
397 strcpy(buffer
, "Roman");
399 item
= WMAddListItem(panel
->styleL
, buffer
);
400 item
->clientData
= family
->styles
+ i
;
405 if (oldStyle
->width
== family
->styles
[i
].width
)
407 if (oldStyle
->weight
== family
->styles
[i
].weight
)
409 if (oldStyle
->slant
== family
->styles
[i
].slant
)
412 if (score
> oldscore
) {
418 WMSelectListItem(panel
->styleL
, oldi
);
421 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
422 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
426 ofont
= (FcChar8
*) WMGetMenuItemRepresentedObject(item
);
427 nfont
= getSelectedFont(panel
, ofont
);
430 WMSetMenuItemRepresentedObject(item
, nfont
);
432 updateSampleFont(panel
);
436 static void selected(WMWidget
* w
, void *data
)
438 _Panel
*panel
= (_Panel
*) data
;
439 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
440 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
444 /* Parameter not used, but tell the compiler that it is ok */
447 ofont
= (FcChar8
*) WMGetMenuItemRepresentedObject(item
);
448 nfont
= getSelectedFont(panel
, ofont
);
452 WMSetMenuItemRepresentedObject(item
, nfont
);
454 updateSampleFont(panel
);
457 static void selectedOption(WMWidget
* w
, void *data
)
459 _Panel
*panel
= (_Panel
*) data
;
460 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
461 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
464 /* Parameter not used, but tell the compiler that it is ok */
467 font
= (char *)WMGetMenuItemRepresentedObject(item
);
471 pat
= FcNameParse((FcChar8
*) font
);
474 int weight
, slant
, width
;
476 int distance
, closest
, found
;
479 FcDefaultSubstitute(pat
);
481 if (FcPatternGetString(pat
, FC_FAMILY
, 0, (FcChar8
**) & name
) != FcResultMatch
)
486 for (i
= 0; i
< WMGetListNumberOfRows(panel
->familyL
); i
++) {
487 WMListItem
*item
= WMGetListItem(panel
->familyL
, i
);
488 FontFamily
*family
= (FontFamily
*) item
->clientData
;
490 if (strcasecmp(family
->name
, name
) == 0) {
492 WMSelectListItem(panel
->familyL
, i
);
493 WMSetListPosition(panel
->familyL
, i
);
498 WMSelectListItem(panel
->familyL
, -1);
499 selectedFamily(panel
->familyL
, panel
);
502 if (FcPatternGetInteger(pat
, FC_WEIGHT
, 0, &weight
) != FcResultMatch
)
503 weight
= FC_WEIGHT_NORMAL
;
504 if (FcPatternGetInteger(pat
, FC_WIDTH
, 0, &width
) != FcResultMatch
)
505 width
= FC_WIDTH_NORMAL
;
506 if (FcPatternGetInteger(pat
, FC_SLANT
, 0, &slant
) != FcResultMatch
)
507 slant
= FC_SLANT_ROMAN
;
509 if (FcPatternGetDouble(pat
, FC_PIXEL_SIZE
, 0, &size
) != FcResultMatch
)
512 for (i
= 0, found
= 0, closest
= 0; i
< WMGetListNumberOfRows(panel
->styleL
); i
++) {
513 WMListItem
*item
= WMGetListItem(panel
->styleL
, i
);
514 FontStyle
*style
= (FontStyle
*) item
->clientData
;
516 distance
= ((abs(style
->weight
- weight
) << 16) +
517 (abs(style
->slant
- slant
) << 8) + (abs(style
->width
- width
)));
519 if (i
== 0 || distance
< closest
) {
523 break; /* perfect match */
527 WMSelectListItem(panel
->styleL
, found
);
528 WMSetListPosition(panel
->styleL
, found
);
530 for (i
= 0, found
= 0, closest
= 0; i
< WMGetListNumberOfRows(panel
->sizeL
); i
++) {
531 WMListItem
*item
= WMGetListItem(panel
->sizeL
, i
);
534 distance
= abs(size
- atoi(item
->text
));
536 if (i
== 0 || distance
< closest
) {
540 break; /* perfect match */
544 WMSelectListItem(panel
->sizeL
, found
);
545 WMSetListPosition(panel
->sizeL
, found
);
547 selected(NULL
, panel
);
549 wwarning("Can't parse font '%s'", font
);
552 updateSampleFont(panel
);
555 static WMLabel
*createListLabel(WMScreen
* scr
, WMWidget
* parent
, const char *text
)
559 WMFont
*boldFont
= WMBoldSystemFontOfSize(scr
, 12);
561 label
= WMCreateLabel(parent
);
562 WMSetLabelFont(label
, boldFont
);
563 WMSetLabelText(label
, text
);
564 WMSetLabelRelief(label
, WRSunken
);
565 WMSetLabelTextAlignment(label
, WACenter
);
566 color
= WMDarkGrayColor(scr
);
567 WMSetWidgetBackgroundColor(label
, color
);
568 WMReleaseColor(color
);
569 color
= WMWhiteColor(scr
);
570 WMSetLabelTextColor(label
, color
);
571 WMReleaseColor(color
);
573 WMReleaseFont(boldFont
);
578 static void showData(_Panel
* panel
)
583 for (i
= 0; i
< WMGetPopUpButtonNumberOfItems(panel
->optionP
); i
++) {
586 item
= WMGetPopUpButtonMenuItem(panel
->optionP
, i
);
588 ofont
= WMGetMenuItemRepresentedObject(item
);
592 if (strcmp(fontOptions
[i
].option
, "SystemFont") == 0 ||
593 strcmp(fontOptions
[i
].option
, "BoldSystemFont") == 0) {
595 WMUserDefaults
*defaults
;
597 path
= wdefaultspathfordomain("WMGLOBAL");
598 defaults
= WMGetDefaultsFromPath(path
);
600 font
= WMGetUDStringForKey(defaults
,
601 fontOptions
[i
].option
);
603 font
= GetStringForKey(fontOptions
[i
].option
);
606 font
= wstrdup(font
);
607 WMSetMenuItemRepresentedObject(item
, font
);
610 WMSetPopUpButtonSelectedItem(panel
->optionP
, 0);
611 selectedOption(panel
->optionP
, panel
);
614 static void storeData(_Panel
* panel
)
618 for (i
= 0; i
< WMGetPopUpButtonNumberOfItems(panel
->optionP
); i
++) {
621 item
= WMGetPopUpButtonMenuItem(panel
->optionP
, i
);
623 font
= WMGetMenuItemRepresentedObject(item
);
625 if (strcmp(fontOptions
[i
].option
, "SystemFont") == 0 ||
626 strcmp(fontOptions
[i
].option
, "BoldSystemFont") == 0) {
628 WMUserDefaults
*defaults
;
630 path
= wdefaultspathfordomain("WMGLOBAL");
631 defaults
= WMGetDefaultsFromPath(path
);
633 WMSetUDStringForKey(defaults
,
635 fontOptions
[i
].option
);
636 WMSaveUserDefaults(defaults
);
638 SetStringForKey(font
, fontOptions
[i
].option
);
644 static void createPanel(Panel
* p
)
646 _Panel
*panel
= (_Panel
*) p
;
647 WMScreen
*scr
= WMWidgetScreen(panel
->parent
);
652 lookup_available_fonts(panel
);
654 panel
->box
= WMCreateBox(panel
->parent
);
655 WMSetViewExpandsToParent(WMWidgetView(panel
->box
), 5, 2, 5, 5);
656 WMSetBoxHorizontal(panel
->box
, False
);
657 WMSetBoxBorderWidth(panel
->box
, 8);
658 WMMapWidget(panel
->box
);
660 hbox
= WMCreateBox(panel
->box
);
661 WMSetBoxHorizontal(hbox
, True
);
662 WMAddBoxSubview(panel
->box
, WMWidgetView(hbox
), False
, True
, 40, 22, 8);
664 vbox
= WMCreateBox(hbox
);
665 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), False
, True
, 130, 0, 10);
666 WMSetBoxHorizontal(vbox
, False
);
667 panel
->optionP
= WMCreatePopUpButton(vbox
);
668 WMAddBoxSubviewAtEnd(vbox
, WMWidgetView(panel
->optionP
), False
, True
, 20, 0, 8);
669 for (i
= 0; fontOptions
[i
].option
; i
++) {
670 WMAddPopUpButtonItem(panel
->optionP
, _(fontOptions
[i
].label
));
672 WMSetPopUpButtonAction(panel
->optionP
, selectedOption
, panel
);
674 label
= WMCreateLabel(hbox
);
675 WMSetLabelText(label
, _("Sample Text"));
676 WMSetLabelTextAlignment(label
, WARight
);
677 WMAddBoxSubview(hbox
, WMWidgetView(label
), False
, True
, 80, 0, 2);
679 panel
->sampleT
= WMCreateTextField(hbox
);
680 WMSetViewExpandsToParent(WMWidgetView(panel
->sampleT
), 10, 18, 10, 10);
681 WMSetTextFieldText(panel
->sampleT
, SAMPLE_TEXT
);
682 WMAddBoxSubview(hbox
, WMWidgetView(panel
->sampleT
), True
, True
, 60, 0, 0);
684 hbox
= WMCreateBox(panel
->box
);
685 WMSetBoxHorizontal(hbox
, True
);
686 WMAddBoxSubview(panel
->box
, WMWidgetView(hbox
), True
, True
, 100, 0, 2);
688 vbox
= WMCreateBox(hbox
);
689 WMSetBoxHorizontal(vbox
, False
);
690 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), False
, True
, 240, 20, 4);
692 label
= createListLabel(scr
, vbox
, _("Family"));
693 WMAddBoxSubview(vbox
, WMWidgetView(label
), False
, True
, 20, 0, 2);
696 panel
->familyL
= WMCreateList(vbox
);
697 WMAddBoxSubview(vbox
, WMWidgetView(panel
->familyL
), True
, True
, 0, 0, 0);
700 for (i
= 0; i
< panel
->fonts
->familyn
; i
++) {
701 item
= WMAddListItem(panel
->familyL
, panel
->fonts
->families
[i
].name
);
702 item
->clientData
= panel
->fonts
->families
+ i
;
705 WMAddListItem(panel
->familyL
, "sans serif");
707 WMSetListAction(panel
->familyL
, selectedFamily
, panel
);
709 vbox
= WMCreateBox(hbox
);
710 WMSetBoxHorizontal(vbox
, False
);
711 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), True
, True
, 10, 0, 0);
714 WMBox
*box
= WMCreateBox(vbox
);
715 WMSetBoxHorizontal(box
, True
);
716 WMAddBoxSubview(vbox
, WMWidgetView(box
), False
, True
, 20, 0, 2);
718 label
= createListLabel(scr
, box
, _("Style"));
719 WMAddBoxSubview(box
, WMWidgetView(label
), True
, True
, 20, 0, 4);
721 label
= createListLabel(scr
, box
, _("Size"));
722 WMAddBoxSubview(box
, WMWidgetView(label
), False
, True
, 60, 0, 0);
724 box
= WMCreateBox(vbox
);
725 WMSetBoxHorizontal(box
, True
);
726 WMAddBoxSubview(vbox
, WMWidgetView(box
), True
, True
, 20, 0, 0);
728 panel
->styleL
= WMCreateList(box
);
729 WMAddBoxSubview(box
, WMWidgetView(panel
->styleL
), True
, True
, 0, 0, 4);
730 WMSetListAction(panel
->styleL
, selected
, panel
);
732 panel
->sizeL
= WMCreateList(box
);
733 WMAddBoxSubview(box
, WMWidgetView(panel
->sizeL
), False
, True
, 60, 0, 0);
734 for (i
= 0; standardSizes
[i
]; i
++) {
735 WMAddListItem(panel
->sizeL
, standardSizes
[i
]);
737 WMSetListAction(panel
->sizeL
, selected
, panel
);
740 WMMapSubwidgets(panel
->box
);
741 WMMapWidget(panel
->box
);
742 WMRealizeWidget(panel
->box
);
747 Panel
*InitFontSimple(WMWidget
*parent
)
751 panel
= wmalloc(sizeof(_Panel
));
753 panel
->sectionName
= _("Font Configuration");
755 panel
->description
= _("Configure fonts for Window Maker titlebars, menus etc.");
757 panel
->parent
= parent
;
759 panel
->callbacks
.createWidgets
= createPanel
;
760 panel
->callbacks
.updateDomain
= storeData
;
762 AddSection(panel
, ICON_FILE
);