   return T.TAG 'path', d: path_txt, fill: '#000'
 
 #-----------------------------------------------------------------------------------------------------------
-@svgfont_from_name_and_glyphs = ( font_name, glyphs ) ->
+@svgfont_from_name_and_glyphs = ( me, font_name, glyphs ) ->
   return T.render =>
     #.........................................................................................................
     T.RAW """<?xml version="1.0" encoding="utf-8"?>\n"""

      glyphs[ cid ]   = [ cid, fallback, ]
      fallback_count += 1
  if fallback_count > 0
    whisper "filled #{fallback_count} positions with fallback outline from #{fallback_source}"
  min_cid_hex = '0x' + min_cid.toString 16
  max_cid_hex = '0x' + max_cid.toString 16
  help "added #{glyph_count} glyph outlines to [ #{min_cid_hex} .. #{max_cid_hex} ]"
  #.........................................................................................................
  glyphs = ( entry for _, entry of glyphs )
  glyphs.sort ( a, b ) ->

    return -1 if a[ 0 ] < b[ 0 ]
    return  0
  #.........................................................................................................
  svgfont = @svgfont_from_name_and_glyphs me.fontname, glyphs
  return @_write_ttf me, svgfont

#-----------------------------------------------------------------------------------------------------------
@_find_origin = ( me ) ->
  unless ( elements = select "//SVG:circle[@id='origin']", me.doc ).length is 1
    throw new Error "^svgttf#409 unable to find element with id `origin`"
  origin = elements[ 0 ]
  me.x0 = parseFloat origin.getAttribute 'cx'
  me.y0 = parseFloat origin.getAttribute 'cy'
  return null

#-----------------------------------------------------------------------------------------------------------
@_write_ttf = ( me, svgfont ) ->
  targetpath = me.targetpath
  ### svg2ttf has a strange API and returns a buffer that isn't a `Buffer`...  ###
  FS.writeFileSync targetpath, new Buffer.from ( svg2ttf svgfont ).buffer
  help "^svgttf#7120^ output written to #{targetpath}"


#===========================================================================================================
