Use font and size from DAW in juce popup menus?

I write because you write before this

But on windows on 4k screen all midi plugins that you write with own code are too small. only main window is scale correct. plugins that support correct scaling are correct(see scaler in this screenshot). only the window title is too small. and the popup menu is too small in your code,

here is a screenshot that show more of your own written unify plugins that are too small.

it seem the forum scale my 4k screenshot down, to 1920. I hope it is now clear what the problem is.

in short;
All plugins that support scaling are correct in juce/unify. all plugins/or childwindows you have written support no scaling and are too small.

so you need a solution hat your own unify plugins or child windows are scale to correct size

that juce/unify show old plugins that not support scaling too small is another thing

@reuk: So it appears that, in some (not all) hosts, the current desktop scale-factor does not get propagated to new juce::DocumentWindow based windows created by a JUCE-based plug-in.

I’m well aware that plug-ins are not supposed to create extra windows at all, so I don’t really expect JUCE to support it. Any advice would be welcome nonetheless.

1 Like

problem happen on all systems with cubase too, when HiDPI is enble(it is default off) so notice this not. When it is not enable then all is blur so a 4k monitor make no sense then.

It seem the Mac have no scale setting and a user can not choose how large the buttons and GUI is. I have no mac so i did not know how large 4 k look. i have a Dell 13 inch win 10 2 in 1 tablet too. it have for 4 k default scale setting 300%. it is good usable with touchscreen but unify is extrem small on this.

please read steinberg information about that

https://helpcenter.steinberg.de/hc/en-us/articles/360001589520-Cubase-10-HiDPI-support-on-Windows-10

HiDPI enabled

HiDPI is only supported on Windows 10 systems.
To enable HiDPI support in Cubase, go to Edit ▸ Preferences ▸ General and check 'Enable HiDPI'. HiDPI support will be enabled next time you start Cubase.
When enabled, the user interface will use graphical assets in high resolution.
Currently Cubase supports only integer monitor scaling settings from Windows, for example.:
    Monitor scaling setting of 125% displays Cubase with 100%
    Monitor scaling setting of 150% displays Cubase with 200%
    Monitor scaling setting of 175% displays Cubase with 200%
    Monitor scaling setting of 200% displays Cubase with 200%

see screenshot how cubase with unify look with HiDPI enable

Hello
there is now juce 6.1.2. it have this enhance

  • Improved the scaling behaviour of hosted VST3 plug-ins

is this problem he writes then fixed too ?.

or can it fix in future that all child windows get the desktop scale factor of parent window ?

No, I’m still working on the problems described in this thread.

2 Likes

Thanks for the suggestion, we’ve added that here:

1 Like

Hello
there is some progress done but on VST 2 VST 3 still not work. here is simular problem with the desktop scale factor AlertWindow and DialogWindow won't scale and center after setGlobalScaleFactor or when JUCE_WIN_PER_MONITOR_DPI_AWARE disabled - #4 by mucoder

I see in your exmple that you not use the windows function SetThreadDPIAwarenessContext . it seem need. see the explain in this thread . link seem not work thread title is high-dpi-support-for-non-plugins-on-windows here is the text he write

Hi, I’m back with my DPI issue fix for Windows :slight_smile: See my previous post which holds a potential fix for Juce 5.3.2. We’ve now upgraded our code base to use Juce 6.0.5 instead, and so I needed to re-apply a similar fix again.

The issue is that (on Windows) standalone Juce applications have proper DPI scaling, and I imagine VST plugins have proper support too (I read something about the host passing on the scaling to use to the plugins?), but plugins for unrelated applications are left at the mercy of their host application’s DPI handling setting. In case we’re not a standalone app, Juce defaults to a 100% DPI scaling, so when the host informs Windows it’s perfectly DPI aware, this results in tiny controls on high DPI monitors in standalone Juce dialogs.

The fix I applied is that when we’re not a standalone app, I query for the DPI support the host has set once, and then (where needed) toggle the DPI support to “per-monitor aware” using SetThreadDPIAwarenessContext for the current thread (and revert it back when not needed anymore). This way no matter which DPI support the host has, the Juce dialogs get sized correctly and look nice and crispy.
Where this is not supported (pre-Windows 10.1703), the code could fall back to use SetThreadDPIAwareness instead (for everything from Windows 8.1 upward); this has to be added to the code though.

There are probably quite a few issues with the code though… For one, I added all of this behind the preprocessor define JUCE_WIN_PER_MONITOR_DPI_AWARE, so for code bases not using this define the fix won’t work (don’t know if that would even make sense though). But I tested it on Windows 7, Windows 8.1 and Windows 10 for one particular host (Adobe Premiere), and on all those combinations the result is good. Then again the changes might very well wreck havoc for VST plugins under their hosts; there’s no way for me to test for that.

