cutter/src/helpers.cpp
Hugo Teso ca821e1064 First code commit
First commit with the app code
2017-03-29 12:18:37 +02:00

32 lines
849 B
C++

#include "helpers.h"
QHelpers::QHelpers(QObject *parent) :
QObject(parent)
{
// Meow
}
void QHelpers::normalizeFont(QPlainTextEdit *edit) {
#ifdef Q_OS_LINUX
// Add custom monospaced font
QFontDatabase fontDB;
fontDB.addApplicationFont(":/new/prefix1/fonts/Inconsolata-Regular.ttf");
QFont anonFont("Inconsolata", 12);
QTextDocument *out_doc = edit->document();
out_doc->setDefaultFont(anonFont);
#endif
}
void QHelpers::normalizeEditFont(QTextEdit *edit) {
#ifdef Q_OS_LINUX
// Add custom monospaced font
QFontDatabase fontDB;
fontDB.addApplicationFont(":/new/prefix1/fonts/Inconsolata-Regular.ttf");
QFont anonFont("Inconsolata", 12);
QTextDocument *out_doc = edit->document();
out_doc->setDefaultFont(anonFont);
#endif
}