include Arcon for consistent patchboard font rendering cross-platform
parent
0d2bb972b0
commit
58a17e0417
2
notes
2
notes
|
@ -52,7 +52,7 @@ TODO {
|
|||
# make knob notches more even (currently "previous value" is twice as big as any other step at px>1)
|
||||
add standardized step values for knobs (int enum?)
|
||||
|
||||
include Arcon (rounded) for use as unified patchboard font?
|
||||
- include Arcon (rounded) for use as unified patchboard font?
|
||||
|
||||
bugs to fix {
|
||||
it sometimes crashes on exit??
|
||||
|
|
|
@ -22,6 +22,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
// make sure bundled fonts are loaded
|
||||
QFontDatabase::addApplicationFont(":/fonts/iosevka-term-light.ttf");
|
||||
QFontDatabase::addApplicationFont(":/fonts/Arcon-Rounded-Regular.otf");
|
||||
|
||||
Xybrid::Config::PluginRegistry::init();
|
||||
Xybrid::Audio::AudioEngine::init();
|
||||
|
|
|
@ -4,6 +4,8 @@ using namespace Xybrid::NodeLib;
|
|||
using Note = InstrumentCore::Note;
|
||||
using namespace Xybrid::Data;
|
||||
|
||||
#include "nodelib/commandreader.h"
|
||||
|
||||
#include "data/porttypes.h"
|
||||
#include "config/pluginregistry.h"
|
||||
using namespace Xybrid::Config;
|
||||
|
@ -107,6 +109,11 @@ void I2x03::init() {
|
|||
note.adsr = adsr.normalized();
|
||||
};
|
||||
|
||||
core.globalParam['Q'] = [](const ParamReader& pr) {
|
||||
qDebug() << "global recieved" << pr.param() << pr.val();
|
||||
return true;
|
||||
};
|
||||
|
||||
core.processNote = [this](Note& note, AudioPort* p) {
|
||||
double freq;// = 440.0 * std::pow(SEMI, enote - (45+12*2));
|
||||
|
||||
|
|
Binary file not shown.
|
@ -1,6 +1,7 @@
|
|||
<RCC>
|
||||
<qresource prefix="/fonts">
|
||||
<file>iosevka-term-light.ttf</file>
|
||||
<file>Arcon-Rounded-Regular.otf</file>
|
||||
</qresource>
|
||||
<qresource prefix="/img">
|
||||
<file>xybrid-logo-tiny.png</file>
|
||||
|
|
|
@ -36,12 +36,22 @@ double KnobGadget::get() {
|
|||
}
|
||||
|
||||
KnobGadget::KnobGadget(QGraphicsItem* parent) : QGraphicsObject(parent) {
|
||||
static QFont f = [] {
|
||||
QFont f("Arcon Rounded", 7);
|
||||
//f.setPointSizeF(7.5);
|
||||
//f.setStretch(QFont::SemiCondensed);
|
||||
//f.setStretch(90);
|
||||
return f;
|
||||
}();
|
||||
|
||||
label = new QGraphicsSimpleTextItem(this);
|
||||
valLabel = new QGraphicsSimpleTextItem(this);
|
||||
label->setBrush(QColor(255, 255, 255));
|
||||
valLabel->setBrush(QColor(255, 255, 255));
|
||||
label->setScale(0.8);
|
||||
valLabel->setScale(0.8);
|
||||
label->setFont(f);
|
||||
valLabel->setFont(f);
|
||||
//label->setScale(0.8);
|
||||
//valLabel->setScale(0.8);
|
||||
}
|
||||
|
||||
QRectF KnobGadget::boundingRect() const {
|
||||
|
|
|
@ -56,12 +56,19 @@ void PortObject::setHighlighted(bool h, bool hideLabel) {
|
|||
|
||||
bool lv = h && !hideLabel;
|
||||
if (lv) {
|
||||
static QFont f = [] {
|
||||
QFont f("Arcon Rounded", 8);
|
||||
|
||||
return f;
|
||||
}();
|
||||
QString txt = QString("%1 %2").arg(Util::enumName(port->dataType()).toLower()).arg(Util::hex(port->index));
|
||||
if (!port->name.empty()) txt = QString("%1 (%2)").arg(QString::fromStdString(port->name)).arg(txt);
|
||||
QColor c = tcolor[port->dataType()];
|
||||
label->setFont(f);
|
||||
label->setText(txt);
|
||||
label->setBrush(c);
|
||||
|
||||
labelShadow->setFont(f);
|
||||
labelShadow->setText(txt);
|
||||
labelShadow->setBrush(c.darker(400));
|
||||
labelShadow->setPen(QPen(labelShadow->brush(), 2.5));
|
||||
|
@ -367,8 +374,12 @@ void NodeObject::paint(QPainter* painter, const QStyleOptionGraphicsItem* opt, Q
|
|||
painter->drawRoundedRect(r, 8, 8);
|
||||
|
||||
if (showName) {
|
||||
QFont f = painter->font();
|
||||
f.setPointSizeF(9);
|
||||
static QFont f = [] {
|
||||
QFont f("Arcon Rounded", 8);
|
||||
f.setStretch(QFont::SemiCondensed);
|
||||
return f;
|
||||
}();
|
||||
|
||||
painter->setFont(f);
|
||||
QRectF tr = r - QMarginsF(edgePad, edgePad - 1, edgePad, 0);
|
||||
if (!node->name.empty()) {
|
||||
|
|
Loading…
Reference in New Issue