Javascript library for reading RISC OS Draw, Font, and Sprite files.
npm install git+https://git@github.com/RichardBrown384/riscos-file-formats-js.gitTo use in code
const {Draw, Sprite, FontOutlines} = require('riscos-file-formats'); const draw = Draw.fromUint8Array(array); const sprite = Sprite.fromUint8Array(array); const outlines = FontOutlines.fromUint8Array(array);The library has some scripts that can be used convert files into either SVG or PNG.
To convert a Draw file to SVG you can use the following,
npm run draw:svg drawfile,aff drawfile.svg To convert a Font Outlines file to SVG you can use the following,
npm run font:outline:svg outlines,ff6 outlines.svgTo convert a Sprite file to PNGs you can use the following,
npm run sprite:png sprites,ff9The library is provided on an as-is basis.