summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@code.google.com>2014-04-12 08:39:49 -0400
committerKurt Jung <kurt.w.jung@code.google.com>2014-04-12 08:39:49 -0400
commite1bcc7e26babddc80e209b9ce9cb283ef6fa3e33 (patch)
treec783a8a5d3c64aba77977498dc751bcb8b3d7607
parent8db660217be19062ca07e99cfa8a97affa86c49c (diff)
Removed unused argument from AddFontFromReader
-rw-r--r--fpdf.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/fpdf.go b/fpdf.go
index fa17721..8b4e452 100644
--- a/fpdf.go
+++ b/fpdf.go
@@ -1220,28 +1220,26 @@ func (f *Fpdf) AddFont(familyStr, styleStr, fileStr string) {
}
defer file.Close()
- f.AddFontFromReader(familyStr, styleStr, fileStr, file)
+ f.AddFontFromReader(familyStr, styleStr, file)
}
-func (f *Fpdf) AddFontFromReader(familyStr, styleStr, fileStr string, r io.Reader) {
+// AddFontFromReader imports a TrueType, OpenType or Type1 font and makes it
+// available using a reader that satisifies the io.Reader interface. See
+// AddFont for details about familyStr and styleStr.
+func (f *Fpdf) AddFontFromReader(familyStr, styleStr string, r io.Reader) {
if f.err != nil {
return
}
// dbg("Adding family [%s], style [%s]", familyStr, styleStr)
var ok bool
familyStr = strings.ToLower(familyStr)
- if fileStr == "" {
- fileStr = strings.Replace(familyStr, " ", "", -1) + strings.ToLower(styleStr) + ".json"
- }
styleStr = strings.ToUpper(styleStr)
if styleStr == "IB" {
styleStr = "BI"
}
fontkey := familyStr + styleStr
- // dbg("fontkey [%s]", fontkey)
_, ok = f.fonts[fontkey]
if ok {
- // dbg("fontkey found; returning")
return
}
var info fontDefType
@@ -1250,7 +1248,6 @@ func (f *Fpdf) AddFontFromReader(familyStr, styleStr, fileStr string, r io.Reade
return
}
info.I = len(f.fonts)
- // dbg("font [%s], I [%d]", fileStr, info.I)
if len(info.Diff) > 0 {
// Search existing encodings
n := -1