def _HasInk(font, glyph_name):
  """Checks if specified glyph has any ink.

  That is, that it has at least one defined contour associated. Composites are
  considered to have ink if any of their components have ink.

  Args:
    font: A TTFont that has a 'glyf' table.
    glyph_name: The name of the glyph to check for ink.
  Returns:
    True if the font has at least one contour associated with it.
  """
  glyph = font['glyf'].glyphs[glyph_name]
  glyph.expand(font['glyf'])

  if not glyph.isComposite():
    if glyph.numberOfContours == 0:
      return False
    (coords, _, _) = glyph.getCoordinates(font['glyf'])
    # you need at least 3 points to draw
    return len(coords) > 2

  # composite is blank if composed of blanks
  # if you setup a font with cycles you are just a bad person
  for glyph_name in glyph.getComponentNames(glyph.components):
    if _HasInk(font, glyph_name):
      return True

  return False