Jump to content
Joel Bodenmann

uGFX-Studio v0.20 - Beta

Recommended Posts

This is the official thread for the currently running beta of the µGFX-Studio v0.20.

 

History
The µGFX-Studio v0.20 is a complete rewrite. Everything has been rewritten from scratch. There are quite a lot of fundamental changes compared to the earlier versions (v0.15 was the latest). Most notably, the new µGFX-Studio directly uses the µGFX library for any rendering. This means that the results shown on the virtual display inside of the µGFX-STudio is exactly the same as the result on the real hardware. Changes like that require a complete rewrite of the µGFX-Studio.

Registration
To get access to the new µGFX-Studio v0.20 beta, please drop me a private message and let us know why you think that you're a good participant of the new µGFX-Studio beta program.

Update cycle
We are now devoting a lot more resources to the development of the new µGFX-Studio. During the beta, we'll update on an irregular interval. Whenever there's something new or fixed we'll push an update and a forum post in this topic, so stay tuned!

FAQ

  • µGFX-Studio v0.15 (and earlier) project files are not compatible.

Download
Once you were added to the µGFX-Studio beta program group you can download the µGFX-Studio from the download section:

 

Share this post


Link to post
Share on other sites

We just released v0.20.1. Just re-download from the downloads section.

Here's the changelog:

  • Adding the ability to use the built-in image rendering functions of widgets
  • Adding dialog that pops-up after code generation to inform about success or failure
  • Adding resources manager code that allows to retrieve resources such as images and fonts
  • Adding more options to the target configuration (startup display orientation, heap size, ROMFS)
  • Putting the code generator into a state where it is actually able to generate code that can be compiled and used on real hardware
  • Fixing an issue where some target settings weren't loaded properly
  • Fixing an issue where backgrounds didn't work
  • Fixing an issue where no default widget style was used
  • General bug fixes & improvements
  • Adding new bugs to fix later

Share this post


Link to post
Share on other sites

v0.20.2 just got published. Here's the changelog:

  • Fixing the code generated for imagebox widgets
  • Adding the ability to select whether or not an image should be attempted to be cached (New checkbox in the image editor)
  • General bug fixes & improvements
  • Adding new bugs to fix later

Share this post


Link to post
Share on other sites

The font selection for widgets ( like labels)  does not work yet ? 

I wanted to see myself how the rendering works and the default font seems too good to be truth - I wanted something raster with anti alliasing.

Share this post


Link to post
Share on other sites

Hello @jarekk,

The font stuff is basically fully implemented.
You have to add a new font by right clicking the Project -> Resources -> Fonts entry and clicking New. You are presented with a dialog where you can add a font that has already been converted by our font converter (https://fonts.ugfx.io). Add the converted font (the *.c file) and set the proper font engine name. The font engine name needs to be looked up in the converted font file. At the very bottom you'll find a struct instance where the first two fields are C-strings. The second one is the font engine name. Enter that name in the lineedit of the font dialog and you're all set. You should be able to click any widget (such as the pushbutton or label widget) in the widgets library inside that dialog to get a preview of the font.
In this example, the font engine name is DejaVuSans25_aa:

deleteme.png.dcae53a877684dc9aa41fbb4cac09c96.png

Regarding the "too good to be true": The default font is one of two fonts that we carefully handcrafted ourselves pixel by pixel. That's why it's looking that good. Those two fonts UI1 and UI2 do not come with anti-aliasing. However, you can use any font you like with µGFX by using the font converter. The font converter rasterizes the font and optionally applies anti-aliasing. There's plenty of info about this in the documentation and this forum.

I assume that we should improve the font dialog in the µGFX-Studio a bit :D 

 

Share this post


Link to post
Share on other sites

Hello.
I don't know if this a right place to report the issues on the uGFX-Studio-Beta or not. If not, please give me the right directions.
The issue i was encountered at the first try was when creating the second display page (with +NewDisplayPage), the dimension of the new page is not as the same as the first page created with the new project. I didn't find a place to modify the size of each display page individually.
Thanks. :) 

Share this post


Link to post
Share on other sites

Hello @Shamim and welcome to the µGFX community! :) 

This is definitively the right spot for those sorts of things!
Thank you for bringing this to our attention. We just released v0.20.3 which fixes this problem. You can just re-download the latest version from the downloads page.

Share this post


Link to post
Share on other sites

Hi Joel,

I played around with ugfx studioa bit. Below my findings:

1) A tiny issue: Correct but incorrect filename. Manually change the path to unexisting folder, then select the path using the browser while the folder does exist ( just created it ):

2) Moving a container that has another container in it seems to crash ugfx studio. There also seems to be something with the bounding box sometimes. Cannot reproduce that tiny space between the container and the bounding box all the time.

 

Btw, that auto resize is kinda unexpected and weird. I mean when a container has a child it resizes the child when you move the container/parent, not after you dropped the widget into the container.

 

