Jump to content

Two lines in Button widget and Unicode fonts


Recommended Posts

Posted

Hello!

Please give me step by step algorythm to create Custom button renderer (to draw two lines text in button Caption) and please tell me how to use new Unicode rendering. Included DejaVu font contains Cyrrilic symbols (I guess not). How I can use them or include them into engine? Thanks

Posted

The GWIN documentation mentions what steps need to be done for a custom render routine. You can also find a thread with sample code here.

You can find all the required information about the widget in the GHandle:


typedef struct GWindowObject {
#if GWIN_NEED_WINDOWMANAGER
// This MUST be the first member of the struct
gfxQueueASyncItem wmq; // @< The next window (for the window manager)
#endif
const struct gwinVMT *vmt; // @< The VMT for this GWIN
coord_t x, y; // @< Screen relative position
coord_t width, height; // @< Dimensions of this window
color_t color, bgcolor; // @< The current drawing colors
uint16_t flags; // @< Window flags (the meaning is private to the GWIN class)
#if GDISP_NEED_TEXT
font_t font; // @< The current font
#endif
} GWindowObject, * GHandle;

I'm going to prepare an example showing how to use cyrillic fonts within the following days.

~ Tectu

Posted

Hello!

I tried step by step guide but without effect (I got last version from bitbucket). I have to modify GDISP_USE_CUSTOM_FONT define and include generated DroidSans10.c instead of userfont.h. But text renders blank...

Could you, please, send me a demo project with Cyrillic fonts?

  • 2 weeks later...

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...