@mapka/font-sdf-composite
v0.5.1
Published
Combine glyph (SDF) PBFs on the fly.
Readme
@mapka/font-sdf-composite
Combine glyph (SDF) PBFs on the fly.
This is an re-write of glyph-pbf-composite. There are code left over from the original implementation in form of tests and fixtures.
Install
npm install @mapka/font-sdf-composite
or
yarn add @mapka/font-sdf-compositeUsage
import { combine} from "@mapka/glyph-sdf-composite";
// Without a font stack name
const pbfBuffer1 = combine([
fs.readFileSync("fonts/OpenSans-Regular.pbf"),
fs.readFileSync("fonts/ArialUnicodeMS-Regular.pbf"),
]);
// With a font stack name
const pbfBuffer2 = combine([
fs.readFileSync("fonts/OpenSans-Regular.pbf"),
fs.readFileSync("fonts/ArialUnicodeMS-Regular.pbf"),
], "Open Sans Regular,Arial Unicode MS Regular");
