Skip to content

Commit a3e2328

Browse files
committed
Merge pull request parallax#475 from chip/master
Add addFont function to Public API
2 parents aaafe1d + 4ef07d4 commit a3e2328

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

jspdf.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,21 @@ var jsPDF = (function(global) {
15811581
return list;
15821582
};
15831583

1584+
/**
1585+
* Add a custom font.
1586+
*
1587+
* @param {String} Postscript name of the Font. Example: "Menlo-Regular"
1588+
* @param {String} Name of font-family from @font-face definition. Example: "Menlo Regular"
1589+
* @param {String} Font style. Example: "normal"
1590+
* @function
1591+
* @returns the {fontKey} (same as the internal method)
1592+
* @methodOf jsPDF#
1593+
* @name addFont
1594+
*/
1595+
API.addFont = function(postScriptName, fontName, fontStyle) {
1596+
addFont(postScriptName, fontName, fontStyle, 'StandardEncoding');
1597+
};
1598+
15841599
/**
15851600
* Sets line width for upcoming lines.
15861601
*

0 commit comments

Comments
 (0)