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

Re: Grepping fonts for a specific glyph



On 01/28/2010 08:32 AM, Dotan Cohen wrote:
I need to know which of my installed fonts have glyphs for a specific
Unicode character (U+05D0). How can I do that?

This is part of a function using GTK+/Pango that checks for presence of glyphs:

  PangoContext         *context;
  PangoFontDescription *fontdesc;
  PangoFont            *font;
  PangoCoverage        *coverage;

  context = gtk_widget_get_pango_context(GTK_WIDGET(gui->txtView));
  fontdesc = pango_font_description_from_string(gui->world->terminalfont);
  font = pango_context_load_font(context, fontdesc);
  coverage = pango_font_get_coverage(font,
                                     pango_context_get_language(context));

  /* U+25C6 BLACK DIAMOND */
  gui->ta.sup_geom_shapes   = pango_coverage_get(coverage, 0x25C6);

  pango_font_description_free(fontdesc);
  pango_coverage_unref(coverage);


Figuring out how to make a complete program out of it is left as an exercise to the reader.

--
The college graduate is presented with a sheepskin to cover his
intellectual nakedness.
		-- Robert M. Hutchins

Eduardo M KALINOWSKI
eduardo@kalinowski.com.br


Reply to: