title: PHP - Determine if a glyph exists in a given font
body: <p>I'm looking to see if there is a way, in PHP, to determine if a glyph exists for a given character in a font. </p>
  
  <p>My use case is this - I'm generating small images using Imagick - essentially small "badges" given user-provided info, and I'd really like to support full Unicode, including emoji and whatnot. As of now, I have a handful of fonts that each support a "class" of characters well (e.g., my "main" font is Futura, and I have Symbola for emoji and other symbols, and I may need to add another font for Eastern glyphs), but they don't have enough overlap to only use one font. </p>
  
  <p>I've seen a <a href="http://www.pdflib.com/pdflib-cookbook/fonts/glyph-availability/php-glyph-availability/" rel="nofollow">post</a> that suggests the commercial PDFlib add-on can do this, but I'd like to avoid commercial add-ons if I can. I also saw that the PECL PS add-on has ps_symbol_name(), but this requires an AFM file, and as far as I can tell, I can't use that with multibyte fonts. </p>
  
  <p>I've got the font switching part taken care of in Imagick - I just need to know how I can tell it, programmatically, what font to use for a given character. Thanks!</p>