Support vertical fonts (vmtx / vhea table parsing)
Fixes #618, #726
Description
This adds parsing for vmtx / vhea tables so the library consumer has the necessary information to draw glyphs vertically.
Motivation and Context
It's part of the spec.
How Has This Been Tested?
Tested through canvas drawing with sample fonts. This PR only adds new variables that the user can read. It does not modify existing logic, and thus has a very low chance of regression.
Screenshots (if appropriate):
Sample vertical text rendering via CSS writing-mode: tb-rl in Firefox (expected behavior):
Sample vertical text rendering using opentype.js + canvas (actual behavior).
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] I did
npm run testand all tests passed green (including code styling checks). - [x] I have added tests to cover my changes.
- [x] My change requires a change to the documentation.
- [x] I have updated the README accordingly.
- [x] I have read the CONTRIBUTING document.
Thanks! How did you produce the example images? Don't we need to adapt the drawing functions and the demo pages as well in order to implement a toggle for vertical writing?
First screenshot is using HTML + CSS in Firefox. Second screenshot is using opentype.js glyph draw function and offsetting the Y for each glyph by offsetHeight.
I would like to keep the footprint of this PR small. I'm not trying to cater to all vertical writing use cases, just parse these tables and make the data available.
It isn't merged yet? I really want to use vertical text on opentype.js. This feature would be extremely helpful for my project where I need to work with Japanese vertical text layouts. Is there anything I can do to help get this merged?
It isn't merged yet? I really want to use vertical text on opentype.js. This feature would be extremely helpful for my project where I need to work with Japanese vertical text layouts. Is there anything I can do to help get this merged?
I have been working on the library almost by myself in the past years. Nobody contributing or reviewing has really drained my motivation to provide more of my time. So, help is welcome...
Thank you for your response. It seems there is a non-breaking change and ready to merge.
Nobody contributing or reviewing has really drained my motivation to provide more of my time.
Usually maintainers on a project do code reviews. Are you expecting community members to do reviews? What process do you need to see in place to get out of the slump?