In skindemo. C does not use common labels. It took some time to study it. The key is the assignment of fonts members in the structure of the skin interface. The key code is as follows: static si_nrmlabel_t Title = {"hello", 0xdd0000, 0x00ff00, 0xff0000, 0}; static skin_item_t skin_main_items [] =
{
{Siid_title, si_type_nrmlabel | si_test_shape_rect | si_status_visible,
15, 0, {},-1, "title", 0, & Title},};/* bytes resource loading/uninstalling function */
Void load_skin_fonts (skin_head_t * skin, bool load)
{
Int font_num = 2;
Logfont * my_logfont;
If (load)
{
Skin-> fonts = (logfont *) calloc (font_num, sizeof (logfont ));
My_logfont = createlogfont (null, "Song", "gb2312 ",
Font_weight_regular, font_slant_roman, font_setwidth_normal,
Font_spacing_charcell, font_underline_none, font_struckout_none, 12, 0 );
Memcpy (void *) & skin-> fonts [0], (void *) my_logfont, sizeof (logfont ));
Destroylogfont (my_logfont);/* release font */my_logfont = createlogfont (null, "sansserif", "ISO8859-1 ",
Font_weight_regular, font_slant_italic, font_setwidth_normal,
Font_spacing_charcell, font_underline_none, font_struckout_line,
16, 0 );
Memcpy (void *) & skin-> fonts [1], (void *) my_logfont, sizeof (logfont ));
Destroylogfont (my_logfont);/* release the font */
}
Else
{
Free (void *) Skin-> fonts );
}
}
Then, call it in the main function to complete the uninstallation.