We are happy to have others contribute to the development of this library. It is currently in its infancy. Please check out the ROADMAP.md for ideas on how you can add functionality. We welcome additional ideas as well.
The variableFont.js libary source is written in TypeScript. It is located in the src directory.
TypeScript is available on npm at https://www.npmjs.com/package/typescript
First install Node.js which will by default include npm. Then, install the project dependencies, including the TypeScript compiler, using following command:
npm installDon’t edit the variableFont.js file directly. It is generated using the TypeScript compiler, tsc. You can rebuild the file yourself by running the following command:
npm run buildThis is a shortcut to running the build script defined in the package.json file. You can manually run it with:
npx tsc --project ./src/tsconfig.jsonThe output file is variablefont.js in the root folder.
-
On our GitHub page, click the "Fork" button to create your personal fork of the variableFont.js repository.
-
Clone your repository:
git clone git://github.com/Monotype/variableFont.js.git
-
Create a new branch for your feature. For example:
git checkout -b newfeature. A dedicated branch for your pull request means you can develop multiple features at the same time, and ensures that your pull request is stable even if you later decide to develop an unrelated feature. -
Install dependencies:
npm install-
Make some changes to the source files in
src -
Build variableFont.js
npm run build
The output file is variablefont.js in the root folder.
-
Test your changes in the demo program. Modify it if needed.
-
Commit your changes
git add --all && git commit
-
Submit your pull request -- and thanks in advance!
This project has a hard dependency on opentype.js. Please follow instruction on the opentype.js site to include it in your page. Opentype.js must be included before including variableFont.js in an html page. variableFont.js functions depend on opentype.js.
Some feature changes may be more appropriately made in opentype.js. If so, consider contributing to that project.