Re: Non-ascii characters break Cairo's show_text

Ari Jolma wrote:
The remaining problem is that I was not able to easily get the
$layout->set_font_description working to set the font from I get from
the FontSelectionDialog. BTW, I find parsing what it returns in
get_font_name difficult.

You shouldn't need to parse anything.  gtk_font_selection_get_font_name()
creates its result by calling pango_font_description_to_string(), so on your
end it should be as simple as

  $font_name = $font_selection->get_font_name ();
  $font_desc = Gtk2::Pango::FontDescription->from_string ($font_name);
  $layout->set_font_description ($font_desc);

(Disclaimer: i'm going only from code and docs, i haven't tried it.)

muppet <scott at asofyet dot org>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]