Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@thi.ng/webgl-msdf

0.1.62 • Public • Published

webgl-msdf

npm version npm downloads Twitter Follow

This project is part of the @thi.ng/umbrella monorepo.

About

Multi-channel SDF font rendering & basic text layout for WebGL. This is a support package for @thi.ng/webgl.

This package provides multi-channel SDF font rendering capabilities for @thi.ng/webgl, incl. optional support for basic text alignment, vertex colors (e.g. for multi-color text), and shader options to draw outlines for each character. Furthermore, the key GLSL functions are provided as shader snippets to embed this functionality in custom shaders without having to resort to copy & paste.

There're different versions of MSDF font generators. The format supported by this module is based on Don McCurdy's.

Status

STABLE - used in production

Search or submit any issues for this package

Installation

yarn add @thi.ng/webgl-msdf
// ES module
<script type="module" src="https://unpkg.com/@thi.ng/webgl-msdf?module" crossorigin></script>
 
// UMD
<script src="https://unpkg.com/@thi.ng/webgl-msdf/lib/index.umd.js" crossorigin></script>

Package sizes (gzipped, pre-treeshake): ESM: 1.48 KB / CJS: 1.52 KB / UMD: 1.59 KB

Dependencies

Usage examples

Several demos in this repo's /examples directory are using this package.

A selection:

Screenshot Description Live demo Source
WebGL MSDF text rendering & particle system Demo Source

API

Generated API docs

TODO

Authors

Karsten Schmidt

License

© 2019 - 2020 Karsten Schmidt // Apache Software License 2.0

Install

npm i @thi.ng/webgl-msdf

DownloadsWeekly Downloads

146

Version

0.1.62

License

Apache-2.0

Unpacked Size

54.8 kB

Total Files

18

Last publish

Collaborators

  • avatar