1 // KDE Display fonts setup tab
3 // Copyright (c) Mark Donohoe 1997
7 // Ported to kcontrol2 by Geert Jansen.
9 #include <config-workspace.h>
15 #include <QPushButton>
16 #include <QtCore/QSettings>
22 #include <QGridLayout>
23 #include <QHBoxLayout>
24 #include <QVBoxLayout>
27 #include <kacceleratormanager.h>
28 #include <kapplication.h>
29 #include <kglobalsettings.h>
30 #include <kgenericfactory.h>
31 #include <kmessagebox.h>
32 #include <knuminput.h>
35 #include <kstandarddirs.h>
38 #include "../krdb/krdb.h"
46 #ifdef FT_LCD_FILTER_H
47 #include FT_FREETYPE_H
48 #include FT_LCD_FILTER_H
55 #include <KPluginFactory>
62 static const char *aa_rgb_xpm
[]={
79 static const char *aa_bgr_xpm
[]={
96 static const char *aa_vrgb_xpm
[]={
113 static const char *aa_vbgr_xpm
[]={
131 static const char** aaPixmaps
[]={ aa_rgb_xpm
, aa_bgr_xpm
, aa_vrgb_xpm
, aa_vbgr_xpm
};
133 /**** DLL Interface ****/
134 K_PLUGIN_FACTORY(FontFactory
, registerPlugin
<KFonts
>(); )
135 K_EXPORT_PLUGIN(FontFactory("kcmfonts"))
137 /**** FontUseItem ****/
139 FontUseItem::FontUseItem(
145 const QFont
&default_fnt
,
148 : KFontRequester(parent
, f
),
152 _default(default_fnt
)
154 KAcceleratorManager::setNoAccel( this );
159 void FontUseItem::setDefault()
161 setFont( _default
, isFixedOnly() );
164 void FontUseItem::readFont()
168 bool deleteme
= false;
169 if (_rcfile
.isEmpty())
170 config
= KGlobal::config().data();
173 config
= new KConfig(_rcfile
);
177 KConfigGroup
group(config
, _rcgroup
);
178 QFont
tmpFnt(_default
);
179 setFont( group
.readEntry(_rckey
, tmpFnt
), isFixedOnly() );
180 if (deleteme
) delete config
;
183 void FontUseItem::writeFont()
187 if (_rcfile
.isEmpty()) {
188 config
= KGlobal::config().data();
189 KConfigGroup(config
, _rcgroup
).writeEntry(_rckey
, font(), KConfig::Normal
|KConfig::Global
);
191 config
= new KConfig(KStandardDirs::locateLocal("config", _rcfile
));
192 KConfigGroup(config
, _rcgroup
).writeEntry(_rckey
, font());
198 void FontUseItem::applyFontDiff( const QFont
&fnt
, int fontDiffFlags
)
200 QFont
_font( font() );
202 if (fontDiffFlags
& KFontChooser::FontDiffSize
) {
203 _font
.setPointSize( fnt
.pointSize() );
205 if (fontDiffFlags
& KFontChooser::FontDiffFamily
) {
206 if (!isFixedOnly()) _font
.setFamily( fnt
.family() );
208 if (fontDiffFlags
& KFontChooser::FontDiffStyle
) {
209 _font
.setBold( fnt
.bold() );
210 _font
.setItalic( fnt
.italic() );
211 _font
.setUnderline( fnt
.underline() );
214 setFont( _font
, isFixedOnly() );
217 /**** FontAASettings ****/
218 #ifdef HAVE_FONTCONFIG
219 FontAASettings::FontAASettings(QWidget
*parent
)
223 setObjectName( "FontAASettings" );
225 setCaption( i18n("Configure Anti-Alias Settings") );
226 setButtons( Ok
|Cancel
);
227 showButtonSeparator( true );
229 QWidget
*mw
=new QWidget(this);
230 QGridLayout
*layout
=new QGridLayout(mw
);
231 layout
->setSpacing(KDialog::spacingHint());
232 layout
->setMargin(0);
234 excludeRange
=new QCheckBox(i18n("E&xclude range:"), mw
),
235 layout
->addWidget(excludeRange
, 0, 0);
236 excludeFrom
=new KDoubleNumInput(0, 72, 8.0, mw
,1, 1),
237 excludeFrom
->setSuffix(i18n(" pt"));
238 layout
->addWidget(excludeFrom
, 0, 1);
239 excludeToLabel
=new QLabel(i18n(" to "), mw
);
240 layout
->addWidget(excludeToLabel
, 0, 2);
241 excludeTo
=new KDoubleNumInput(0, 72, 15.0, mw
, 1, 1);
242 excludeTo
->setSuffix(i18n(" pt"));
243 layout
->addWidget(excludeTo
, 0, 3);
245 QString subPixelWhatsThis
= i18n("<p>If you have a TFT or LCD screen you"
246 " can further improve the quality of displayed fonts by selecting"
247 " this option.<br />Sub-pixel rendering is also known as ClearType(tm).<br />"
248 " In order for sub-pixel rendering to"
249 " work correctly you need to know how the sub-pixels of your display"
251 " <p>On TFT or LCD displays a single pixel is actually composed of"
252 " three sub-pixels, red, green and blue. Most displays"
253 " have a linear ordering of RGB sub-pixel, some have BGR.<br />"
254 " This feature does not work with CRT monitors.</p>" );
256 useSubPixel
=new QCheckBox(i18n("&Use sub-pixel rendering:"), mw
);
257 layout
->addWidget(useSubPixel
, 1, 0);
258 useSubPixel
->setWhatsThis( subPixelWhatsThis
);
260 subPixelType
=new QComboBox(mw
);
261 layout
->addWidget(subPixelType
, 1, 1, 1, 3);
263 subPixelType
->setEditable(false);
264 subPixelType
->setWhatsThis( subPixelWhatsThis
);
266 for(int t
=KXftConfig::SubPixel::None
+1; t
<=KXftConfig::SubPixel::Vbgr
; ++t
)
267 subPixelType
->addItem(QPixmap(aaPixmaps
[t
-1]), i18n(KXftConfig::description((KXftConfig::SubPixel::Type
)t
).toUtf8()));
269 QLabel
*hintingLabel
=new QLabel(i18n("Hinting style: "), mw
);
270 layout
->addWidget(hintingLabel
, 2, 0);
271 hintingStyle
=new QComboBox(mw
);
272 hintingStyle
->setEditable(false);
273 layout
->addWidget(hintingStyle
, 2, 1, 1, 3);
274 for(int s
=KXftConfig::Hint::NotSet
+1; s
<=KXftConfig::Hint::Full
; ++s
)
275 hintingStyle
->addItem(i18n(KXftConfig::description((KXftConfig::Hint::Style
)s
).toUtf8()));
277 QString
hintingText(i18n("Hinting is a process used to enhance the quality of fonts at small sizes."));
278 hintingStyle
->setWhatsThis( hintingText
);
279 hintingLabel
->setWhatsThis( hintingText
);
284 connect(excludeRange
, SIGNAL(toggled(bool)), SLOT(changed()));
285 connect(useSubPixel
, SIGNAL(toggled(bool)), SLOT(changed()));
286 connect(excludeFrom
, SIGNAL(valueChanged(double)), SLOT(changed()));
287 connect(excludeTo
, SIGNAL(valueChanged(double)), SLOT(changed()));
288 connect(subPixelType
, SIGNAL(activated(const QString
&)), SLOT(changed()));
289 connect(hintingStyle
, SIGNAL(activated(const QString
&)), SLOT(changed()));
292 bool FontAASettings::load()
295 KXftConfig
xft(KXftConfig::constStyleSettings
);
297 if(xft
.getExcludeRange(from
, to
))
298 excludeRange
->setChecked(true);
301 excludeRange
->setChecked(false);
306 excludeFrom
->setValue(from
);
307 excludeTo
->setValue(to
);
309 KXftConfig::SubPixel::Type spType
;
311 if(!xft
.getSubPixelType(spType
) || KXftConfig::SubPixel::None
==spType
)
312 useSubPixel
->setChecked(false);
315 int idx
=getIndex(spType
);
319 useSubPixel
->setChecked(true);
320 subPixelType
->setCurrentIndex(idx
);
323 useSubPixel
->setChecked(false);
326 KXftConfig::Hint::Style hStyle
;
328 if(!xft
.getHintStyle(hStyle
) || KXftConfig::Hint::NotSet
==hStyle
)
330 KConfig
kglobals("kdeglobals", KConfig::NoGlobals
);
332 hStyle
=KXftConfig::Hint::Medium
;
333 xft
.setHintStyle(hStyle
);
334 xft
.apply(); // Save this setting
335 KConfigGroup(&kglobals
, "General").writeEntry("XftHintStyle", KXftConfig::toStr(hStyle
));
337 runRdb(KRdbExportXftSettings
);
340 hintingStyle
->setCurrentIndex(getIndex(hStyle
));
344 return xft
.getAntiAliasing();
347 bool FontAASettings::save( bool useAA
)
349 KXftConfig
xft(KXftConfig::constStyleSettings
);
350 KConfig
kglobals("kdeglobals", KConfig::NoGlobals
);
351 KConfigGroup
grp(&kglobals
, "General");
353 xft
.setAntiAliasing( useAA
);
355 if(excludeRange
->isChecked())
356 xft
.setExcludeRange(excludeFrom
->value(), excludeTo
->value());
358 xft
.setExcludeRange(0, 0);
360 KXftConfig::SubPixel::Type
spType(useSubPixel
->isChecked()
362 : KXftConfig::SubPixel::None
);
364 xft
.setSubPixelType(spType
);
365 grp
.writeEntry("XftSubPixel", KXftConfig::toStr(spType
));
366 grp
.writeEntry("XftAntialias", useAA
);
369 KXftConfig::Hint::Style
hStyle(getHintStyle());
371 xft
.setHintStyle(hStyle
);
373 QString
hs(KXftConfig::toStr(hStyle
));
375 if(!hs
.isEmpty() && hs
!=grp
.readEntry("XftHintStyle"))
377 grp
.writeEntry("XftHintStyle", hs
);
390 void FontAASettings::defaults()
392 excludeRange
->setChecked(true);
393 excludeFrom
->setValue(8.0);
394 excludeTo
->setValue(15.0);
395 useSubPixel
->setChecked(false);
396 hintingStyle
->setCurrentIndex(getIndex(KXftConfig::Hint::Medium
));
400 int FontAASettings::getIndex(KXftConfig::SubPixel::Type spType
)
405 for(index
=0; index
<subPixelType
->count(); ++index
)
406 if(subPixelType
->itemText(index
)==i18n(KXftConfig::description(spType
).toUtf8()))
415 KXftConfig::SubPixel::Type
FontAASettings::getSubPixelType()
419 for(t
=KXftConfig::SubPixel::None
; t
<=KXftConfig::SubPixel::Vbgr
; ++t
)
420 if(subPixelType
->currentText()==i18n(KXftConfig::description((KXftConfig::SubPixel::Type
)t
).toUtf8()))
421 return (KXftConfig::SubPixel::Type
)t
;
423 return KXftConfig::SubPixel::None
;
426 int FontAASettings::getIndex(KXftConfig::Hint::Style hStyle
)
431 for(index
=0; index
<hintingStyle
->count(); ++index
)
432 if(hintingStyle
->itemText(index
)==i18n(KXftConfig::description(hStyle
).toUtf8()))
442 KXftConfig::Hint::Style
FontAASettings::getHintStyle()
446 for(s
=KXftConfig::Hint::NotSet
; s
<=KXftConfig::Hint::Full
; ++s
)
447 if(hintingStyle
->currentText()==i18n(KXftConfig::description((KXftConfig::Hint::Style
)s
).toUtf8()))
448 return (KXftConfig::Hint::Style
)s
;
450 return KXftConfig::Hint::Medium
;
453 void FontAASettings::enableWidgets()
455 excludeFrom
->setEnabled(excludeRange
->isChecked());
456 excludeTo
->setEnabled(excludeRange
->isChecked());
457 excludeToLabel
->setEnabled(excludeRange
->isChecked());
458 subPixelType
->setEnabled(useSubPixel
->isChecked());
459 #ifdef FT_LCD_FILTER_H
460 static int ft_has_subpixel
= -1;
461 if( ft_has_subpixel
== -1 ) {
462 FT_Library ftLibrary
;
463 if(FT_Init_FreeType(&ftLibrary
) == 0) {
464 ft_has_subpixel
= ( FT_Library_SetLcdFilter(ftLibrary
, FT_LCD_FILTER_DEFAULT
)
465 == FT_Err_Unimplemented_Feature
) ? 0 : 1;
466 FT_Done_FreeType(ftLibrary
);
469 useSubPixel
->setEnabled(ft_has_subpixel
);
470 subPixelType
->setEnabled(ft_has_subpixel
);
475 void FontAASettings::changed()
477 #ifdef HAVE_FONTCONFIG
483 #ifdef HAVE_FONTCONFIG
484 int FontAASettings::exec()
486 int i
=KDialog::exec();
489 load(); // Reset settings...
491 return i
&& changesMade
;
497 KFonts::KFonts(QWidget
*parent
, const QVariantList
&args
)
498 : KCModule(FontFactory::componentData(), parent
, args
)
500 QStringList nameGroupKeyRc
;
503 << i18n("General") << "General" << "font" << ""
504 << i18n("Fixed width") << "General" << "fixed" << ""
505 << i18n("Small") << "General" << "smallestReadableFont" << ""
506 << i18n("Toolbar") << "General" << "toolBarFont" << ""
507 << i18n("Menu") << "General" << "menuFont" << ""
508 << i18n("Window title") << "WM" << "activeFont" << ""
509 << i18n("Taskbar") << "General" << "taskbarFont" << ""
510 << i18n("Desktop") << "General" << "desktopFont" << "";
512 QList
<QFont
> defaultFontList
;
514 // NOTE: keep in sync with kdelibs/kdeui/kernel/kglobalsettings.cpp
516 QFont
f0("Sans Serif", 10);
517 QFont
f1("Monospace", 10);
518 QFont
f2("Sans Serif", 8);
519 QFont
f3("Sans Serif", 9, QFont::Bold
);
520 QFont
f4("Sans Serif", 10);
521 QFont
f5("Sans Serif", 8); // smallestReadableFont
523 defaultFontList
<< f0
<< f1
<< f5
<< f2
<< f0
<< f3
<< f4
<< f0
;
525 QList
<bool> fixedList
;
537 QStringList quickHelpList
;
540 << i18n("Used for normal text (e.g. button labels, list items).")
541 << i18n("A non-proportional font (i.e. typewriter font).")
542 << i18n("Smallest font that is still readable well.")
543 << i18n("Used to display text beside toolbar icons.")
544 << i18n("Used by menu bars and popup menus.")
545 << i18n("Used by the window titlebar.")
546 << i18n("Used by the taskbar.")
547 << i18n("Used for desktop icons.");
549 QVBoxLayout
* layout
= new QVBoxLayout(this );
550 layout
->setSpacing( KDialog::spacingHint() );
551 layout
->setMargin(0);
553 QGridLayout
* fontUseLayout
= new QGridLayout( );
554 layout
->addItem( fontUseLayout
);
555 fontUseLayout
->setColumnStretch(0, 0);
556 fontUseLayout
->setColumnStretch(1, 1);
557 fontUseLayout
->setColumnStretch(2, 0);
559 QList
<QFont
>::ConstIterator
defaultFontIt(defaultFontList
.begin());
560 QList
<bool>::ConstIterator
fixedListIt(fixedList
.begin());
561 QStringList::ConstIterator
quickHelpIt(quickHelpList
.begin());
562 QStringList::ConstIterator
it(nameGroupKeyRc
.begin());
564 unsigned int count
= 0;
566 while (it
!= nameGroupKeyRc
.constEnd()) {
568 QString name
= *it
; it
++;
569 QString group
= *it
; it
++;
570 QString key
= *it
; it
++;
571 QString file
= *it
; it
++;
584 fontUseList
.append(i
);
585 connect(i
, SIGNAL(fontSelected(const QFont
&)), SLOT(fontSelected()));
587 QLabel
* fontUse
= new QLabel(i18nc("Font role", "%1: ", name
), this);
588 fontUse
->setAlignment(Qt::AlignRight
| Qt::AlignVCenter
);
589 fontUse
->setWhatsThis( *quickHelpIt
++);
591 fontUseLayout
->addWidget(fontUse
, count
, 0);
592 fontUseLayout
->addWidget(i
, count
, 1);
597 QHBoxLayout
*hblay
= new QHBoxLayout();
598 layout
->addItem(hblay
);
599 hblay
->setSpacing(KDialog::spacingHint());
601 QPushButton
* fontAdjustButton
= new QPushButton(i18n("Ad&just All Fonts..."), this);
602 fontAdjustButton
->setWhatsThis( i18n("Click to change all fonts"));
603 hblay
->addWidget( fontAdjustButton
);
604 connect(fontAdjustButton
, SIGNAL(clicked()), SLOT(slotApplyFontDiff()));
606 layout
->addSpacing(KDialog::spacingHint());
608 QGridLayout
* lay
= new QGridLayout();
609 layout
->addItem(lay
);
610 lay
->setColumnStretch( 3, 10 );
611 lay
->setSpacing(KDialog::spacingHint());
613 #ifdef HAVE_FONTCONFIG
614 label
= new QLabel( i18n( "Use a&nti-aliasing:" ), this );
615 label
->setAlignment(Qt::AlignRight
| Qt::AlignVCenter
);
616 lay
->addWidget( label
, 0, 0 );
617 cbAA
= new QComboBox( this );
618 cbAA
->insertItem( AAEnabled
, i18nc( "Use anti-aliasing", "Enabled" )); // change AASetting type if order changes
619 cbAA
->insertItem( AASystem
, i18nc( "Use anti-aliasing", "System Settings" ));
620 cbAA
->insertItem( AADisabled
, i18nc( "Use anti-aliasing", "Disabled" ));
621 cbAA
->setWhatsThis( i18n("If this option is selected, KDE will smooth the edges of curves in "
623 aaSettingsButton
= new QPushButton( i18n( "Configure..." ), this);
624 connect(aaSettingsButton
, SIGNAL(clicked()), SLOT(slotCfgAa()));
625 label
->setBuddy( cbAA
);
626 lay
->addWidget( cbAA
, 0, 1 );
627 lay
->addWidget( aaSettingsButton
, 0, 2 );
628 connect(cbAA
, SIGNAL(activated(int)), SLOT(slotUseAntiAliasing()));
630 label
= new QLabel( i18n( "Force fonts DPI:" ), this );
631 label
->setAlignment(Qt::AlignRight
| Qt::AlignVCenter
);
632 lay
->addWidget( label
, 1, 0 );
633 comboForceDpi
= new QComboBox( this );
634 label
->setBuddy( comboForceDpi
);
635 comboForceDpi
->insertItem( DPINone
, i18nc("Force fonts DPI", "Disabled" )); // change DPISetti ng type if order changes
636 comboForceDpi
->insertItem( DPI96
, i18n( "96 DPI" ));
637 comboForceDpi
->insertItem( DPI120
, i18n( "120 DPI" ));
638 QString whatsthis
= i18n(
639 "<p>This option forces a specific DPI value for fonts. It may be useful"
640 " when the real DPI of the hardware is not detected properly and it"
641 " is also often misused when poor quality fonts are used that do not"
642 " look well with DPI values other than 96 or 120 DPI.</p>"
643 "<p>The use of this option is generally discouraged. For selecting proper DPI"
644 " value a better option is explicitly configuring it for the whole X server if"
645 " possible (e.g. DisplaySize in xorg.conf or adding <i>-dpi value</i> to"
646 " ServerLocalArgs= in $KDEDIR/share/config/kdm/kdmrc). When fonts do not render"
647 " properly with real DPI value better fonts should be used or configuration"
648 " of font hinting should be checked.</p>" );
649 comboForceDpi
->setWhatsThis(whatsthis
);
650 connect( comboForceDpi
, SIGNAL( activated( int )), SLOT( changed()));
651 lay
->addWidget( comboForceDpi
, 1, 1 );
653 layout
->addStretch(1);
655 #ifdef HAVE_FONTCONFIG
656 aaSettings
=new FontAASettings(this);
663 QList
<FontUseItem
*>::Iterator
it(fontUseList
.begin()),
664 end(fontUseList
.end());
671 void KFonts::fontSelected()
676 void KFonts::defaults()
678 for ( int i
= 0; i
< (int) fontUseList
.count(); i
++ )
679 fontUseList
.at( i
)->setDefault();
681 #ifdef HAVE_FONTCONFIG
683 cbAA
->setCurrentIndex( useAA
);
684 aaSettings
->defaults();
686 comboForceDpi
->setCurrentIndex( DPINone
);
692 QList
<FontUseItem
*>::Iterator
it(fontUseList
.begin()),
693 end(fontUseList
.end());
698 #ifdef HAVE_FONTCONFIG
699 useAA_original
= useAA
= aaSettings
->load() ? AAEnabled
: AADisabled
;
700 cbAA
->setCurrentIndex( useAA
);
703 KConfig
_cfgfonts( "kcmfonts" );
704 KConfigGroup
cfgfonts(&_cfgfonts
, "General");
705 int dpicfg
= cfgfonts
.readEntry( "forceFontDPI", 0 );
706 DPISetting dpi
= dpicfg
== 120 ? DPI120
: dpicfg
== 96 ? DPI96
: DPINone
;
707 comboForceDpi
->setCurrentIndex( dpi
);
709 #ifdef HAVE_FONTCONFIG
710 if( cfgfonts
.readEntry( "dontChangeAASettings", true )) {
711 useAA_original
= useAA
= AASystem
;
712 cbAA
->setCurrentIndex( useAA
);
714 aaSettingsButton
->setEnabled( cbAA
->currentIndex() == AAEnabled
);
722 QList
<FontUseItem
*>::Iterator
it(fontUseList
.begin()),
723 end(fontUseList
.end());
728 KGlobal::config()->sync();
730 KConfig
_cfgfonts( "kcmfonts" );
731 KConfigGroup
cfgfonts(&_cfgfonts
, "General");
732 DPISetting dpi
= static_cast< DPISetting
>( comboForceDpi
->currentIndex());
733 const int dpi2value
[] = { 0, 96, 120 };
734 cfgfonts
.writeEntry( "forceFontDPI", dpi2value
[ dpi
] );
735 #ifdef HAVE_FONTCONFIG
736 cfgfonts
.writeEntry( "dontChangeAASettings", cbAA
->currentIndex() == AASystem
);
739 // if the setting is reset in the module, remove the dpi value,
740 // otherwise don't explicitly remove it and leave any possible system-wide value
741 if( dpi
== DPINone
&& dpi_original
!= DPINone
) {
743 proc
<< "xrdb" << "-quiet" << "-remove" << "-nocpp";
745 if (proc
.waitForStarted()) {
746 proc
.write( QByteArray( "Xft.dpi\n" ) );
747 proc
.closeWriteChannel();
748 proc
.waitForFinished();
754 KConfig
config( QDir::homePath() + "/.kderc", KConfig::SimpleConfig
);
755 KConfigGroup
grp(&config
, "General");
757 for(it
=fontUseList
.begin(); it
!=end
; ++it
) {
758 if("font"==(*it
)->rcKey())
759 QSettings().setValue("/qt/font", (*it
)->font().toString());
760 kDebug(1208) << "write entry " << (*it
)->rcKey();
761 grp
.writeEntry( (*it
)->rcKey(), (*it
)->font() );
766 KGlobalSettings::self()->emitChange(KGlobalSettings::FontChanged
);
768 kapp
->processEvents(); // Process font change ourselves
771 // Don't overwrite global settings unless explicitly asked for - e.g. the system
772 // fontconfig setup may be much more complex than this module can provide.
773 // TODO: With AASystem the changes already made by this module should be reverted somehow.
774 #ifdef HAVE_FONTCONFIG
776 if( cbAA
->currentIndex() != AASystem
)
777 aaSave
= aaSettings
->save( useAA
== AAEnabled
);
779 if( aaSave
|| (useAA
!= useAA_original
) || dpi
!= dpi_original
) {
780 KMessageBox::information(this,
782 "<p>Some changes such as anti-aliasing will only affect newly started applications.</p>"
783 ), i18n("Font Settings Changed"), "FontSettingsChanged", false);
784 useAA_original
= useAA
;
788 if(dpi
!= dpi_original
) {
789 KMessageBox::information(this,
791 "<p>Some changes such as DPI will only affect newly started applications.</p>"
792 ), i18n("Font Settings Changed"), "FontSettingsChanged", false);
796 runRdb(KRdbExportXftSettings
);
802 void KFonts::slotApplyFontDiff()
804 QFont font
= QFont(fontUseList
.first()->font());
805 KFontChooser::FontDiffFlags fontDiffFlags
= 0;
806 int ret
= KFontDialog::getFontDiff(font
,fontDiffFlags
,KFontChooser::NoDisplayFlags
,this);
808 if (ret
== KDialog::Accepted
&& fontDiffFlags
)
810 for ( int i
= 0; i
< (int) fontUseList
.count(); i
++ )
811 fontUseList
.at( i
)->applyFontDiff( font
,fontDiffFlags
);
816 void KFonts::slotUseAntiAliasing()
818 #ifdef HAVE_FONTCONFIG
819 useAA
= static_cast< AASetting
>( cbAA
->currentIndex());
820 aaSettingsButton
->setEnabled( cbAA
->currentIndex() == AAEnabled
);
825 void KFonts::slotCfgAa()
827 #ifdef HAVE_FONTCONFIG
828 if(aaSettings
->exec())
835 // vim:ts=2:sw=2:tw=78