Skip to content

Commit

Permalink
Merge pull request surge-synthesizer#4376 from baconpaul/font-fix
Browse files Browse the repository at this point in the history
Fix a FontSize Slider problem; introduce a font test
  • Loading branch information
baconpaul authored Apr 23, 2021
2 parents ad7609c + 46e618e commit 3a9157a
Showing 5 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -837,6 +837,7 @@ if( BUILD_SURGE_XT )
file(GLOB SURGE_SYNTH_JUCE_RESOURCES_GLOB
assets/SurgeClassic/exported/*svg
resources/fonts/Lato*ttf
resources/fonts/IndieFlower.ttf
)

juce_add_binary_data( surge-xt-binary
Binary file added resources/fonts/IndieFlower.ttf
Binary file not shown.
2 changes: 2 additions & 0 deletions resources/fonts/README-IndieFlower.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
IndieFlower is an OFL font from https://fontlibrary.org/en/font/indie-flower
authored by Kimberly Geswein. We use it here for testing purposes.
3 changes: 2 additions & 1 deletion src/common/gui/CSurgeSlider.cpp
Original file line number Diff line number Diff line change
@@ -153,7 +153,8 @@ void CSurgeSlider::draw(CDrawContext *dc)
}

labfont.setStyleFlags(font_style);
labfont.setHeight(font_size);
if (font_size != labfont.getHeightInPoints())
labfont = labfont.withPointHeight(font_size);

CRect size = getViewSize();

6 changes: 6 additions & 0 deletions src/common/gui/RuntimeFont.cpp
Original file line number Diff line number Diff line change
@@ -26,8 +26,14 @@ namespace GUI

DefaultFonts::DefaultFonts()
{
#define TEST_WITH_INDIE_FLOWER 0
#if TEST_WITH_INDIE_FLOWER
latoRegularTypeface = juce::Typeface::createSystemTypefaceFor(BinaryData::IndieFlower_ttf,
BinaryData::IndieFlower_ttfSize);
#else
latoRegularTypeface = juce::Typeface::createSystemTypefaceFor(BinaryData::LatoRegular_ttf,
BinaryData::LatoRegular_ttfSize);
#endif

displayFont = getLatoAtSize(9);
patchNameFont = getLatoAtSize(13);

0 comments on commit 3a9157a

Please sign in to comment.