23 #include "fonthelpers_p.h"
24 #include "sampleedit_p.h"
26 #include <QtGui/QCheckBox>
27 #include <QtGui/QLabel>
28 #include <QtGui/QLayout>
29 #include <QtGui/QSplitter>
30 #include <QtGui/QScrollBar>
31 #include <QtGui/QFontDatabase>
32 #include <QtGui/QGroupBox>
49 #define I18NC_NOX i18nc
54 for(
int i=0; i<list->count(); i++ )
56 int itemWidth = list->visualItemRect(list->item(i)).width();
58 itemWidth += list->fontMetrics().width(
' ') * 2;
59 w = qMax(w,itemWidth);
61 if( w == 0 ) { w = 40; }
62 w += list->frameWidth() * 2;
63 w += list->verticalScrollBar()->sizeHint().width();
69 int w = list->count() > 0 ? list->visualItemRect(list->item(0)).height() :
70 list->fontMetrics().lineSpacing();
72 if( w < 0 ) { w = 10; }
73 if( numVisibleEntry <= 0 ) { numVisibleEntry = 4; }
74 return ( w * numVisibleEntry + 2 * list->frameWidth() );
82 class KFontChooser::Private
88 m_palette.setColor(QPalette::Active, QPalette::Text, Qt::black);
89 m_palette.setColor(QPalette::Active, QPalette::Base, Qt::white);
90 signalsAllowed =
true;
100 void fillFamilyListBox(
bool onlyFixedFonts =
false);
101 int nearestSizeRow(qreal val,
bool customize);
102 qreal fillSizeList(
const QList<qreal> &sizes = QList<qreal>());
103 qreal setupSizeListBox(
const QString& family,
const QString& style);
108 void _k_toggled_checkbox();
109 void _k_family_chosen_slot(
const QString&);
110 void _k_size_chosen_slot(
const QString&);
111 void _k_style_chosen_slot(
const QString&);
112 void _k_displaySample(
const QFont &
font);
113 void _k_showXLFDArea(
bool);
114 void _k_size_value_slot(
double);
119 bool signalsAllowed:1;
125 SampleEdit *sampleEdit;
130 QCheckBox *familyCheckbox;
131 QCheckBox *styleCheckbox;
132 QCheckBox *sizeCheckbox;
137 QCheckBox *sizeIsRelativeCheckBox;
148 QHash<QString, QString> qtFamilies;
149 QHash<QString, QString> qtStyles;
151 QHash<QString, QString> styleIDs;
157 const DisplayFlags& flags,
160 Qt::CheckState *sizeIsRelativeState )
165 setWhatsThis(
i18nc(
"@info:whatsthis",
"Here you can choose the font to be used." ));
169 QVBoxLayout *topLayout =
new QVBoxLayout(
this );
170 topLayout->setMargin( 0 );
176 QSplitter *splitter =
new QSplitter(Qt::Vertical,
this);
177 splitter->setChildrenCollapsible(
false);
178 topLayout->addWidget(splitter);
183 QGridLayout *gridLayout;
188 splitter->addWidget(page);
189 gridLayout =
new QGridLayout( page );
195 splitter->addWidget(page);
196 gridLayout =
new QGridLayout( page );
197 gridLayout->setMargin( 0 );
203 QHBoxLayout *familyLayout =
new QHBoxLayout();
204 familyLayout->addSpacing( checkBoxGap );
206 d->familyCheckbox =
new QCheckBox(
i18nc(
"@option:check",
"Font"), page);
207 connect(d->familyCheckbox, SIGNAL(toggled(
bool)),
208 this, SLOT(_k_toggled_checkbox()));
209 familyLayout->addWidget(d->familyCheckbox, 0, Qt::AlignLeft);
210 d->familyCheckbox->setWhatsThis(
i18nc(
"@info:whatsthis",
"Enable this checkbox to change the font family settings."));
211 d->familyCheckbox->setToolTip(
i18nc(
"@info:tooltip",
"Change font family?") );
214 d->familyCheckbox = 0;
215 d->familyLabel =
new QLabel(
i18nc(
"@label",
"Font:"), page );
216 familyLayout->addWidget(d->familyLabel, 1, Qt::AlignLeft);
218 gridLayout->addLayout(familyLayout, row, 0 );
220 QHBoxLayout *styleLayout =
new QHBoxLayout();
221 if ( flags & ShowDifferences ) {
222 d->styleCheckbox =
new QCheckBox(
i18nc(
"@option:check",
"Font style"), page);
223 connect(d->styleCheckbox, SIGNAL(toggled(
bool)),
224 this, SLOT(_k_toggled_checkbox()));
225 styleLayout->addWidget(d->styleCheckbox, 0, Qt::AlignLeft);
226 d->styleCheckbox->setWhatsThis(
i18nc(
"@info:whatsthis",
"Enable this checkbox to change the font style settings."));
227 d->styleCheckbox->setToolTip(
i18nc(
"@info:tooltip",
"Change font style?"));
230 d->styleCheckbox = 0;
231 d->styleLabel =
new QLabel(
i18n(
"Font style:"), page );
232 styleLayout->addWidget(d->styleLabel, 1, Qt::AlignLeft);
234 styleLayout->addSpacing( checkBoxGap );
235 gridLayout->addLayout(styleLayout, row, 1 );
237 QHBoxLayout *sizeLayout =
new QHBoxLayout();
238 if ( flags & ShowDifferences ) {
239 d->sizeCheckbox =
new QCheckBox(
i18nc(
"@option:check",
"Size"),page);
240 connect(d->sizeCheckbox, SIGNAL(toggled(
bool)),
241 this, SLOT(_k_toggled_checkbox()));
242 sizeLayout->addWidget(d->sizeCheckbox, 0, Qt::AlignLeft);
243 d->sizeCheckbox->setWhatsThis(
i18nc(
"@info:whatsthis",
"Enable this checkbox to change the font size settings."));
244 d->sizeCheckbox->setToolTip(
i18nc(
"@info:tooltip",
"Change font size?"));
248 d->sizeLabel =
new QLabel(
i18nc(
"@label:listbox Font size",
"Size:"), page );
249 sizeLayout->addWidget(d->sizeLabel, 1, Qt::AlignLeft);
251 sizeLayout->addSpacing( checkBoxGap );
252 sizeLayout->addSpacing( checkBoxGap );
253 gridLayout->addLayout(sizeLayout, row, 2 );
261 d->familyListBox->setEnabled( flags ^ ShowDifferences );
262 gridLayout->addWidget( d->familyListBox, row, 0 );
263 QString fontFamilyWhatsThisText (
264 i18nc(
"@info:whatsthis",
"Here you can choose the font family to be used." ));
265 d->familyListBox->setWhatsThis(fontFamilyWhatsThisText );
267 if ( flags & ShowDifferences ) {
268 d->familyCheckbox->setWhatsThis(fontFamilyWhatsThisText );
270 d->familyLabel->setWhatsThis(fontFamilyWhatsThisText );
273 connect(d->familyListBox, SIGNAL(currentTextChanged(
QString)),
274 this, SLOT(_k_family_chosen_slot(
QString)));
275 if ( !fontList.isEmpty() ) {
276 d->setFamilyBoxItems(fontList);
280 d->fillFamilyListBox( flags & FixedFontsOnly );
284 d->familyListBox->setMinimumHeight(
288 d->styleListBox->setEnabled( flags ^ ShowDifferences );
289 gridLayout->addWidget(d->styleListBox, row, 1);
290 d->styleListBox->setWhatsThis(
i18nc(
"@info:whatsthis",
"Here you can choose the font style to be used." ));
291 if ( flags & ShowDifferences ) {
292 ((
QWidget *)d->styleCheckbox)->setWhatsThis(fontFamilyWhatsThisText );
294 ((
QWidget *)d->styleLabel)->setWhatsThis( fontFamilyWhatsThisText );
298 d->styleListBox->addItem(
i18nc(
"@item font",
"Regular"));
299 d->styleListBox->addItem(
i18nc(
"@item font",
"Italic"));
300 d->styleListBox->addItem(
i18nc(
"@item font",
"Oblique"));
301 d->styleListBox->addItem(
i18nc(
"@item font",
"Bold"));
302 d->styleListBox->addItem(
i18nc(
"@item font",
"Bold Italic"));
304 d->styleListBox->setMinimumHeight(
307 connect(d->styleListBox, SIGNAL(currentTextChanged(
QString)),
308 this, SLOT(_k_style_chosen_slot(
QString)));
313 d->sizeOfFont->setMinimum(4);
314 d->sizeOfFont->setMaximum(999);
315 d->sizeOfFont->setDecimals(1);
316 d->sizeOfFont->setSingleStep(1);
317 d->sizeOfFont->setSliderEnabled(
false);
319 d->sizeListBox->setEnabled( flags ^ ShowDifferences );
320 d->sizeOfFont->setEnabled( flags ^ ShowDifferences );
321 if( sizeIsRelativeState ) {
323 i18nc(
"@item font size",
"Relative");
324 QString sizeIsRelativeCBToolTipText =
325 i18n(
"Font size<br /><i>fixed</i> or <i>relative</i><br />to environment");
326 QString sizeIsRelativeCBWhatsThisText =
327 i18n(
"Here you can switch between fixed font size and font size "
328 "to be calculated dynamically and adjusted to changing "
329 "environment (e.g. widget dimensions, paper size)." );
330 d->sizeIsRelativeCheckBox =
new QCheckBox( sizeIsRelativeCBText,
332 d->sizeIsRelativeCheckBox->setTristate( flags & ShowDifferences );
333 QGridLayout *sizeLayout2 =
new QGridLayout();
335 gridLayout->addLayout(sizeLayout2, row, 2);
336 sizeLayout2->setColumnStretch( 1, 1 );
337 sizeLayout2->addWidget( d->sizeOfFont, 0, 0, 1, 2);
338 sizeLayout2->addWidget(d->sizeListBox, 1,0, 1,2);
339 sizeLayout2->addWidget(d->sizeIsRelativeCheckBox, 2, 0, Qt::AlignLeft);
340 d->sizeIsRelativeCheckBox->setWhatsThis(sizeIsRelativeCBWhatsThisText );
341 d->sizeIsRelativeCheckBox->setToolTip( sizeIsRelativeCBToolTipText );
344 d->sizeIsRelativeCheckBox = 0L;
345 QGridLayout *sizeLayout2 =
new QGridLayout();
347 gridLayout->addLayout(sizeLayout2, row, 2);
348 sizeLayout2->addWidget( d->sizeOfFont, 0, 0);
349 sizeLayout2->addWidget(d->sizeListBox, 1,0);
351 QString fontSizeWhatsThisText =
352 i18n(
"Here you can choose the font size to be used." );
353 d->sizeListBox->setWhatsThis(fontSizeWhatsThisText );
355 if ( flags & ShowDifferences ) {
356 ((
QWidget *)d->sizeCheckbox)->setWhatsThis(fontSizeWhatsThisText );
358 ((
QWidget *)d->sizeLabel)->setWhatsThis( fontSizeWhatsThisText );
365 d->sizeListBox->fontMetrics().maxWidth() );
366 d->sizeListBox->setMinimumHeight(
369 connect( d->sizeOfFont, SIGNAL(valueChanged(
double)),
370 this, SLOT(_k_size_value_slot(
double)));
372 connect( d->sizeListBox, SIGNAL(currentTextChanged(
QString)),
373 this, SLOT(_k_size_chosen_slot(
QString)) );
381 d->sampleEdit =
new SampleEdit(page);
382 d->sampleEdit->setAcceptRichText(
false);
384 d->sampleEdit->setFont(tmpFont);
385 d->sampleEdit->setMinimumHeight( d->sampleEdit->fontMetrics().lineSpacing() );
391 d->sampleEdit->setTextCursor(QTextCursor(d->sampleEdit->document()));
392 QString sampleEditWhatsThisText =
393 i18n(
"This sample text illustrates the current settings. "
394 "You may edit it to test special characters." );
395 d->sampleEdit->setWhatsThis(sampleEditWhatsThisText );
398 this, SLOT(_k_displaySample(
QFont)));
400 splitter->addWidget(d->sampleEdit);
407 if( flags & DisplayFrame )
410 topLayout->addWidget(page);
411 vbox =
new QVBoxLayout( page );
412 vbox->addSpacing( fontMetrics().lineSpacing() );
417 topLayout->addWidget(page);
418 vbox =
new QVBoxLayout( page );
419 vbox->setMargin( 0 );
421 vbox->addWidget( label );
425 vbox->addWidget( d->xlfdEdit );
433 if( sizeIsRelativeState && d->sizeIsRelativeCheckBox )
437 d->_k_showXLFDArea(cg.
readEntry(QLatin1String(
"fontSelectorShowXLFD"),
false));
440 d->sizeListBox->setFocus();
450 d->m_palette.setColor( QPalette::Active, QPalette::Text, col );
451 QPalette pal = d->sampleEdit->palette();
452 pal.setColor( QPalette::Active, QPalette::Text, col );
453 d->sampleEdit->setPalette( pal );
454 QTextCursor cursor = d->sampleEdit->textCursor();
455 d->sampleEdit->selectAll();
456 d->sampleEdit->setTextColor( col );
457 d->sampleEdit->setTextCursor( cursor );
462 return d->m_palette.color( QPalette::Active, QPalette::Text );
467 d->m_palette.setColor( QPalette::Active, QPalette::Base, col );
468 QPalette pal = d->sampleEdit->palette();
469 pal.setColor( QPalette::Active, QPalette::Base, col );
470 d->sampleEdit->setPalette( pal );
475 return d->m_palette.color( QPalette::Active, QPalette::Base );
481 if( d->sizeIsRelativeCheckBox ) {
482 if( Qt::PartiallyChecked == relative )
483 d->sizeIsRelativeCheckBox->setCheckState(Qt::PartiallyChecked);
485 d->sizeIsRelativeCheckBox->setCheckState( (Qt::Checked == relative ) ? Qt::Checked : Qt::Unchecked);
491 return d->sizeIsRelativeCheckBox
492 ? d->sizeIsRelativeCheckBox->checkState()
493 : Qt::PartiallyChecked;
498 return d->sampleEdit->toPlainText();
503 d->sampleEdit->setPlainText(text);
508 d->sampleEdit->setVisible( visible );
513 return minimumSizeHint();
521 d->familyListBox->setEnabled(state);
525 d->styleListBox->setEnabled(state);
529 d->sizeListBox->setEnabled(state);
530 d->sizeOfFont->setEnabled(state);
538 d->selectedSize=aFont.pointSizeF();
539 if (d->selectedSize == -1)
540 d->selectedSize = QFontInfo(aFont).pointSizeF();
542 if( onlyFixed != d->usingFixed)
544 d->usingFixed = onlyFixed;
545 d->fillFamilyListBox(d->usingFixed);
555 if ( d->familyCheckbox && d->familyCheckbox->isChecked() ) {
559 if ( d->styleCheckbox && d->styleCheckbox->isChecked() ) {
563 if ( d->sizeCheckbox && d->sizeCheckbox->isChecked() ) {
575 void KFontChooser::Private::_k_toggled_checkbox()
577 familyListBox->setEnabled( familyCheckbox->isChecked() );
578 styleListBox->setEnabled( styleCheckbox->isChecked() );
579 sizeListBox->setEnabled( sizeCheckbox->isChecked() );
580 sizeOfFont->setEnabled( sizeCheckbox->isChecked() );
583 void KFontChooser::Private::_k_family_chosen_slot(
const QString& family)
585 if ( !signalsAllowed ) {
588 signalsAllowed =
false;
591 if (family.isEmpty()) {
592 Q_ASSERT( familyListBox->currentItem() );
593 if (familyListBox->currentItem()) {
594 currentFamily = qtFamilies[familyListBox->currentItem()->text()];
598 currentFamily = qtFamilies[family];
604 if (styles.isEmpty()) {
606 styles.append(
I18NC_NOX(
"QFontDatabase",
"Normal"));
615 foreach (
const QString &style, styles) {
619 QFont testFont = dbase.font(currentFamily, style, 10);
620 if (dbase.styleString(testFont) != style) {
621 styles.removeAll(style);
628 if (style ==
I18NC_NOX(
"QFontDatabase",
"Normal"))
629 styleMod =
i18nc(
"@item font",
"Regular");
637 if (!filteredStyles.contains(fstyle)) {
638 filteredStyles.append(fstyle);
639 qtStyles.insert(fstyle, style);
640 styleIDs.insert(fstyle, styleIdentifier(testFont));
643 styleListBox->clear();
644 styleListBox->addItems(filteredStyles);
647 int listPos = filteredStyles.indexOf(selectedStyle.isEmpty() ?
i18nc(
"@item font",
"Regular") : selectedStyle);
653 for (
int i = 0; i < 2; ++i) {
654 int pos = selectedStyle.indexOf(styleIt);
657 style.replace(pos, styleIt.length(), styleOb);
658 listPos = filteredStyles.indexOf(style);
659 if (listPos >= 0)
break;
661 qSwap(styleIt, styleOb);
664 styleListBox->setCurrentRow(listPos >= 0 ? listPos : 0);
665 QString currentStyle = qtStyles[styleListBox->currentItem()->text()];
668 qreal currentSize = setupSizeListBox(currentFamily, currentStyle);
669 sizeOfFont->setValue(currentSize);
671 selFont = dbase.font(currentFamily, currentStyle,
int(currentSize));
672 if (dbase.isSmoothlyScalable(currentFamily, currentStyle) && selFont.pointSize() == floor(currentSize)) {
673 selFont.setPointSizeF(currentSize);
675 emit q->fontSelected(selFont);
677 signalsAllowed =
true;
680 void KFontChooser::Private::_k_style_chosen_slot(
const QString& style)
682 if ( !signalsAllowed ) {
685 signalsAllowed =
false;
688 QString currentFamily = qtFamilies[familyListBox->currentItem()->text()];
690 if (style.isEmpty()) {
691 currentStyle = qtStyles[styleListBox->currentItem()->text()];
693 currentStyle = qtStyles[style];
697 qreal currentSize = setupSizeListBox(currentFamily, currentStyle);
698 sizeOfFont->setValue(currentSize);
700 selFont = dbase.font(currentFamily, currentStyle,
int(currentSize));
701 if (dbase.isSmoothlyScalable(currentFamily, currentStyle) && selFont.pointSize() == floor(currentSize)) {
702 selFont.setPointSizeF(currentSize);
704 emit q->fontSelected(selFont);
706 if (!style.isEmpty()) {
707 selectedStyle = currentStyle;
710 signalsAllowed =
true;
713 void KFontChooser::Private::_k_size_chosen_slot(
const QString& size)
715 if ( !signalsAllowed ) {
719 signalsAllowed =
false;
722 if (size.isEmpty()) {
729 if (customSizeRow >= 0 && selFont.pointSizeF() != currentSize) {
730 sizeListBox->item(customSizeRow)->setText(standardSizeAtCustom);
734 sizeOfFont->setValue(currentSize);
735 selFont.setPointSizeF(currentSize);
736 emit q->fontSelected(selFont);
738 if (!size.isEmpty()) {
739 selectedSize = currentSize;
742 signalsAllowed =
true;
745 void KFontChooser::Private::_k_size_value_slot(
double dval)
747 if ( !signalsAllowed ) {
750 signalsAllowed =
false;
753 qreal val = qreal(dval);
756 QString family = qtFamilies[familyListBox->currentItem()->text()];
757 QString style = qtStyles[styleListBox->currentItem()->text()];
760 if (customSizeRow >= 0 && sizeListBox->currentRow() == customSizeRow) {
761 sizeListBox->item(customSizeRow)->setText(standardSizeAtCustom);
765 bool canCustomize =
true;
768 if (!dbase.isSmoothlyScalable(family, style)) {
771 canCustomize =
false;
772 int nrows = sizeListBox->count();
773 int row = sizeListBox->currentRow();
775 if (val - selFont.pointSizeF() > 0) {
776 for (nrow = row + 1; nrow < nrows; ++nrow)
781 for (nrow = row - 1; nrow >= 0; --nrow)
786 nrow = nrow < 0 ? 0 : nrow >= nrows ? nrows - 1 : nrow;
789 sizeOfFont->setValue(val);
793 int row = nearestSizeRow(val, canCustomize);
794 sizeListBox->setCurrentRow(row);
797 selFont.setPointSizeF(val);
798 emit q->fontSelected( selFont );
800 signalsAllowed =
true;
803 void KFontChooser::Private::_k_displaySample(
const QFont& font )
805 sampleEdit->setFont(font);
808 xlfdEdit->setText(font.rawName());
809 xlfdEdit->setCursorPosition(0);
816 int KFontChooser::Private::nearestSizeRow (qreal val,
bool customize)
820 for (
int r = 0; r < sizeListBox->count(); ++r) {
822 if (qAbs(cval - val) < diff) {
823 diff = qAbs(cval - val);
828 if (customize && diff > 0) {
830 standardSizeAtCustom = sizeListBox->item(row)->text();
836 qreal KFontChooser::Private::fillSizeList (
const QList<qreal> &sizes_)
838 if ( !sizeListBox ) {
842 QList<qreal> sizes = sizes_;
843 bool canCustomize =
false;
844 if (sizes.count() == 0) {
845 static const int c[] = {
855 for (
int i = 0; c[i]; ++i) {
864 sizeListBox->clear();
866 foreach (qreal size, sizes) {
876 int row = nearestSizeRow(selectedSize, canCustomize);
880 qreal KFontChooser::Private::setupSizeListBox (
const QString& family,
const QString& style)
884 if (dbase.isSmoothlyScalable(family, style)) {
891 QList<int> smoothSizes = dbase.smoothSizes(family, style);
892 foreach (
int size, smoothSizes) {
899 qreal bestFitSize = fillSizeList(sizes);
902 const QList<QListWidgetItem*> selectedSizeList =
905 if ( !selectedSizeList.isEmpty() ) {
906 sizeListBox->setCurrentItem(selectedSizeList.first());
913 void KFontChooser::Private::setupDisplay()
916 QString family = selFont.family().toLower();
917 QString styleID = styleIdentifier(selFont);
918 qreal size = selFont.pointSizeF();
920 size = QFontInfo( selFont ).pointSizeF();
925 numEntries = familyListBox->count();
926 for (i = 0; i < numEntries; i++) {
927 if (family == qtFamilies[familyListBox->item(i)->text()].toLower()) {
928 familyListBox->setCurrentRow(i);
934 if ( i == numEntries )
936 if (family.contains(
'['))
938 family = family.left(family.indexOf(
'[')).trimmed();
939 for (i = 0; i < numEntries; i++) {
940 if (family == qtFamilies[familyListBox->item(i)->text()].toLower()) {
941 familyListBox->setCurrentRow(i);
949 if ( i == numEntries )
951 QString fallback = family+
" [";
952 for (i = 0; i < numEntries; i++) {
953 if (qtFamilies[familyListBox->item(i)->text()].toLower().startsWith(fallback)) {
954 familyListBox->setCurrentRow(i);
961 if ( i == numEntries )
963 for (i = 0; i < numEntries; i++) {
964 if (qtFamilies[familyListBox->item(i)->text()].toLower().startsWith(family)) {
965 familyListBox->setCurrentRow(i);
972 if ( i == numEntries ) {
973 familyListBox->setCurrentRow( 0 );
981 numEntries = styleListBox->count();
982 for (i = 0; i < numEntries; i++) {
983 if (styleID == styleIDs[styleListBox->item(i)->text()]) {
984 styleListBox->setCurrentRow(i);
988 if (i == numEntries) {
990 styleListBox->setCurrentRow(0);
996 QString currentFamily = qtFamilies[familyListBox->currentItem()->text()];
997 QString currentStyle = qtStyles[styleListBox->currentItem()->text()];
998 bool canCustomize = dbase.isSmoothlyScalable(currentFamily, currentStyle);
999 sizeListBox->setCurrentRow(nearestSizeRow(size, canCustomize));
1002 sizeOfFont->setValue(
KGlobal::locale()->readNumber(sizeListBox->currentItem()->text()));
1008 QFontDatabase dbase;
1012 if (fontListCriteria)
1015 for (QStringList::const_iterator it = lstSys.constBegin(); it != lstSys.constEnd(); ++it)
1017 if ((fontListCriteria &
FixedWidthFonts) > 0 && !dbase.isFixedPitch(*it))
continue;
1019 !dbase.isBitmapScalable(*it))
continue;
1020 if ((fontListCriteria &
SmoothScalableFonts) > 0 && !dbase.isSmoothlyScalable(*it))
continue;
1021 lstFonts.append(*it);
1027 if (lstFonts.count() == 0)
1028 lstFonts.append(
"fixed");
1039 void KFontChooser::Private::setFamilyBoxItems(
const QStringList &fonts)
1041 signalsAllowed =
false;
1044 familyListBox->clear();
1045 familyListBox->addItems(trfonts);
1047 signalsAllowed =
true;
1050 void KFontChooser::Private::fillFamilyListBox(
bool onlyFixedFonts)
1053 getFontList(fontList, onlyFixedFonts?FixedWidthFonts:0);
1054 setFamilyBoxItems(fontList);
1057 void KFontChooser::Private::_k_showXLFDArea(
bool show)
1061 xlfdEdit->parentWidget()->show();
1065 xlfdEdit->parentWidget()->hide();
1075 QString KFontChooser::Private::styleIdentifier(
const QFont &font)
1077 const QChar comma(QLatin1Char(
','));
1078 return QString::number(font.weight()) + comma
1079 + QString::number((
int)font.style()) + comma
1080 +
QString::number(font.stretch());
1083 #include "kfontchooser.moc"
1084 #include "sampleedit_p.moc"