Changeset 129 in tspsg-svn for trunk/src


Ignore:
Timestamp:
Sep 3, 2010, 5:06:43 PM (14 years ago)
Author:
laleppa
Message:

+ TSPSG now uses DejaVu? LGC Sans Mono as the default font and comes with it "embedded" in the executable.

  • Updated tspsg.tag file.
Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/defaults.h

    r128 r129  
    8181//! Default for "Scroll to the end of output after solving"
    8282#define DEF_SCROLL_TO_END false
     83//! Default font face
     84#define DEF_FONT_FACE "DejaVu LGC Sans Mono"
    8385/*!
    8486 * \def DEF_FONT_SIZE
  • trunk/src/globals.h

    r121 r129  
    108108}
    109109
    110 /*!
    111  * \brief Returns the default font for solution output.
    112  * \return The family name of the default font.
    113  */
    114 inline QString getDefaultFont()
    115 {
    116 QFont f;
    117 #ifdef HANDHELD
    118         f.setStyleHint(QFont::SansSerif);
    119 #else // HANDHELD
    120         f.setStyleHint(QFont::TypeWriter);
    121 #endif // HANDHELD
    122         return f.defaultFamily();
    123 }
    124 
    125110#ifdef Q_OS_WIN32
    126111/*!
  • trunk/src/main.cpp

    r121 r129  
    5353        qsrand(QDateTime::currentDateTime().toTime_t() ^ QCursor::pos().x() ^ QCursor::pos().y());
    5454
     55        QFontDatabase::addApplicationFont(":/files/DejaVuLGCSansMono.ttf");
     56
    5557QTranslator en;
    5658        if (en.load("tspsg_en", PATH_L10N))
  • trunk/src/mainwindow.cpp

    r128 r129  
    748748                pic.begin(&graph);
    749749                pic.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
    750 QFont font = settings->value("Output/Font", QFont(getDefaultFont(), 9)).value<QFont>();
     750QFont font = settings->value("Output/Font", QFont(DEF_FONT_FACE, 9)).value<QFont>();
    751751                if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) {
    752752                        font.setWeight(QFont::DemiBold);
     
    11451145void MainWindow::initDocStyleSheet()
    11461146{
    1147         solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(getDefaultFont(), DEF_FONT_SIZE)).value<QFont>());
     1147        solutionText->document()->setDefaultFont(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)).value<QFont>());
    11481148
    11491149        fmt_paragraph.setTopMargin(0);
  • trunk/src/settingsdialog.cpp

    r128 r129  
    255255        cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool());
    256256
    257         font = settings->value("Font", QFont(getDefaultFont(), DEF_FONT_SIZE)).value<QFont>();
     257        font = settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)).value<QFont>();
    258258        color = settings->value("Colors/Text", DEF_TEXT_COLOR).value<QColor>();
    259259        settings->endGroup();
     
    301301        if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
    302302                if (QMessageBox::question(this, tr("Settings Reset"), tr("Do you really want to <b>reset all application settings to their defaults</b>?"), QMessageBox::RestoreDefaults | QMessageBox::Cancel) == QMessageBox::RestoreDefaults) {
    303                         _newFont = (font != QFont(getDefaultFont(), DEF_FONT_SIZE));
     303                        _newFont = (font != QFont(DEF_FONT_FACE, DEF_FONT_SIZE));
    304304                        _newColor = (color != DEF_TEXT_COLOR);
    305305                        settings->remove("");
Note: See TracChangeset for help on using the changeset viewer.