Commit Graph

17 Commits

Author SHA1 Message Date
Eliot Jones
28faf1c22c default to .notdef for type 2 charstrings
if the glyph with a specific name isn't found in the set of type 2 charstrings we default to using the .notdef glyph if present.
2020-02-21 10:37:58 +00:00
Eliot Jones
29061b1fd2 handle unexpected adobe type 1 format
an encoding array in an adobe type 1 font may be missing its declaration ending in 'for', if we encounter 'dup' while looking for the 'for' token we have a special case to go straight into reading the encoding.

also handles a case where the page content stream contains a path-closing operator without any path being active.
2020-01-28 16:05:53 +00:00
Eliot Jones
d9492ab2f8 handle empty encrypted portion in adobe type 1 font
the encrypted portion of an adobe type 1 font can be empty in which case we default to a blank private dictionary and charstrings set.
2020-01-25 16:41:54 +00:00
Eliot Jones
736f83e227 handle null charstring names
it appears charstring definitions in adobe type 1 fonts can omit the charstring name. in this case we set the name to the string value of the charstring index.
2020-01-25 16:35:08 +00:00
Eliot Jones
a496daf0ce ignore hflex when calculating hint bytes
hflex and hflex1 should not count towards the hint byte count for a hintmask operator in type 2 charstrings.
2020-01-08 13:27:33 +00:00
Eliot Jones
d267d7501a use encoding specified in base font if present
if the font uses a named encoding which is not recognised, use the corresponding encoding based on the base font name, or fall back to windows ansi encoding.
2020-01-07 16:01:45 +00:00
Eliot Jones
fc9c1b6ff5 add method to retrieve single glyph bounds from truetype
this improves performance since we only need to load a single rectangle rather than the entire glyphs array including all points.
2020-01-06 14:43:51 +00:00
Eliot Jones
09c72a2fb2 handle 0 length gylph in true type font 2020-01-06 14:12:46 +00:00
Eliot Jones
02f9166c00 use lazy loading for glyph data
glyph data in TrueType fonts can be very large and slow to parse. to avoid this we store the raw table data at parsing time and enable lazy loading of glyph descriptions.
2020-01-05 15:42:23 +00:00
Eliot Jones
e0a45e3774 include dependencies as dlls in the published nuget
by default nuget pack does not include project dependencies. this is suboptimal since it would require managing at least 5 nuget packages. this uses a workaround detailed here https://github.com/nuget/home/issues/3891 to copy the dependent dlls to the generated nuget package. this doesn't resolve the issue of how we publish the documentlayoutanalysis project, since it is the top of the dependency tree and we publish its parent, rather than it.
2020-01-05 13:56:14 +00:00
Eliot Jones
e1b39983d0 handle missing encodings in cff fonts 2020-01-05 13:16:31 +00:00
Eliot Jones
b29354e3e6 move compact font format fonts to fonts project 2020-01-05 12:08:01 +00:00
Eliot Jones
bbde38f656 move tokenizers to their own project
since both pdfs and Adobe Type1 fonts use postscript type objects, tokenization is needed by the main project and the fonts project
2020-01-05 10:40:44 +00:00
Eliot Jones
d09b33af4d move tokens to new project 2020-01-05 10:07:01 +00:00
Eliot Jones
a6541f1cfc fix test references
update references for unit tests to reference new core and fonts projects. all tests except the public api scanner tests now run successfully.
2020-01-04 22:56:41 +00:00
Eliot Jones
74774995d6 complete move of truetype, afm and standard14 fonts
the 3 font types mentioned are moved to the new fonts project, any referenced types are moved to the core project. most truetype classes are made public #8.
2020-01-04 22:39:13 +00:00
Eliot Jones
7c0ef111ea move classes to new projects
to make the project more useful and expose more usable classes we're rearchitecting in the following way. code used to read fonts from external file formats like truetype, adobe font metrics (afm) and adobe type 1 fonts are moving to a new project which doesn't reference most of the pdf logic. the shared logic is moving to a new flat-structured project called core. this is a sort-of onion type architecture, with core being the... core, fonts being the next layer of the onion, pdfpig itself the next. this will then support additional libraries/projects as outer layers of the onion as well as releasing standalone version of the font library as pdfbox does with fontbox.
2020-01-04 16:38:18 +00:00