Closed m-abboud closed 8 years ago
Great, thank you! BTW do you have some testing PDF containing the CFF font? I have tested several random files but all of them contain Type 1 or TrueType fonts.
With the TrueType fonts, both Chrome and Firefox complain not to be able to load the embedded font: OTS parsing error: OS/2: missing required table This is what I have already faced during my experiments. Do you have any idea how to solve this?
Yeah see bare-cff.pdf in the commit
For TrueType, looks like strict validation by the browsers don't think OS/2 table is required in ttf spec, but should be simple just to normalize ttf fonts and just jam in an OS/2 table if ones missing I'll do it in a sec
Dump of a bunch of car manual pdfs here: https://drive.google.com/open?id=0B-4Jtn2YkMBxZ2dEcHFGR0dZQlU
And this pdf has like 8 CFFs: https://drive.google.com/open?id=0B-4Jtn2YkMBxeHFFTFJUcjZjUHc (although 2 don't work because of a bug in FontVerter version Pdf2dom is on, I've already fixed it though, need to switch it to snapshots..)
Bumped into ~6 truetype fonts in pdfs I ran and only got unusual cmap table errors in 2 and others fine. Can you send me one of your pdfs with the OS/2 table error?
Added OS/2 table normalization in this branch: https://github.com/m-abboud/Pdf2Dom/tree/normalize-ttfs
Though fixing that issue might just reveal more validation issues with the TTF
Hi, thanks for the conversion. I have given it a try and I was able to convert the following one: BP.pdf However, I obtain a strange message from Firefox: downloadable font: not usable by platform. I have also tried the following two: brno30.pdf and HorariosMadrid_Segovia.pdf but I obtain a null pointer exception somewhere inside FontVerter (different place for each one). I mean the brno30.pdf is especially interesting because of some symbol font used.
Ah so problem is they have type0 fonts with a ttf descendant which means the ttf font is usually incomplete and missing a few tables that have to be created from the parent type0 font data
So I've got that kinda sorta working in latest version here https://github.com/m-abboud/Pdf2Dom/tree/normalize-ttfs
HorariosMadrid_Segovia.pdf only 2 fonts fail validation in FF and chrome
brno30.pdf was all working but I broke something somewhere and now 1 font is failing validation. Also the symbol fonts are usually type bare CFF which FontVerter handles well.
Think I know what the problem is for the 2 fonts in HorariosMadrid_Segovia.pdf, but feeling a little burned out on fonts now lol.
Discussed in issue #7.
This pull request adds handling for Bare CFF fonts with separate font conversion lib and TTF which can be just used as is by browsers and what you did originally in the branch. Other font types are still not supported.