kengineer Posted June 23, 2016 Report Share Posted June 23, 2016 (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 June 23, 2016 by kengineer Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 23, 2016 Report Share Posted June 23, 2016 Caling gwinSetFont() won't issue a redraw of the widget. You will have to manually issue a redraw using gwinRedraw(). Link to comment Share on other sites More sharing options...
kengineer Posted June 23, 2016 Author Report Share Posted June 23, 2016 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. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 23, 2016 Report Share Posted June 23, 2016 Well, that shouldn't happen... 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? Link to comment Share on other sites More sharing options...
kengineer Posted June 23, 2016 Author Report Share Posted June 23, 2016 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. Link to comment Share on other sites More sharing options...
kengineer Posted June 24, 2016 Author Report Share Posted June 24, 2016 This ended up being a clean build issue. After I cleaned and rebuilt it worked. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted June 24, 2016 Report Share Posted June 24, 2016 Glad to hear that everything is working as expected! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now