gofpdf icon indicating copy to clipboard operation
gofpdf copied to clipboard

Improve documentation for AddUTF8Font

Open rickb777 opened this issue 3 years ago • 0 comments

AddUTF8Font appears to have the documentation copied from AddFont. I suggest the following replacement might be an improvement.

// AddUTF8Font imports a TrueType font with utf-8 symbols and makes it available.
// The TTF font file must be present in the font directory, or a subdirectory. If it is 
// not found, an error is set.
//
// familyStr 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.
//
// styleStr 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 name with ".ttf" extension of the font file to be added.
// The file will be loaded from the font directory specified in the call to New()
// or SetFontLocation(). fileStr can include a relative path, meaning the font can
// be loaded from a subdirectory of the font directory.

Also, the other Add..Font methods mention family instead of familyStr, style instead of styleStr.

rickb777 avatar Jun 17 '21 15:06 rickb777