From 98489d64a8d7760bd74e1d76c72b2061add4b754 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Sat, 12 Apr 2014 20:45:42 -0700 Subject: [PATCH] Store the font name --- lib/font.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/font.coffee b/lib/font.coffee index ac23643..b0a7626 100644 --- a/lib/font.coffee +++ b/lib/font.coffee @@ -60,6 +60,7 @@ class PDFFont @dictionary ?= @document.ref() registerTTF: -> + @name = @font.name.postscriptName @scaleFactor = 1000.0 / @font.head.unitsPerEm @bbox = (Math.round e * @scaleFactor for e in @font.bbox) @stemV = 0 # not sure how to compute this for true-type fonts... @@ -172,13 +173,13 @@ class PDFFont end ''' - registerAFM: -> + registerAFM: (@name) -> {@ascender,@decender,@bbox,@lineGap} = @font embedAFM: -> @dictionary.data = Type: 'Font' - BaseFont: @filename + BaseFont: @name Subtype: 'Type1' Encoding: 'WinAnsiEncoding'