3) When you add a PushButton to a container and right click the widget, it asks which widget to select ( the PushButton or Container ). When you choose the container and click on delete, it actually deletes the PushButton and not the container.

 

4) Side-effect of changes on in the Interactive Mode. When you change for example the slider position, it keeps the position in the edit mode. Same happens when you have a button and a keyboard. When you click on "return" on the keyboard, the button gets the "pressed"-style. When you return to edit-mode it still shows the "pressed"-style for the button.

 

 5) When you create a new Project in a folder which already is a uGFX studio project folder, it adds another "Default"  target in the Targets list in the Design panel. Repeat this a few times and you end up with quite a few "Default" targets.

 

6) When you create a new project while in Interactive Mode. The Interactive Mode tab is still active(visually, in the top of the screen), but it actually changed to Editor Mode.

Edited by Steffan

Share this post


Link to post
Share on other sites

@Steffan Thank you very much for providing this detailed feedback. We appreciate it a lot and we'll get straight to work! :) 

@ForTest We just tried that with v0.20.3 and it works without any problems. Can you please tell us what doesn't work for you? Is "rounded" not in the list of predefined rendering functions? Is it a simple refreshing error? If so, try to move the widget after changing the rendering function.

Share this post


Link to post
Share on other sites

My mistake. It works.

 

In "Interactive mode" when i press the button it redraw the text label and don't redraw it correctly

Just after the mouse is over the button it's redrawed again correctly

 

 

 

pushbutton error.jpg

Share this post


Link to post
Share on other sites

Ok,

I have used the font converter - this works nicely !!!!!!

First three ordinary fonts, then the last one with anti-aliasing

image.png.71639d400c7c6967492edea365bbdd24.png

 

Few technical comments:

- When adding fonts, there is no hint it needs to compile them. The report comes once it finishes

- There is no way to name the fonts , they are added as "Unnamed"

image.png.c1a6c83a79194ba0f013ab717872a314.png

-  You mentioned two default fonts - there seems to be only one "Default"

- When adding fonts, I can select widget for preview. But the font changes only when I leave the font selection box - simple change is not enough.

 

 

 

Edited by jarekk

Share this post


Link to post
Share on other sites

One more question

Should it work in Win32  target ?

I have managed to compile the generated code on Win32, but there is nothing on the display.

The uGfx works ( I can e.g. draw shapes), but no text rendering.

I hav looked at code generated:

    // ghLabel_3
    wi.g.show = TRUE;
    wi.g.x = 36;
    wi.g.y = 128;
    wi.g.width = 120;
    wi.g.height = 30;
    wi.g.parent = 0;
    wi.text = "Label";
    wi.customDraw = 0;
    wi.customParam = 0;
    wi.customStyle = 0;
    ghLabel_3 = gwinLabelCreate(0, &wi);

There is no font selection ? Looks like not supported yet.

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

Ok, now I can confirm that this is just not yet supported

Adding in code e.g.:

gwinSetDefaultFont(gdispOpenFont("FreeMonoBoldOblique32"));

sets the font for all the widgets

 

image.png.78e6cfef55f3612f33a8b76923f39ecd.png

Share this post


Link to post
Share on other sites

Hello @jarekk,

Thank you for providing your feedback. We added everything to the ToDo list.

On 10/17/2017 at 11:44, jarekk said:

- There is no way to name the fonts , they are added as "Unnamed"

image.png.c1a6c83a79194ba0f013ab717872a314.png

You can either select the font item and hit F2 or double click it to rename. But we'll add Rename as an option to the context menu as well.

 

On 10/17/2017 at 11:44, jarekk said:

-  You mentioned two default fonts - there seems to be only one "Default"

Can you be more specific on this? Where did I/we mention two default fonts?

 

On 10/17/2017 at 11:44, jarekk said:

- When adding fonts, I can select widget for preview. But the font changes only when I leave the font selection box - simple change is not enough.

Will take care of that!

 

On 10/17/2017 at 16:14, jarekk said:

Should it work in Win32  target ?

Yes, it should. The generated code is µGFX high-level code that should work on any platform that the µGFX library runs on.

 

6 hours ago, jarekk said:

Ok, now I can confirm that this is just not yet supported

Adding in code e.g.:

gwinSetDefaultFont(gdispOpenFont("FreeMonoBoldOblique32"));

sets the font for all the widgets

That is fully supported. You select the default font in the target. Just edit the Default target. Please let us know whether that worked as intended.
I will look into why the label doesn't get a font assignment. Most likely that just got missed out in the code generator.

Share this post


Link to post
Share on other sites

Hi

23 hours ago, Joel Bodenmann said:

Hello @jarekk,

Thank you for providing your feedback. We added everything to the ToDo list.

You can either select the font item and hit F2 or double click it to rename. But we'll add Rename as an option to the context menu as well.

Yes, that would be nice. I also recall that there were some issues with resource manager which wanted fonts by names. I fixed it manually, you could try yourself to generate sample code with new fonts and try if it compiles.

 

 

