Mihai Bazon
e61366b37f
Fix reading cmap table
...
The data offset must be saved before parsing one entry and restored
thereafter. Otherwise only the first table is parsed properly, and garbage
is returned for the rest. Fails on i.e. georgiai.ttf.
When reading the glyphIds, divide count by 2 (we read 16-bit words).
2014-08-16 11:50:52 +03:00
Devon Govett
735cecb1f6
Add support for loading fonts from Uint8Array or ArrayBuffer
2014-08-10 11:02:20 -04:00
Devon Govett
65f40376cd
Merge branch 'master' into fontkit
...
Conflicts:
lib/font.coffee
2014-08-10 10:56:30 -04:00
Devon Govett
1241997715
Refactor font loading code and add support for ArrayBuffers
2014-07-29 09:42:48 -07:00
Aaron Fischer
c2c61bb2e2
added support for add font as Uint8Array
2014-07-29 09:15:39 -07:00
Devon Govett
0d882e0ef0
Remove old font parsing library
2014-07-19 12:51:38 -07:00
Devon Govett
f76f25bbd8
Remove unneeded import
2014-07-19 12:43:20 -07:00
Devon Govett
e58a7ce809
Formatting
2014-07-14 20:48:00 -07:00
jkol
64df00fa13
Added "valign" option to image "fit" scaling
...
valign can be set to "center" or "bottom" now and when "valign" === "center" is combined with "align" === "center" any aspect ratio image can be centered into a bounding area.
2014-07-14 18:23:11 -05:00
Devon Govett
8e10736ad6
Add kerning support for standard PDF fonts by parsing data in AFM files
2014-07-06 00:16:23 -07:00
Devon Govett
67b0d8da19
Add kerning support for embedded fonts
2014-07-06 00:15:59 -07:00
Devon Govett
163562c50a
Add support for kerning data to the text mixin
2014-07-06 00:15:31 -07:00
Devon Govett
0c5f818e23
Split PDFFont class into separate subclasses for embedded and standard fonts
2014-07-06 00:03:12 -07:00
Devon Govett
ac32a9316d
Add support for OpenType/CFF embedding and subsetting
2014-07-03 18:58:27 -07:00
Devon Govett
4ce53698c0
Replace font engine with new fontkit module
2014-07-03 18:57:36 -07:00
Devon Govett
6a2c306680
Don't include newlines in text fragments
2014-07-03 14:58:50 -07:00
Devon Govett
c81222fc99
Make PDFReference an actual Node stream so we can pipe stuff to it
2014-07-03 11:53:37 -07:00
Ryan Wersal
c77add8f56
Remove text state handling as it doesn't surive graphic stack saves/restores
...
Saving and/or restoring the graphics state causes each text object to have to
reinitialize that text state. As a result, the mode/characterSpacing commands
would not get re-added until their value(s) had changed.
2014-05-10 01:11:06 -05:00
Ryan Wersal
aadc589a62
Improve sizing of text underline
2014-05-09 00:05:17 -05:00
Ryan Wersal
acc0a2e4ba
Use a regex to capture the base64 encoded string
2014-05-06 00:43:02 -05:00
Ryan Wersal
2b34173dec
Add ability to add base64 URI images
2014-05-05 22:47:33 -05:00
Devon Govett
a6f6f4df8a
Don't use trimRight since it isn't supported in IE
2014-04-14 09:58:26 -07:00
Devon Govett
6e447cae7a
Don't embed fonts that haven't been referenced
2014-04-13 19:54:18 -07:00
Devon Govett
22499ee4bd
Include a static list of standard fonts so they can be included by browserify/brfs
2014-04-12 20:48:29 -07:00
Devon Govett
78946e97fc
Rework mixin so it can be statically compiled by browserify
2014-04-12 20:47:54 -07:00
Devon Govett
98489d64a8
Store the font name
2014-04-12 20:45:42 -07:00
Devon Govett
4b8b031188
Don't embed fonts until they are actually used
2014-04-12 20:45:15 -07:00
Devon Govett
bb9b77cb82
Allow loading fonts from Buffers in addition to filenames
2014-04-12 20:44:19 -07:00
Devon Govett
801981728c
Make AFMFont.open different from constructor
2014-04-12 20:35:14 -07:00
Devon Govett
8c51ee077f
Make sure that sfnt key exists in dfont so we don't throw random errors
2014-04-09 23:44:31 -07:00
Devon Govett
f463512b2f
Don't embed fonts more than once
2014-04-09 23:41:40 -07:00
Devon Govett
87fd69b7e5
Don't overwrite cmap method
2014-04-09 23:41:06 -07:00
Devon Govett
ae28782eb1
Fix writing indexed PNG palettes
2014-04-09 09:51:59 -07:00
Devon Govett
876db9e067
Don't set the Length key on images. It will be set by the PDFReference class automatically
2014-04-09 09:51:43 -07:00
Devon Govett
665fd935ef
Make loading images from buffers way faster by not converting to a string inadvertently
2014-04-06 19:19:17 -07:00
Devon Govett
8eece7e9ea
Make sure heightOfString doesn't break pages
2014-03-29 20:36:10 -07:00
Devon Govett
c72b50927c
Add heightOfString method that uses the line wrapper without actually adding content to the document.
...
Very useful for layout purposes
2014-03-29 20:22:21 -07:00
Devon Govett
cf564ac3da
Fixes for text justification
2014-03-29 19:56:36 -07:00
Devon Govett
16e00aa9e2
Allow setting compress option from constructor
2014-03-29 19:45:41 -07:00
Devon Govett
0907968905
Don't store all objects in memory, just offsets once they are written
2014-03-23 18:16:42 -07:00
Devon Govett
f6c4b2c226
Free memory after embedding images
2014-03-23 17:37:13 -07:00
Devon Govett
b570ac219e
Simplify image loading
2014-03-23 17:31:07 -07:00
Devon Govett
f8a40dba76
Make PDFDocument a node stream
2014-03-23 17:11:48 -07:00
Devon Govett
1305a9592a
Switch to 2 space indentation
2014-03-23 12:25:09 -07:00
Devon Govett
fda5b400e6
Another path parser fix
2014-02-25 00:42:25 -08:00
Devon Govett
06e6419533
Handle reused commands in path parser for last command
2014-02-25 00:08:41 -08:00
Devon Govett
67e6640b92
Fix bug in path parser
2014-02-24 23:44:50 -08:00
Devon Govett
350863bfda
Fix the ellipse method
2014-02-24 23:25:41 -08:00
Devon Govett
c1319acff8
Allow 0 opacities
2014-02-24 01:09:27 -08:00
Devon Govett
4257e69e07
Fix typo
2014-02-19 12:02:57 -08:00