commit 9787ad9fcb03f977108d0c426e4de4ee7e5bff7b
parent 97a4096a1801cf0d39c77e53861b86b7967baa64
Author: Oli Larkin <olilarkin@googlemail.com>
Date: Sat, 20 May 2023 16:17:56 +0200
Implement title using IVLabelControl
Diffstat:
4 files changed, 61 insertions(+), 4 deletions(-)
diff --git a/NeuralAmpModeler/NeuralAmpModeler.cpp b/NeuralAmpModeler/NeuralAmpModeler.cpp
@@ -49,6 +49,12 @@ const IVStyle style =
DEFAULT_WIDGET_FRAC,
DEFAULT_WIDGET_ANGLE};
+const IVStyle titleStyle =
+DEFAULT_STYLE
+.WithValueText(IText(24, COLOR_WHITE, "Ronduit-Light"))
+.WithDrawFrame(false)
+.WithShadowOffset(2.f);
+
NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
@@ -80,9 +86,12 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
mLayoutFunc = [&](IGraphics* pGraphics) {
pGraphics->AttachCornerResizer(EUIResizerMode::Scale, false);
pGraphics->AttachTextEntryControl();
- pGraphics->AttachBackground(BACKGROUND_FN);
pGraphics->EnableMouseOver(true);
- pGraphics->EnableTooltips(true);
+ pGraphics->EnableTooltips(true);
+
+ pGraphics->LoadFont("Roboto-Regular", ROBOTO_FN);
+ pGraphics->LoadFont("Ronduit-Light", RONDUIT_FN);
+
auto helpSVG = pGraphics->LoadSVG(HELP_FN);
auto fileSVG = pGraphics->LoadSVG(FILE_FN);
auto closeButtonSVG = pGraphics->LoadSVG(CLOSE_BUTTON_FN);
@@ -92,11 +101,12 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
const IBitmap switchBitmap = pGraphics->LoadBitmap((TOGGLE_FN), true);
const IBitmap switchHandleBitmap = pGraphics->LoadBitmap((TOGGLE_HANDLE_FN), true);
const IBitmap knobRotateBitmap = pGraphics->LoadBitmap(KNOB_FN);
- pGraphics->LoadFont("Roboto-Regular", ROBOTO_FN);
+
const IRECT b = pGraphics->GetBounds();
const IRECT mainArea = b.GetPadded(-20);
const auto content = mainArea.GetPadded(-10);
- const float titleHeight = 50.0f;
+ const auto titleHeight = 50.0f;
+ const auto titleArea = content.GetFromTop(titleHeight);
// Area for the Noise gate knob
const float allKnobsHalfPad = 10.0f;
@@ -203,6 +213,9 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
}
};
+ pGraphics->AttachBackground(BACKGROUND_FN);
+ pGraphics->AttachControl(new IVLabelControl(titleArea, "Neural Amp Modeler", titleStyle));
+
#ifdef NAM_PICK_DIRECTORY
const std::string defaultNamFileString = "Select model directory...";
const std::string defaultIRString = "Select IR directory...";
diff --git a/NeuralAmpModeler/config.h b/NeuralAmpModeler/config.h
@@ -57,6 +57,8 @@
#define APP_SIGNAL_VECTOR_SIZE 64
#define ROBOTO_FN "Roboto-Regular.ttf"
+#define RONDUIT_FN "RonduitCapitals-Light.ttf"
+
#define HELP_FN "help.svg"
#define FILE_FN "SkinEHeritage_File.svg"
#define FOLDER_FN "folder.svg"
diff --git a/NeuralAmpModeler/resources/fonts/Ronduit-Capitals-Light-License.txt b/NeuralAmpModeler/resources/fonts/Ronduit-Capitals-Light-License.txt
@@ -0,0 +1,41 @@
+Preamble
+In this license, 'the given typeface' refers to the given .zip file, which may contain one or numerous fonts. These fonts can be of any type (.ttf, .otf, ...) and together they form a 'font family' or in short a 'typeface'.
+
+1. Copyright
+The given typeface is the intellectual property of
+Ivan Filipov
+Neogrey Ltd
+Plovdiv, Bulgaria
+
+provided it is original, and is protected by copyright laws in many parts of the world.
+
+2. Personal Use
+The given typeface may be downloaded and used free of charge for personal use, as long as the usage is not racist or illegal. Personal use refers to all usage that does not generate financial income in a business manner, for instance:
+
+- personal scrapbooking for yourself
+- recreational websites and blogs for friends and family
+- prints such as flyers, posters, t-shirts for churches, charities, and non-profit organizations
+
+3. Commercial Use
+Commercial use is not allowed without prior written permission from the respective author. Please contact the author to ask for commercial licensing. Commercial use refers to usage in a business environment, including:
+
+- business cards, logos, advertising, websites, mobile apps for companies
+- t-shirts, books, apparel that will be sold for money
+- flyers, posters for events that charge admission
+- freelance graphic design work
+- anything that will generate direct or indirect income
+
+4. Modification
+The given typeface may not be modified, altered, adapted or built upon without written permission by its respective author. This pertains all files within the downloadable font zip-file.
+
+5. Conversion
+The given typeface may be converted to other formats such as WOFF, SVG or EOT webfonts, as long as the font is not modified in any other way, such as changing names or altering individual glyphs.
+
+6. Distribution
+While the given typeface may freely be copied and passed along to other individuals for private use as its original downloadable zip-file, it may not be sold or published without written permission by its respective author.
+
+7. Embedding
+The given typeface may be embedded into an application such as a web- or mobile app, as long as the application is of personal use and does not distribute the given typeface, such as offering it as a download.
+
+8. Disclaimer
+The given typeface is offered 'as is' without any warranty. Neogrey Ltd and Ivan Filipov shall not be liable for any damage derived from using this typeface. By using the given typeface you agree to the terms of this license.
+\ No newline at end of file
diff --git a/NeuralAmpModeler/resources/fonts/RonduitCapitals-Light.ttf b/NeuralAmpModeler/resources/fonts/RonduitCapitals-Light.ttf
Binary files differ.