23 hours ago, Joel Bodenmann said:

Can you be more specific on this? Where did I/we mention two default fonts?

 

You mentioned once that you crafted nice pixel fonts.  I could not use directly the config file generated from ugfx studio, and by default there are no fonts in the system.

The resource manager , if cannot find fonts tries to give first from its repository , but there must be something. I have fixed it in my config file.

23 hours ago, Joel Bodenmann said:

I will look into why the label doesn't get a font assignment. Most likely that just got missed out in the code generator.

Your widgets do not seem to have font as part of their internal data -  does it mean that you will havo to switch system fonts before creating these widgets ?

And I guess - the idea is that multiple fonts at once ( well in different widgets) will be supported ?

 

 

 

 

 

Share this post


Link to post
Share on other sites
20 hours ago, jarekk said:

Yes, that would be nice. I also recall that there were some issues with resource manager which wanted fonts by names. I fixed it manually, you could try yourself to generate sample code with new fonts and try if it compiles.

Can you please be more specific? What's the issue with the resource manager? It works well here. As I'll describe further down it was just that the code generator of the widgets didn't generate code for the per-widget font. But the resource manager appears to do well. I couldn't spot any problem with that.

 

20 hours ago, jarekk said:

You mentioned once that you crafted nice pixel fonts.  I could not use directly the config file generated from ugfx studio, and by default there are no fonts in the system.

The resource manager , if cannot find fonts tries to give first from its repository , but there must be something. I have fixed it in my config file.

Those are not default fonts, those are just fonts we created ourselves. The term "default font" refers to the GWIN default font.
It's correct that currently the resource manager doesn't give access to fonts already present in the µGFX library. Just add your own fonts. We do not provide the TTF for the fonts we created ourselves but you don't need that. You can just pick the UI1 and UI2 fonts from /src/gdisp/fonts and add them to the studio like you would with any other font you converted yourself.

 

20 hours ago, jarekk said:

Your widgets do not seem to have font as part of their internal data -  does it mean that you will havo to switch system fonts before creating these widgets ?

Just fixed that. Internally everything is present. The code generator simply didn't generate code for that property. Everything works as expected now. v0.20.4 will contain this fix.

 

20 hours ago, jarekk said:

And I guess - the idea is that multiple fonts at once ( well in different widgets) will be supported ?

That's already supported. It was just the code generator that didn't generate the corresponding code.

Share this post


Link to post
Share on other sites

Hi,

The original problem was here (generated code):

resource_manager.h

// Font indexes
#define Unnamed 0
#define Unnamed 1
#define Unnamed 2
 

resource_manager.c

bool_t guiResourcesManagerInit(void)
{
        size_t i;

        // Open fonts
        _fontsArray[0] = gdispOpenFont(Unnamed);
        _fontsArray[1] = gdispOpenFont(Unnamed);
        _fontsArray[2] = gdispOpenFont(Unnamed);

        return TRUE;
}
 

First, the names/font indexes were not unique. Second , gdispOpenFont () expects character string as argument - not number.

I guess this will be my last comment for a while - I tried to scale down ugfx and it is much more then my previous choice. I have to live with only internal memory so the resources are precious. Especially that I have static gui which needs only simple widgets drawn ( without timers, messages, input etc. - just to update contents  on demand).

 

 

 

 

Share this post


Link to post
Share on other sites

Thank you for explaining this. The reason it worked for me is because gdispOpenFont() returns the first font it finds if the specified font wasn't found. I was only using one custom font so I didn't notice the problem. This issue has been resolved now as well.

We'll implement a feature that will prevent having multiple resources with the same name.

Edit: There was actually a fundamental problem with names of resources. We fixed this now. All elements will have unique names now if you create new ones. So you get Unnamed, Unnamed_1, Unnamed_2 and so on.

Share this post


Link to post
Share on other sites

Just a short comment on what you said about size...

ugfx has multiple modules which provide different features e.g. GDISP is just basic drawing, GWIN is a full windowing system. As individual modules can be turned off and on and many sub-features can also be turned off and on it is possible to build a compromise between functionality and resource usage. Unfortunately when you want the advanced features the price in resources must be paid. At one extreme GDISP is small (particularly if only the required features are turned on and only the UI2 font is used). It also does not require any other modules. On the other hand GWIN requires just about every other module in uGFX although again features can still be controlled.

We have spent a lot of effort to keep resource usage to the minimum as it is designed for embedded platforms and we believe it is the lightest in the industry. Still, running GWIN on a ATmega8 is not really practicle.

Studio is built on top of GWIN. As it is generated code it is never going to be as efficient as hand optimised code (Although again we try hard). Unfortunately, there is a price to pay for the power that Studio brings taking it beyond the capabilities of some devices.

That is the thing about embedded programming - it is always a compromise between resources and the power of the provided interface.

Any ideas that you (or anyone else) can provide on how we can offer the same functionality with less resource usage we would love to hear from you. Just create a new forum topic, we need all the help and ideas we can get. :)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×