Closed elanhickler closed 7 years ago
i think, i may have an xy-pad somewhere - need to dig it out. as for knobs and/or custom gui: actually, a knob is just a slider that draws itself differently (and maybe responds differently to mouse-events). the simplest way would be, if you just make a subclass of my slider class (or of ModulatableSlider) and override the paint method there (and possibly also override mouse callbacks). however, that wouldn't help, if you use ready made library gui elements (i.e the various "ModuleEditors" in my library) such as my breakpoint-editor. to make their look-and-feel customizable, i really need to apply this strategy pattern and delegate the painting to some SliderPainter class (which you can then subclass and override the painting function). ok, i think, i can address this thing this coming week. to draw text on a gui, i just use the RTextField widget.
i'll look into your pull request (and your other issues) tomorrow.
to draw lines (or anything at all), just override the paint method in your editor subclass, then use juce drawing functions on the passed "juce::Graphics" object. you can also draw text directly there instead of using textfield widgets
it's better to fix things myself whenever I can and do pull requests.
yeah - this would be especially nice for those pesky mac issues.
I have an idea to fix the major mac issue of preset location. Right now your preset bar has Save and Load.
Just change the buttons to [Save][Load Usr][Load Fctry]
OR have the load button pop up a dropdown where you select user or factory. And then of course the < > buttons go through whatever the current folder is.
This could be a quick fix for now while we wait for you to make a better preset browser. That is the main issue right now, not being able to differentiate factory and user preset.
Oh the other issue is the licensing, not being able to tell the program WHERE your license file is.
I am going to use RWidget to create a text class.
YES I AM LEARNING!!!!!!!
ah - yes. that's the standard juce font rendering. i have made up my own pixelfont rendering because i was unhappy with juce's text rendering. just compare:
especially with bright-on-dark text, juce's font rendering is very blurry. that's why i created my own pixelfont. it may be ugly, but at least, it's sharp :-P
microsoft actually did a pretty good job with font rendering in windows 8 and 10
better than apple or linux
ok but im going to use the argument that JUCE devs will use... DONT USE TINY FONT!
definitely tiny font is needed for sliders.
Maybe I'll look into abandoning the text widget in favor of an svg widget where the text is just vector paths.
Still no word on resizing svg though.
used svg without converting font to paths
using a google font as SVG then converting font to individual paths
I have a better idea for presets.
I should just embed the factory presets in the binary so we don't have multiple folder locations to worry about.
pixel perfect text with JUCE:
easy.
now stop using your bitmap font. :)
oh f*** well it would be pixel perfect if I could center it based on round by 2 number. couldn't figure it out just yet.
edit: and it's not easy.
ah there we go (still not easy)
this looks rather good but still not pixel perfect. yeah ... i remember trying to figure this out by setting an appropriate fontsize, but it didn't work out, so i just thought: f**ck it, i'll create a pixelfont. maybe it depends on the font and one can find a font where it indeed works out. would be nice
I guess what I am essentially doing is making my own bitmap font by taking a font and manipulating it to be pixel perfect. We could convert a font into pixel perfection, I know how. Except then resizing it at all will ruin the pixel perfectness, unless you do even multiples/divisions of the size. But the benefit of my method is that it is actually scalable and will anti-alias correctly.
Basically, take your idea of your pixelfont, and combine it with vector rendering instead of bitmap or whatever/
basically: create pixel perfect vectors for each letter rather than bitmaps.
scalability would be indeed an important improvement since it can be expected that high-resolution displays will become more widespread in the future. on my big uhd-screen, my guis are actually too small
i once contributed to this this project: https://github.com/dliganov/Chaotic-DAW/ and, if i remember correctly, denis (the main dev) somehow managed to get juce's font rendering pixel perfect by appropriate choice of font and size. maybe i can ask how he did it
it's probably exactly as you say: font and size, and not having sub-pixel positioning
that's all it will ever be.
yes, but using integer numbers (rounding) for positioning and font-size (in pixels) does not generally work either. i tried that loooong ago. maybe it works for some specific font/typeface, though.
that's only the first step, and it works for the first letter. It's when the next letter is rendered you can't control the pixel position of the next letter, and subsequent letters. So my ideas is to take any font, MAKE it pixel perfect, then to render it I guess you need to do a custom text renderer like you did for your bitmap. Or I guess you could even create your own font file if you know how.
I've learned the basics of custom UI, this issue is resolved..
ok - do you have your own slider subclass now and override paint? that should work for your own guis, but if i want to make (library provided) sub-editors customizable, i will have to do that delegation thing. we'll see
huh? "that delegation thing"? You mean have someone else do it? Is that someone else me?
I don't have my own slider subclass yet, there's a handful of issues I'm having with your framework that I need to deal with and then I have some code cleanup to do, I need to get really organized, and THEN I can dig more into custom UI stuff.
issues:
In the very near future i'd be nice to have a knob class. I also really need an X/Y pad.
Also still waiting for preset management and other Mac fixes.
How do you draw text? I need to label sets of controls. Actually, lines and text to break up the interface would help.
There's a bit of work to do about it's two months to the end of the year. Keep up with my pull request and other small feature requests, that helps things move along.
It was very easy for me to fix some of the non-strict mouse handling issues with your GUI, yet I posted that request almost a month ago. So, that means it's better to fix things myself whenever I can and do pull requests.