void dia_font_set_weight(DiaFont* font, DiaFontWeight weight) { DiaFontWeight old_weight = DIA_FONT_STYLE_GET_WEIGHT(dia_font_get_style(font)); g_return_if_fail(font != NULL); dia_pfd_set_weight(font->pfd,weight); if (old_weight != weight) _dia_font_adjust_size (font, font->height, TRUE); }
DiaFont* dia_font_new_from_style(DiaFontStyle style, real height) { DiaFont* retval; /* in the future we could establish Dia's own default font * matching to be as (font-)system independent as possible. * For now fall back to Pangos configuration --hb */ PangoFontDescription* pfd = pango_font_description_new(); dia_pfd_set_family(pfd,DIA_FONT_STYLE_GET_FAMILY(style)); dia_pfd_set_weight(pfd,DIA_FONT_STYLE_GET_WEIGHT(style)); dia_pfd_set_slant(pfd,DIA_FONT_STYLE_GET_SLANT(style)); dia_pfd_set_height(pfd,height); retval = DIA_FONT(g_object_new(DIA_TYPE_FONT, NULL)); retval->pfd = pfd; _dia_font_adjust_size (retval, height, FALSE); retval->legacy_name = NULL; return retval; }