diff options
author | Kurt Jung <kurt.w.jung@gmail.com> | 2015-08-22 07:33:53 -0400 |
---|---|---|
committer | Kurt Jung <kurt.w.jung@gmail.com> | 2015-08-22 07:33:53 -0400 |
commit | e3a6324d33873b0347a190bfb82d7d04315c1c85 (patch) | |
tree | c49e43d6f7e9b03c4fb23684d0f57a2252c519c8 | |
parent | 1800f941981bc8ffc3229ba79304ca76974767de (diff) |
Clarify restrictions on OpenType fonts, namely that they must be derived from TrueType outlines, not PostScript
-rw-r--r-- | font.go | 11 | ||||
-rw-r--r-- | makefont/makefont.go | 10 |
2 files changed, 16 insertions, 5 deletions
@@ -374,10 +374,13 @@ func makeDefinitionFile(fileStr, tpStr, encodingFileStr string, embed bool, encL // gofpdf generates. See the makefont utility in the gofpdf package for a // command line interface to this function. // -// fontFileStr is the name of the TrueType (or OpenType based on TrueType, -// extension .ttf) or binary Type1 file (extension .pfb) from which to generate -// a definition file. If a Type1 file is specified, a metric file with the same -// pathname except with the extension .afm must be present. +// fontFileStr is the name of the TrueType file (extension .ttf), OpenType file +// (extension .otf) or binary Type1 file (extension .pfb) from which to +// generate a definition file. If an OpenType file is specified, it must be one +// that is based on TrueType outlines, not PostScript outlines; this cannot be +// determined from the file extension alone. If a Type1 file is specified, a +// metric file with the same pathname except with the extension .afm must be +// present. // // encodingFileStr is the name of the encoding file that corresponds to the // font. diff --git a/makefont/makefont.go b/makefont/makefont.go index d3ea19f..eb2993e 100644 --- a/makefont/makefont.go +++ b/makefont/makefont.go @@ -14,7 +14,15 @@ func errPrintf(fmtStr string, args ...interface{}) { func showHelp() { errPrintf("Usage: %s [options] font_file [font_file...]\n", os.Args[0]) flag.PrintDefaults() - errPrintf("Example: %s --embed --enc=../font/cp1252.map --dst=../font calligra.ttf /opt/font/symbol.pfb\n", os.Args[0]) + fmt.Fprintln(os.Stderr, "\n"+ + "font_file is the name of the TrueType file (extension .ttf), OpenType file\n"+ + "(extension .otf) or binary Type1 file (extension .pfb) from which to\n"+ + "generate a definition file. If an OpenType file is specified, it must be one\n"+ + "that is based on TrueType outlines, not PostScript outlines; this cannot be\n"+ + "determined from the file extension alone. If a Type1 file is specified, a\n"+ + "metric file with the same pathname except with the extension .afm must be\n"+ + "present.") + errPrintf("\nExample: %s --embed --enc=../font/cp1252.map --dst=../font calligra.ttf /opt/font/symbol.pfb\n", os.Args[0]) } func tutorialSummary(f *gofpdf.Fpdf, fileStr string) { |