On Wed, 2004-06-30 at 11:29, Tommi Komulainen wrote:
> > > Perhaps the solution is the only allow tags like <u> and <i>? That way the developer
> > > can place emphasis on text still, but the actual sizing and boldness of the text is
> > > limited to the HIG?
> >
> > Limiting to only a certain set of tags would be tricky to implement.
> > And anyways, that's the implicit effect of putting the default
> > attributes on a span surrounding all the user implied markup.
>
> I've implemented a HigAlert dialog in galeon
> (http://cvs.gnome.org/viewcvs/galeon/utils/hig-alert.c) and I figured
> I'd rather not add implicit markup, but rather set the default font
> attributes for the primary label instead. That way it should be pretty
> transparent.
>
> Basically I'm doing the following:
>
> size = pango_font_description_get_size (widget->style->font_desc);
>
> font_desc = pango_font_description_from_string ("bold");
> pango_font_description_set_size (font_desc, size * PANGO_SCALE_LARGE);
>
> gtk_widget_modify_font (widget, font_desc);
>
>
> I wonder if there's something inherently bad with the above. It works,
> though :)
No, nothing bad about the above; though you need a connection to
::style-set to handle dynamic changes in the system font size.
I thought about describing doing it this way but figured it would
clutter up my mail too much.
The end result shoudl be identical to putting:
<span weight="bold" size="large"> </span>
around the string as markup.
Regards,
Owen
[
OK, well, I'd probably do:
font_desc = pango_font_description_new ();
pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
]
Attachment:
signature.asc
Description: This is a digitally signed message part