MrRio/jsPDF — pull request #23 by dvdotsenko (2012-07-03 20:53:27+00:00)
Title: Font metrics. Font encoding (cp1252). Text sizing and splitting

2 new plugins:

"Standard_Metrics"
- standard fonts metrics (widths, kerning)
- standard fonts now have Unicode-to-Win cp1252 on the fly recoding.
(WinANSI (aka cp1252) is best for display of "Western" accented chars, support Euro sign. Does not clash with Unicode codes. All of the 0-255 chars of cp1252 can now be displayed.)

"split_text"
- * API.splitTextToSize(text, length, options) *
- API.getStringUnitWidth(text, options)
- API.getCharWidthsArray(text, options)

Changes to jsPDF core:
- plugins can now preregister events (added events 'Initializing", "addFont(s)" etc)
(see "metrics" plugin for example of attaching "upon 'new jsPDF' do" events.
- font management code can now deal with many diverse font names.
(preparation for eventual future unicode-ness)
- Unicode is directly supported in document properties and other NON-content strings
- we now do the right thing and chop strings with char codes over 255 into 2-byte-per-char 8bit stream.
(adding Unicode now, will not blow up jsPDF.output(). It will just render semi-trash for the affected string)