Jump to content

Recommended Posts

Posted (edited)

I'm attempting to use gwinSetFont to set the font of a label widget I have created it. I open the font and then pass this to gwinSetFont along with the handle of the label object. I cannot get this to work at all. I've tried calling this for the parent container as well and calling gwinRedraw and nothing seems to work. It just seems to default to the smallest font. I'm using uGFX 2.5.

 

What does work however, is calling the gwinSetDefaultFont instead before the widget is created.

Edited by kengineer
Posted

I do that, widget is invisible by default. I call gwinSetFont, then make it visible and then I call a redraw. Doesn't work. Only calling gwinSetDefaultFont before the widget is created results in a change of font.

Posted

Well, that shouldn't happen... :D

Are you sure that the font is opened correctly? Can you manually draw a text using gdispGDrawString() using that font?
Can you supply us with a minimal test case example that allows us reproducing the problem?

Posted

Yes it works with the gdisp call. I'll work on a short example to post here with my problem.

 

FYI, I discovered possibly a bug or unhandled behavior when I was investigating this issue. If you don't set the default font, and you create a label widget without the width or height set, it will end up passing a null pointer to the getwidth/getheight function.

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
×
×
  • Create New...