Store the font name

This commit is contained in:
Devon Govett 2014-04-12 20:45:42 -07:00
parent 4b8b031188
commit 98489d64a8

View File

@ -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'