       defaultHeights["#{fontSize}pt"] = pixels[idx]
     return defaultHeights
   )()
+
   @exDefault: (fontSize) ->
     size =
       width: util.Textsize._defaultWidths[fontSize] or 10

    @_fontSizeCache[key] = size
    size

  # allow chopping up the string
  @fit: (text="", width, height, minfont, opts={}, el) ->
    optsize = @fontSize text, width, height, opts
    nchar = text.length

    

    body = document.getElementsByTagName("body")[0]
    div = document.createElement("span")
    div.textContent = text
    $(div)
      .css(css)
      .attr(css)

    el = body unless el?
    el.appendChild div

    dim = {w: width, h: height}
    size = 10
    n = 0
    while n < 30
      n += 1
      if util.Textsize.larger text, size, dim, div
         if size > 50
           size /= 2
         else
           size -= 1
      else
         if util.Textsize.larger text, size + 1, dim, div
           break
         size += 5

