Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EssEff/ChordSeq: Font size issues #41

Open
cschol opened this issue Jun 29, 2019 · 5 comments
Open

EssEff/ChordSeq: Font size issues #41

cschol opened this issue Jun 29, 2019 · 5 comments

Comments

@cschol
Copy link
Contributor

cschol commented Jun 29, 2019

Font issues on a 4K display on Windows 10 on all platforms for EssEff and ChordSeq:

image

@cschol cschol changed the title EssEff: Font issues on Windows 10 EssEff: Font size issues Jun 29, 2019
@cschol cschol changed the title EssEff: Font size issues EssEff/ChordSeq: Font size issues Jun 29, 2019
@Miserlou
Copy link
Owner

Hm, that's annoying. I'm on a rMBP and don't have that issue.

Screen Shot 2019-06-29 at 8 01 06 PM

This is the line, not sure if there's a way to set this in a density-independent way?

nvgFontSize(vg, 32);

@cschol
Copy link
Contributor Author

cschol commented Jun 29, 2019

I don't know. That would be a question for Andrew. Maybe ask in the forum?

@stoermelder
Copy link

stoermelder commented Jun 29, 2019

I‘m not sure what difference it makes, but you can check nvgTextBox instead.
https://github.com/stoermelder/vcvrack-packone/blob/9cb5dc71f6b8afb8d3a2fd77b6ef887db8b4bb6f/src/ReMove.cpp#L654

@cschol
Copy link
Contributor Author

cschol commented Jul 4, 2019

Figured out one problem:

diff --git a/src/EssEff.cpp b/src/EssEff.cpp
index dec90f4..b25720d 100644
--- a/src/EssEff.cpp
+++ b/src/EssEff.cpp
@@ -29,12 +29,12 @@ std::string soundfont_files[2] = {
 Display
 */
 
-struct SmallStringDisplayWidget : TransparentWidget {
+struct EssEffSmallStringDisplayWidget : TransparentWidget {
 
   std::string *value;
   std::shared_ptr<Font> font;
 
-  SmallStringDisplayWidget() {
+  EssEffSmallStringDisplayWidget() {
     font = Font::load(assetPlugin(pluginInstance, "res/Pokemon.ttf"));
   };
 
@@ -322,13 +322,13 @@ EssEffWidget::EssEffWidget(EssEff *module) {
 
     // Displays
     if(module != NULL){
-        SmallStringDisplayWidget *fileDisplay = new SmallStringDisplayWidget();
+        EssEffSmallStringDisplayWidget *fileDisplay = new EssEffSmallStringDisplayWidget();
         fileDisplay->box.pos = Vec(28, 70);
         fileDisplay->box.size = Vec(100, 40);
         fileDisplay->value = &module->file_name;
         addChild(fileDisplay);
 
-        SmallStringDisplayWidget *presetDisplay = new SmallStringDisplayWidget();
+        EssEffSmallStringDisplayWidget *presetDisplay = new EssEffSmallStringDisplayWidget();
         presetDisplay->box.pos = Vec(28, 170);
         presetDisplay->box.size = Vec(100, 40);
         presetDisplay->value = &module->preset_name;

Both, EssEff and ChordSeq define a class SmallStringDisplayWidget. On Windows and Linux the compiler seems to resolve the symbols to use the EssEff one in both cases and ChordSeq is messed up.

The above fix applied looks like this and ChordSeq looks correct:

image

The EssEff font size is still too big, but from the code this might need adjustment of the font size. It is 32 compared to 13 for the ChordSeq. Even with size 13 the string is overflowing the display box, though.

@Miserlou
Copy link
Owner

Miserlou commented Jul 5, 2019

Thanks, patched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants