Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fontkit #534

Merged
merged 32 commits into from Aug 26, 2016
Merged

fontkit #534

merged 32 commits into from Aug 26, 2016

Conversation

devongovett
Copy link
Member

This PR has been a long time coming. Switches the font engine from an internal one to fontkit, an advanced text shaping engine I've been working on for a while. For PDFKit, this means the following features and improvements:

  • Support for OpenType (CFF), WOFF, and WOFF2 fonts. Previously PDFKit only supported TTF, DFont, and TTC fonts.
  • Support for advanced text layout features, including ligatures, kerning, and other advanced glyph substitutions and positioning adjustments.
  • Support for OpenType GSUB and GPOS tables, and script specific shapers (currently Arabic and Hangul shapers are included).
  • Support for Apple Advanced Typography (morx) substitutions.
  • Support for kerning built-in PDF fonts using data from AFM files.
  • Support for vertical positioning adjustments, e.g. for accents on non-composite glyphs.
  • Fonts are now embedded as CID fonts, meaning support for large character sets like CJK scripts is much improved.

PDFKit's API remains almost exactly the same, the changes are entirely under the covers. The only addition is a new features option to the doc.text method, which can be used to apply custom OpenType features to the text. If given, it should be an array of OpenType feature tags. Most of the time, this is unnecessary as the script shaper will automatically apply required features.

devongovett and others added 30 commits July 3, 2014 11:53
Conflicts:
	lib/font.coffee
Conflicts:
	lib/font/table.coffee
	lib/font/tables/cmap.coffee
	lib/font/tables/glyf.coffee
	lib/font/tables/head.coffee
	lib/font/tables/hhea.coffee
	lib/font/tables/hmtx.coffee
	lib/font/tables/loca.coffee
	lib/font/tables/maxp.coffee
	lib/font/tables/name.coffee
	lib/font/tables/os2.coffee
	lib/font/tables/post.coffee
Conflicts:
	lib/font/tables/name.coffee
	lib/font/ttf.coffee
These offsets are generated by fontkit when laying out glyphs, for example accents which should appear above other glyphs. To render them correctly in PDF, we have to break out of the TJ command and move the text position manually.
Now fontkit branch should be functional
Fixing typo which make tests fail
For generating pdf guide.
@devongovett devongovett merged commit 4af1310 into master Aug 26, 2016
@devongovett devongovett deleted the fontkit branch August 26, 2016 17:15
@devongovett
Copy link
Member Author

Released to npm in v0.8.0! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants