code: def _component_closest_to_origin(components, glyph_set):
      
      return min(components, key=lambda comp: _distance((0, 0), _bounds(comp, glyph_set)))
docs: Return the component whose (xmin, ymin) bounds are closest to origin.
  
      This ensures that a component that is moved below another is
      actually recognized as such. Looking only at the transformation
      offset can be misleading.