new Font( [params])
A class representing a PDF font.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
params |
object |
<optional> |
An object containing parameters to be initialised on the font. |
Properties:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
name |
string | The font's name | ||
size |
number |
<optional> |
0 | The font's size |
type |
string |
<optional> |
'Type1' | The font's type (One of CIDType0, CIDType2, MMType1, TrueType, Type0, Type1, Type3) |
strokeColor |
Core.Annotations.Color | array | object |
<optional> |
new Core.Annotations.Color([0,0,0]) | The font's stroke color |
fillColor |
Core.Annotations.Color | array | object |
<optional> |
new Core.Annotations.Color([0,0,0]) | The font's fill color |
calculatedSize |
number | The calculated size of the font if size is 0 |
Methods
-
isBlack()
-
Is the font solid black?
Returns:
Whether the font is solid black- Type
- boolean
-
set(options)
-
Set all properties on Font using a Font or a Font-like object.
Parameters:
Name Type Description options
Core.Annotations.Font | object The options to set on the Font -
toCSS(zoom)
-
Convert the font to a CSS object like one would pass to jQuery.css().
Parameters:
Name Type Description zoom
number Returns:
An object appropriate to pass to jQuery.css()- Type
- object