code: func (f *Fpdf) AddFont(familyStr, styleStr, fileStr string) {
  	if fileStr == "" {
  		fileStr = strings.Replace(familyStr, " ", "", -1) + strings.ToLower(styleStr) + ".json"
  	}
  
  	if f.fontLoader != nil {
  		reader, err := f.fontLoader.Open(fileStr)
  		if err == nil {
  			f.AddFontFromReader(familyStr, styleStr, reader)
  			if closer, ok := reader.(io.Closer); ok {
  				closer.Close()
  			}
  			return
  		}
  	}
  
  	fileStr = path.Join(f.fontpath, fileStr)
  	file, err := os.Open(fileStr)
  	if err != nil {
  		f.err = err
  		return
  	}
  	defer file.Close()
  
  	f.AddFontFromReader(familyStr, styleStr, file)
  }
docs: // AddFont imports a TrueType, OpenType or Type1 font and makes it available.
  // It is necessary to generate a font definition file first with the makefont
  // utility. It is not necessary to call this function for the core PDF fonts
  // (courier, helvetica, times, zapfdingbats).
  //
  // The JSON definition file (and the font file itself when embedding) must be
  // present in the font directory. If it is not found, the error "Could not
  // include font definition file" is set.
  //
  // family specifies the font family. The name can be chosen arbitrarily. If it
  // is a standard family name, it will override the corresponding font. This
  // string is used to subsequently set the font with the SetFont method.
  //
  // style specifies the font style. Acceptable values are (case insensitive) the
  // empty string for regular style, "B" for bold, "I" for italic, or "BI" or
  // "IB" for bold and italic combined.
  //
  // fileStr specifies the base name with ".json" extension of the font
  // definition file to be added. The file will be loaded from the font directory
  // specified in the call to New() or SetFontLocation().