jarekk
-
Posts
9 -
Joined
-
Last visited
Content Type
Forums
Store
Downloads
Blogs
Posts posted by jarekk
-
-
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).
-
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 ?
-
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
-
Thanks.
Much much better - now indeed it works without any glitches
-
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.
-
Was it really ? I tried the same with 2015 Community Edition and ugfx 2.7 - had to apply same fixes.
Also got some chinese characters for free :-) ( this is sample project from ugfx repo for win32 )
-
Ok,
I have used the font converter - this works nicely !!!!!!
First three ordinary fonts, then the last one with anti-aliasing
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"
- 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.
-
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.
uGFX-Studio v0.20 - Beta
in uGFX-Studio
Posted
Well, that was the reason why I had to go back to uGui ( my setup takes 21.5kB without fonts ). I have STM32F429, but still having quite large functionality besides GUI I could not afford GWIN and GDISP was not enough. So I am interested too how to scale down uGfx.
I can tell you how my current system works, so it may be some inspiration:
- There are 3 layers - GDISP ( equivalent), the other two split GWIN functionality. One ( RENDER) is responsible just for rendering widgets, the other one (MESSAGES) for processing messages from inputs, touch screen etc.
- It is posisble to use only first two - GDISP and RENDER.
- MESSAGES is used on demand - you put event there and it processes object hierarchy to trigger possible reaction ( in this particular system only callbacks are used). It is separated from other modules, just has access to their data.
I have built my system around GDISP/RENDER only. This means really simple setup - I execute just rendering widgets. When user touches button, I execute different render , periodically I update measurement data on display ( by updating manually widget texts).
It means more manual work, but for simple UI which have basically data outputs and simple selections it is enough.