bool QFontProto::fixedPitch() const { QFont *item = qscriptvalue_cast<QFont*>(thisObject()); if (item) return item->fixedPitch(); return false; }
QFont stripStyleName(QFont &f, QFontDatabase &db) { const QString &styleName = f.styleName(); if (styleName.isEmpty()) { return f; } else { QFont g = (db.styleString(f) != styleName) ? db.font(f.family(), styleName, f.pointSize()) : QFont(f.family(), f.pointSize(), f.weight()); if (auto s = f.pixelSize() > 0) { g.setPixelSize(s); } g.setStyleHint(f.styleHint(), f.styleStrategy()); g.setStyle(f.style()); if (f.underline()) { g.setUnderline(true); } if (f.strikeOut()) { g.setStrikeOut(true); } if (f.fixedPitch()) { g.setFixedPitch(true); } return g; } }
void DFont :: FromODataLayout (ODataLayout *pODataLayout ) { QFont *qfont = NULL; QColor *qcolor = NULL; BEGINSEQ if ( !pODataLayout ) LEAVESEQ if ( qfont = pODataLayout->get_font() ) { strcpy(family_name,QS2SZ(qfont->family())); weight = (ADK_FontWeight)qfont->weight(); italic = qfont->italic(); underline = qfont->underline(); strike_out = qfont->strikeOut(); fixed_pitch = qfont->fixedPitch(); style_hint = (ADK_FontStyle)qfont->styleHint(); style_strategy = (ADK_FontStyleStrategy)qfont->styleStrategy(); stretch = qfont->stretch(); } prefer_quality = NO; if ( style_strategy && QFont::PreferQuality ) { prefer_quality = YES; style_strategy = (ADK_FontStyleStrategy)(style_strategy - QFont::PreferQuality); } if ( qcolor = pODataLayout->get_text_color() ) text_color = QCOLOR2DCOLOR(*qcolor); if ( qcolor = pODataLayout->get_bg_color() ) bg_color = QCOLOR2DCOLOR(*qcolor); use_pixel = NO; if ( (size = qfont->pointSize()) == -1 ) // pixel size used { use_pixel = YES; size = qfont->pixelSize(); } ENDSEQ }
void toString(const QFont & font, QString & szBuffer) { QString szFamily(font.family()); szBuffer.sprintf("%s,%d,%d,%d", szFamily.toUtf8().data(), font.pointSize(), font.styleHint(), font.weight()); QString szOptions; if(font.bold()) szOptions.append('b'); if(font.italic()) szOptions.append('i'); if(font.underline()) szOptions.append('u'); if(font.strikeOut()) szOptions.append('s'); if(font.fixedPitch()) szOptions.append('f'); if(!szOptions.isEmpty()) { szBuffer.append(','); szBuffer.append(szOptions); } }
void MRichTextEdit::fontChanged(const QFont &f) { f_fontsize->setCurrentIndex(f_fontsize->findText(QString::number(f.pointSize()))); f_bold->setChecked(f.bold()); f_italic->setChecked(f.italic()); f_underline->setChecked(f.underline()); f_strikeout->setChecked(f.strikeOut()); if (f.pointSize() == m_fontsize_h1) { f_paragraph->setCurrentIndex(ParagraphHeading1); } else if (f.pointSize() == m_fontsize_h2) { f_paragraph->setCurrentIndex(ParagraphHeading2); } else if (f.pointSize() == m_fontsize_h3) { f_paragraph->setCurrentIndex(ParagraphHeading3); } else if (f.pointSize() == m_fontsize_h4) { f_paragraph->setCurrentIndex(ParagraphHeading4); } else { if (f.fixedPitch() && f.family() == "Monospace") { f_paragraph->setCurrentIndex(ParagraphMonospace); } else { f_paragraph->setCurrentIndex(ParagraphStandard); } } if (f_textedit->textCursor().currentList()) { QTextListFormat lfmt = f_textedit->textCursor().currentList()->format(); if (lfmt.style() == QTextListFormat::ListDisc) { f_list_bullet->setChecked(true); f_list_ordered->setChecked(false); } else if (lfmt.style() == QTextListFormat::ListDecimal) { f_list_bullet->setChecked(false); f_list_ordered->setChecked(true); } else { f_list_bullet->setChecked(false); f_list_ordered->setChecked(false); } } else { f_list_bullet->setChecked(false); f_list_ordered->setChecked(false); } }
void SlideShowConfig::saveSettings() { if (!d->config) return; d->sharedData->mainPage->saveSettings(); d->sharedData->captionPage->saveSettings(); d->sharedData->soundtrackPage->saveSettings(); d->sharedData->advancedPage->saveSettings(); KConfigGroup grp = d->config->group("Advanced Slideshow Settings"); grp.writeEntry("OpenGL", d->sharedData->opengl); grp.writeEntry("Delay", d->sharedData->delay); grp.writeEntry("Print Filename", d->sharedData->printFileName); grp.writeEntry("Print Progress Indicator", d->sharedData->printProgress); grp.writeEntry("Print Comments", d->sharedData->printFileComments); grp.writeEntry("Loop", d->sharedData->loop); grp.writeEntry("Shuffle", d->sharedData->shuffle); grp.writeEntry("Show Selected Files Only", d->sharedData->showSelectedFilesOnly); grp.writeEntry("Use Milliseconds", d->sharedData->useMilliseconds); grp.writeEntry("Enable Mouse Wheel", d->sharedData->enableMouseWheel); // Comments tab settings QFont* commentsFont = d->sharedData->captionFont; grp.writeEntry("Comments Font Family", commentsFont->family()); grp.writeEntry("Comments Font Size", commentsFont->pointSize()); grp.writeEntry("Comments Font Bold", commentsFont->bold()); grp.writeEntry("Comments Font Italic", commentsFont->italic()); grp.writeEntry("Comments Font Underline", commentsFont->underline()); grp.writeEntry("Comments Font Overline", commentsFont->overline()); grp.writeEntry("Comments Font StrikeOut", commentsFont->strikeOut()); grp.writeEntry("Comments Font FixedPitch", commentsFont->fixedPitch()); grp.writeEntry("Comments Font Color", d->sharedData->commentsFontColor); grp.writeEntry("Comments Bg Color", d->sharedData->commentsBgColor); grp.writeEntry("Transparent Bg", d->sharedData->transparentBg); grp.writeEntry("Comments Lines Length", d->sharedData->commentsLinesLength); grp.writeEntry("Effect Name (OpenGL)", d->sharedData->effectNameGL); grp.writeEntry("Effect Name", d->sharedData->effectName); // Sountrack tab grp.writeEntry("Sountrack Loop", d->sharedData->soundtrackLoop); grp.writeEntry("Sountrack Path", d->sharedData->soundtrackPath.path()); // Advanced settings grp.writeEntry("KB Disable FadeInOut", d->sharedData->kbDisableFadeInOut); grp.writeEntry("KB Disable Crossfade", d->sharedData->kbDisableCrossFade); grp.writeEntry("Enable Cache", d->sharedData->enableCache); grp.writeEntry("Cache Size", d->sharedData->cacheSize); d->config->sync(); }
// Settings for font and fontsize bool QgsCodeEditor::isFixedPitch( const QFont &font ) { return font.fixedPitch(); }