Skip to content

Commit

Permalink
changed out some fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
hsetlik committed Apr 11, 2021
1 parent 5f44d68 commit 70a32ac
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 14 deletions.
9 changes: 9 additions & 0 deletions Source/CustomLnF.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ class LnF1 : public juce::LookAndFeel_V4
void drawRotarySlider (juce::Graphics& g, int x, int y, int width, int height, float sliderPos,
const float rotaryStartAngle, const float rotaryEndAngle, juce::Slider& s) override;
};

class LnF2 : public juce::LookAndFeel_V4
{
public:
LnF2()
{
setDefaultSansSerifTypefaceName("Roboto Light Italic");
}
};
38 changes: 28 additions & 10 deletions Source/OperatorComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@ panLabel(&panSlider, "")
{
attachAll(pTree);
addAndMakeVisible(&levelSlider);
levelSlider.setLookAndFeel(&look); //override the vertical bar draw method next
levelSlider.setLookAndFeel(&look1); //override the vertical bar draw method next
addAndMakeVisible(&ratioSlider);
ratioSlider.setLookAndFeel(&look);
ratioSlider.setLookAndFeel(&look1);
addAndMakeVisible(&modIndexSlider);
modIndexSlider.slider.setLookAndFeel(&look);
modIndexSlider.slider.setLookAndFeel(&look1);
addAndMakeVisible(&outputButton);
outputButton.addListener(this);
addAndMakeVisible(&delaySlider);
delaySlider.setLookAndFeel(&look);
delaySlider.setLookAndFeel(&look1);
addAndMakeVisible(&attackSlider);
attackSlider.setLookAndFeel(&look);
attackSlider.setLookAndFeel(&look1);
addAndMakeVisible(&holdSlider);
holdSlider.setLookAndFeel(&look);
holdSlider.setLookAndFeel(&look1);
addAndMakeVisible(&decaySlider);
decaySlider.setLookAndFeel(&look);
decaySlider.setLookAndFeel(&look1);
addAndMakeVisible(&sustainSlider);
sustainSlider.setLookAndFeel(&look);
sustainSlider.setLookAndFeel(&look1);
addAndMakeVisible(&releaseSlider);
releaseSlider.setLookAndFeel(&look);
releaseSlider.setLookAndFeel(&look1);
addAndMakeVisible(&panSlider);
panSlider.setLookAndFeel(&look);
panSlider.setLookAndFeel(&look1);

addAndMakeVisible(&ratioLabel);
addAndMakeVisible(&indexLabel);
Expand All @@ -73,6 +73,13 @@ panLabel(&panSlider, "")
addAndMakeVisible(&sustainLabel);
addAndMakeVisible(&releaseLabel);

delayLabel.setLookAndFeel(&look2);
attackLabel.setLookAndFeel(&look2);
holdLabel.setLookAndFeel(&look2);
decayLabel.setLookAndFeel(&look2);
sustainLabel.setLookAndFeel(&look2);
releaseLabel.setLookAndFeel(&look2);

panSlider.setVisible(false);
panSlider.setEnabled(false);
panLabel.setVisible(false);
Expand All @@ -94,6 +101,13 @@ OperatorComponent::~OperatorComponent()
sustainSlider.setLookAndFeel(nullptr);
releaseSlider.setLookAndFeel(nullptr);
panSlider.setLookAndFeel(nullptr);

delayLabel.setLookAndFeel(nullptr);
attackLabel.setLookAndFeel(nullptr);
holdLabel.setLookAndFeel(nullptr);
decayLabel.setLookAndFeel(nullptr);
sustainLabel.setLookAndFeel(nullptr);
releaseLabel.setLookAndFeel(nullptr);
}

void OperatorComponent::buttonClicked(juce::Button *b)
Expand Down Expand Up @@ -149,6 +163,10 @@ void OperatorComponent::resized()

panSlider.setBounds(18 * n, 6 * n, 5 * n, 5 * n);
panLabel.setBounds(17.5 * n, 11 * n, 6 * n, 2 * n);

panLabel.setFontSize(3 * dN);
ratioLabel.setFontSize(3 * dN);
indexLabel.setFontSize(3 * dN);
}

void OperatorComponent::paint(juce::Graphics &g)
Expand Down
5 changes: 3 additions & 2 deletions Source/OperatorComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class OperatorComponent : public juce::Component, public juce::Button::Listener
PanSlider panSlider;
EnvLabel panLabel;

LnF1 look;
LnF1 look1;
LnF2 look2;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (OperatorComponent)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(OperatorComponent)
};
2 changes: 2 additions & 0 deletions Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ audioProcessor (p)
addAndMakeVisible(*allOps.getLast());
}

juce::LookAndFeel::getDefaultLookAndFeel().setDefaultSansSerifTypefaceName("Founders Grotesk Light");

addAndMakeVisible(&algGraph);
addAndMakeVisible(&patchLoader);

Expand Down
12 changes: 10 additions & 2 deletions Source/SliderSubclasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ class EnvLabel : public juce::Label, public juce::Slider::Listener
EnvLabel(juce::Slider* sliderToAttach, juce::String suff) : attachSlider(sliderToAttach), suffix(suff)
{
auto vcrFont = juce::Font("WW Digital", 8.0f, 0);
auto robotoLightItalic = juce::Font("Roboto Light", 8.0f, 0).withStyle(juce::Font::FontStyleFlags::italic);
setEditable(true);
getLookAndFeel().setDefaultSansSerifTypeface(getLookAndFeel().getTypefaceForFont(vcrFont));
setFont(robotoLightItalic);
attachSlider->addListener(this);
setJustificationType(juce::Justification::centred);
setMinimumHorizontalScale(0.25);
Expand All @@ -29,13 +30,18 @@ class EnvLabel : public juce::Label, public juce::Slider::Listener
setText(labelText, juce::dontSendNotification);
}
~EnvLabel() {}
void setFontSize(float size)
{
auto robotoLightItalic = juce::Font("Roboto Light", size, 0).withStyle(juce::Font::FontStyleFlags::italic);
setFont(robotoLightItalic);
}
void sliderValueChanged(juce::Slider* slider) override
{
juce::String tempText;
juce::String labelText;
auto valueToDraw = attachSlider->getValue();
auto fullString = juce::String(valueToDraw);
if(suffix == " ")
if(suffix == "")
{
labelText = fullString;
}
Expand All @@ -49,6 +55,8 @@ class EnvLabel : public juce::Label, public juce::Slider::Listener
tempText = fullString.substring(0, 5);
labelText = tempText + suffix;
}
if(fullString.length() > 6)
labelText = labelText.substring(0, 7);
setText(labelText, juce::dontSendNotification);
}
void textWasEdited() override
Expand Down

0 comments on commit 70a32ac

Please sign in to comment.