Hi,
Is existing a way to display extented ASCII character(s) by nvgText() method, from widget? or alternative way…
The character I want to display is degree symbol, °, ASCII 176.
Thanks in advance for your advice.
Hi,
Is existing a way to display extented ASCII character(s) by nvgText() method, from widget? or alternative way…
The character I want to display is degree symbol, °, ASCII 176.
Thanks in advance for your advice.
I think you just need to paste the character into a string in your code. If you have a look in the rack source code, CHECKMARK_STRING and RIGHT_ARROW are defined in common.hpp as:
#define CHECKMARK_STRING "✔"
#define RIGHT_ARROW "▸"
I think as long as the font you are using supports the glyph it should be just fine to use extended characters, as the Count says, just paste the character in as a string… if that doesnt work or your editor doesnt like it, you can use an escape sequence
Depending on the font you can get great results, see here on my module the title uses an icon font VCV Library - DanT Kalkatron
Here are the Google icon fonts
Thanks CountModula & Dan, I’ll test this ASAP!
Kalkatron seems an amazing module! I’ll give it a chance. Thank you.
In case it helps, here is the type of code that draws the title icon for Kalkatron, the codepoints file next to the font file indicates which escape sequence to use for each icon:
std::shared_ptr<rack::window::Font> font = APP->window->loadFont(rack::asset::plugin(pluginInstance, "font/MaterialIcons-Regular.ttf"));
nvgFontFaceId(vg, font->handle);
nvgFontSize(vg, 14.0f);
nvgTextLetterSpacing(vg, 0.0f);
nvgTextAlign(vg, static_cast<int>(NVG_ALIGN_CENTER | NVG_ALIGN_TOP));
nvgBeginPath(vg);
nvgFillColor(vg, nvgRGBA(0, 0, 50, 255));
nvgText(vg, xPos, yPos, "\uea5f", NULL);
nvgFill(vg);
For this new (incoming) module - KlokSpid MkII:
When I set the phase shift by the horizontal fader, at the moment the parameter readout (above fader, yellow color) indicates the Phase Shift but as percent (-50% to +50%) - or “IN-PHASE” when centered:
My goal is to display the phase shift in degrees, from -180° (left position) to 180% (right position), instead of percent.
I’ll try you tip next evening (France time), hope it will work. At the moment I’m working hard on wavetable support…
Thanks Dan.
Looks cool
Thanks - but it’s a monster, perhaps a bit complicated (without experience on it) a bit can of worms sometimes… lol
DanT plugin (all modules) is installed, Moar Cowbell looks fantastic, I love the original design, well done!