code: func TtfParse(fileStr string) (TtfRec TtfType, err error) {
  	var t ttfParser
  	t.f, err = os.Open(fileStr)
  	if err != nil {
  		return
  	}
  	version, err := t.ReadStr(4)
  	if err != nil {
  		return
  	}
  	if version == "OTTO" {
  		err = fmt.Errorf("fonts based on PostScript outlines are not supported")
  		return
  	}
  	if version != "\x00\x01\x00\x00" {
  		err = fmt.Errorf("unrecognized file format")
  		return
  	}
  	numTables := int(t.ReadUShort())
  	t.Skip(3 * 2) // searchRange, entrySelector, rangeShift
  	t.tables = make(map[string]uint32)
  	var tag string
  	for j := 0; j < numTables; j++ {
  		tag, err = t.ReadStr(4)
  		if err != nil {
  			return
  		}
  		t.Skip(4) // checkSum
  		offset := t.ReadULong()
  		t.Skip(4) // length
  		t.tables[tag] = offset
  	}
  	err = t.ParseComponents()
  	if err != nil {
  		return
  	}
  	t.f.Close()
  	TtfRec = t.rec
  	return
  }
docs: // TtfParse extracts various metrics from a TrueType font file.