I find another way:
+-
| PangoFontDescription * desc = pango_font_description_new();
| pango_font_description_set_size(desc, 50*PANGO_SCALE);
| .
| .
| gtk_widget_modify_font(label, desc);
+-
But I only use gtk api, not gtkmm. How to do this by gtk?
On Thu, Aug 28, 2008 at 9:50 PM, Garth's KidStuff
<[EMAIL PROTECTED]>wrote:
> Whops, hit the send button before I was finished..
>
> the method should be:
>
> void ChangeLabelFontSize(
>Gtk::Label *pLabel, // [in] Pointer to label to
Is the pango markup language most popular way to set font's style?
On Thu, Aug 28, 2008 at 8:16 PM, Tomas Carnecky <[EMAIL PROTECTED]> wrote:
> Dov Grobgeld wrote:
> > Hi Lazy (great name),
> >
> > The way to do it is to set the name of the label through:
> >
> > gtk_widget_set_name(label, "f
Whops, hit the send button before I was finished..
the method should be:
void ChangeLabelFontSize(
Gtk::Label *pLabel, // [in] Pointer to label to change font on
float scale) // [in] amount to scale font size by. 1.0 leaves label
unchanged
{
Glib::RefPtr pPangoContext =
pLabel
Hey there,
Using Gtkmm
void ChangeLabelFontSize(
Glib::RefPtr pPangoContext =
pLabel->get_pango_context();
Pango::FontDescription fontD =
pPangoContext->get_font_description();
fontD.set_size((int)(scale * fontD.get_size()));
pLabel->modify_font(fontD);
--
Gar
Hi Tomas,
You are certainly right The style method is more suited when you want to
change additional properties like background color, etc. I stand corrected.
Regards,
Dov
2008/8/28 Tomas Carnecky <[EMAIL PROTECTED]>
> Dov Grobgeld wrote:
> > Hi Lazy (great name),
> >
> > The way to do it is to
Dov Grobgeld wrote:
> Hi Lazy (great name),
>
> The way to do it is to set the name of the label through:
>
> gtk_widget_set_name(label, "foo");
>
> and then define a style for the name "foo", that includes a font
> specification:
>
> gtk_rc_parse_string("style \"foo\" {\n"
>
Hi Lazy (great name),
The way to do it is to set the name of the label through:
gtk_widget_set_name(label, "foo");
and then define a style for the name "foo", that includes a font
specification:
gtk_rc_parse_string("style \"foo\" {\n"
"font = \"Seri
I wrote the following statememts to set a GtkLabel's font size.
But it seems don't work?
I'm not good at Pango, can anybody help me?
+---
| PangoAttrList *pg_attr_list = pango_attr_list_new();
| PangoAttribute *