Re: printing gtktextview and text layout

2008-04-18 Thread Philippe Rouquier

Le mardi 15 avril 2008 à 15:05 -0400, Behdad Esfahbod a écrit :

 On Sat, 2008-04-12 at 11:08 +0200, Philippe Rouquier wrote:
  
  Could someone help me with that please?
 
 Just reorder your code to use pango_cairo_show_layout() for both display
 and print, then make sure you set font options on your PangoContext
 attached to the layout using pango_cairo_context_set_font_options() to
 turn metrics hinting off (cairo_font_options_set_hint_metrics()).
 

Hi,

Thanks for your answer.
I tried and indeed it works: I used a pangolayout (with hinting turned
off) for display in a widget to reflect what was written in the
GtkTextView. I noticed the same discrepancies of text layout as when I
printed. I then printed and the results matched the on screen
pangolayout.

Now the problem is I want to use and print the GtkTextView. How do I
turn off hinting in a GtkTextView?
But maybe I didn't understand you well?

Thanks again.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

temporary gtkrc file parsing aka 'sub-themes'

2008-04-18 Thread Brian J. Tarricone
Hey all,

I have an app that draws some windows in a special way, and I'm letting 
it be easily themed separately (rather, on top of) gtk's theming.  I'm 
just using normal gtkrc files for the theming, and calling 
gtk_rc_parse() when the user changes the theme.

The problem is this: if the new theme selected doesn't override the same 
things as the previous theme (say, the font), then, after the new theme 
is applied, I see a mix of the old and new themes (new widget colors, 
for example, but with the old font).

Is there any way to make gtk forget it's parsed a particular rcfile 
and start from scratch parsing only the defaults?  I've tried 
gtk_rc_reparse_all_for_settings(setings, TRUE) as well as 
gtk_rc_reset_styles(), but neither seem to help.  I've also tried 
loading the file myself and using gtk_rc_parse_string() in the hopes 
that that's less 'persistent', but no luck.

Am I missing something, or just going about this the wrong way?

-brian
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: setting the font of a dialog widget

2008-04-18 Thread jcupitt
Hi Garth,

2008/4/18 Garth's KidStuff [EMAIL PROTECTED]:
  that's not relevant).  If the widget I'm trying to set happens to be a
  Gtk::Label, then it works.  But other widgets (e.g. Gtk::Frame or
  Gtk::Checkbutton) don't and just seem to use their default font no matter
  what.  For example:

I do this with gtk_label_set_markup(). For example:

  gtk_label_set_markup (GTK_LABEL (label), span font_desc=\Sans\
size=\medium\hello/span);

 // Add the fixed widget to the dialog and size it properly
 get_vbox()-add(m_Fixed);
 m_Fixed.set_size_request( 566, 500 );

Fixed size widgets should be avoided if you possibly can, I'm sure you
know this. gtk has a lot of layout widgets you can use to make
resizeable dialogs.

John
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: printing gtktextview and text layout

2008-04-18 Thread Behdad Esfahbod
On Fri, 2008-04-18 at 17:30 +0200, Philippe Rouquier wrote:
 
 Le mardi 15 avril 2008 à 15:05 -0400, Behdad Esfahbod a écrit : 
  On Sat, 2008-04-12 at 11:08 +0200, Philippe Rouquier wrote:
   
   Could someone help me with that please?
  
  Just reorder your code to use pango_cairo_show_layout() for both display
  and print, then make sure you set font options on your PangoContext
  attached to the layout using pango_cairo_context_set_font_options() to
  turn metrics hinting off (cairo_font_options_set_hint_metrics()).
  
 Hi,
 
 Thanks for your answer.
 I tried and indeed it works: I used a pangolayout (with hinting turned
 off) for display in a widget to reflect what was written in the
 GtkTextView. I noticed the same discrepancies of text layout as when I
 printed. I then printed and the results matched the on screen
 pangolayout.
 
 Now the problem is I want to use and print the GtkTextView. How do I
 turn off hinting in a GtkTextView?
 But maybe I didn't understand you well?

You understood me correctly.  I don't have answers to the rest of your
questions.

 Thanks again.
 
-- 
behdad
http://behdad.org/

Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety.
-- Benjamin Franklin, 1759

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list