code: function(key, value) {
          if (arguments.length === 1) {
              //if just the key, return the value
              if (typeof key === "string") {
                  return this._textFont[key];
              }
  
              if (typeof key === "object") {
                  for (var propertyKey in key) {
                      if (propertyKey === "family") {
                          this._textFont[propertyKey] =
                              "'" + key[propertyKey] + "'";
                      } else {
                          this._textFont[propertyKey] = key[propertyKey];
                      }
                  }
              }
          } else {
              this._textFont[key] = value;
          }
  
          if (this.has("Canvas")) this._resizeForCanvas();
  
          this.trigger("Invalidate");
          return this;
      }
docs: @
  #.textFont
  @comp Text
  @kind Method
  
  @triggers Invalidate
  @sign public this .textFont(String key, * value)
  @param key - Property of the entity to modify
  @param value - Value to set the property to
  
  @sign public this .textFont(Object map)
  @param map - Object where the key is the property to modify and the value as the property value
  
  Use this method to set font property of the text entity.  Possible values are: type, weight, size, family, lineHeight, and variant.
  
  When rendered by the canvas, lineHeight and variant will be ignored.
  
  @example
  ~~~
  Crafty.e("2D, DOM, Text").textFont({ type: 'italic', family: 'Arial' });
  Crafty.e("2D, Canvas, Text").textFont({ size: '20px', weight: 'bold' });
  
  Crafty.e("2D, Canvas, Text").textFont("type", "italic");
  Crafty.e("2D, Canvas, Text").textFont("type"); // italic
  ~~~