Re: enumerating available fonts
On 03/18/2009 05:23 PM, Chuck Crisler wrote: That function seems to list 'families' for a given 'font map'. But it seems that you have to have a font map to begin. pango_cairo_font_map_get_default(). behdad I simply want to know all of the fonts on the system, like open office writer. Chuck On Wed, 2009-03-18 at 17:16 -0400, Behdad Esfahbod wrote: On 03/18/2009 05:14 PM, Chuck Crisler wrote: How do I enumerate the fonts available on a system? I suspect XListFonts() may not yield all of the nicer fonts but I haven't been able to find anything promising in Pango. pango_font_map_list_families()? behdad Thank you! Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
re: enumerating available fonts
> How do I enumerate the fonts available on a system? Here's a little function using Gtkmm that I use... vector* LXUtils::GetAllFontNames() { // RETURN a pointer to a static string vector that contains the font names static vector vsFonts; if (vsFonts.empty()) { // Only bother to do this the first time through LXMainWindow* pWind = LXMainWindow::GetAppMainWindow(); // Get Gtk::Window* Glib::RefPtr rPC = pWind->get_pango_context(); Glib::ArrayHandle< Glib::RefPtr > fonts = rPC->list_families(); Glib::Container_Helpers::ArrayHandleIterator > > iFont = fonts.begin(); for (; iFont != fonts.end(); iFont++) { vsFonts.push_back((*iFont)->get_name()); } } return &vsFonts; } -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: enumerating available fonts
That function seems to list 'families' for a given 'font map'. But it seems that you have to have a font map to begin. I simply want to know all of the fonts on the system, like open office writer. Chuck On Wed, 2009-03-18 at 17:16 -0400, Behdad Esfahbod wrote: > On 03/18/2009 05:14 PM, Chuck Crisler wrote: > > How do I enumerate the fonts available on a system? I suspect > > XListFonts() may not yield all of the nicer fonts but I haven't been > > able to find anything promising in Pango. > > pango_font_map_list_families()? > > behdad > > > Thank you! > > Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: enumerating available fonts
On 03/18/2009 05:14 PM, Chuck Crisler wrote: How do I enumerate the fonts available on a system? I suspect XListFonts() may not yield all of the nicer fonts but I haven't been able to find anything promising in Pango. pango_font_map_list_families()? behdad Thank you! Chuck ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list