… or see my original post for the full post incl. attachments and more details (the post quoted by calvin is a partial re-post by a new user).

2 Likes

Hello
I get the idea because juce do not scale child windows in same way as parent window. Maybe it is the easier and fastest way to get better results for now to disable HiDPI awere for a juce plugin when compile. so no window is scaled. in studio one on plugins that are not DPI aware there can with a menu enable for non DPI plugins “enable System DPI Scaling”. with this enable most plugins are scale correct in size automatic. they only look a little blur. but this is not so big problem as when mainwindow have correct size, but child windows are too small. maybe you can post a hack how can disable dpi aware of a juce based plugin complete, so the DAW handle it as not DPI aware plugin and offer system scaling ?. or did you see hope that child windows scale in same way as parent window can add soon automatic ?. in OO paradigm it is that child windows get font and window scale from parent window.

Hello

Now the developer of Unify compile it with 6.1.6. 7.0.1 have important bugs he write so he currently not workable . the in 6.1.6 result is the same. in standalone mode all work in good size. as plugin VST 2 or VST 3 the popup menu are small .

Can this work in 7.0.1 better ?

Here is a thread in unify forum too with screenshot of a working window that work now. HiDPI mode in unify 1.8.2 – Questions about UNIFY – PlugInGuru Forums but the other problems are all in

I see on github the klangfalter source. GitHub - HiFi-LoFi/KlangFalter: Convolution audio plugin (e.g. for usage as convolution reverb) this work perfect in HiDPi in the setting window too. It is compile with a very old juce 5.4.5. Is it maybe possible that there is a regression in juce that break hidpi support on windows ?. this is maybe a good example to show how windows need open that they work correct in Hidpi. In OO Paradigm the default is that a child object get the attributes of the parent object. this mean that child windows get font size from parent window . in standalone apps this work ok in the juce examples. but not in the plugins

Can you please modify the GUI example in juce sdk that they open as plugins correct child windows and popup menus ?. there can maybe add a C++ macro that open windows correct for hidpi if this help to avoid time of changes

where can i downoad 6.0.7 juce ?. still unify developer have no time and i guess no motivation to let unify work on hidpi correct. also many other plugins i guess juce based have problems in hidpi.it seem too much work to use newer juce and change much code. I test 7.0.5 current build to open a window in the way he post examplecode and can work in 6.0.7

#pragma once
#include <JuceHeader.h>

class AboutBox : public Component
{
public:
AboutBox();

void paint (Graphics&) override;
void resized() override;

static void launch();

private:
Label copyrightLine;
Label vstLine;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AboutBox)

};

as aboutbox.h in projucer to the example plugin project. there come class Component is not find. I change class AboutBox : public juce::Component then come errors on void paint (Graphics&) override;

when i remove this line for test next error is on

Label copyrightLine;
and
Label vstLine;

so please help to get with #define or replacement class code old code working without work. #define can also have parameters https://cplusplus.com/doc/tutorial/preprocessor/ I develop on compiler and gui system but i must admit the gui system of juce look really strange for me. If i can see working child window gui code for newest juce for hidpi i maybe have good chances to write c++ preprocessor macros that translate old code syntax into new code syntax

so please tell how i need change the code that it work ok

aboutbox.cpp look as this

#include “AboutBox.h”

AboutBox::AboutBox()
{
copyrightLine.setColour(Label::textColourId, Colours::white);
copyrightLine.setJustificationType(Justification::horizontallyCentred);
copyrightLine.setText(“(c)2019 The Very Big Corporation of America”, NotificationType::dontSendNotification);
addAndMakeVisible(copyrightLine);

vstLine.setText("VST PlugIn Technology by Steinberg Media Technologies", NotificationType::dontSendNotification);
vstLine.setJustificationType(Justification::horizontallyCentred);
addAndMakeVisible(vstLine);

}

void AboutBox::paint (Graphics& g)
{
g.fillAll(getLookAndFeel().findColour(ResizableWindow::backgroundColourId));
}

void AboutBox::resized()
{
auto bounds = getLocalBounds().reduced(10);
copyrightLine.setBounds(bounds.removeFromTop(24));
vstLine.setBounds(bounds.removeFromTop(24));
}

void AboutBox::launch()
{
DialogWindow::LaunchOptions options;
options.dialogTitle = “About this program”;
AboutBox* view = new AboutBox;
view->setBounds(0, 0, 420, 80);
options.content.set(view, true);
options.useNativeTitleBar = false;
options.launchAsync();
}

You can get JUCE 6.0.7 from here: