{"_id":"@etpinard/gl-text","_rev":"1-073acab11a7bc29908401e1187c5cae0","name":"@etpinard/gl-text","dist-tags":{"latest":"1.1.6"},"versions":{"1.1.6":{"name":"@etpinard/gl-text","version":"1.1.6","description":"Render text with WebGL","main":"dist.js","scripts":{"test":"budo --force-default-index test","build":"buble index.js > dist.js","prepublish":"npm run build","build-demo":"browserify test.js -g bubleify | indexhtmlify | metadataify | github-cornerify | mobilify > index.html"},"repository":{"type":"git","url":"git+https://github.com/a-vis/gl-text.git"},"keywords":["regl","plotly","text","gl-text","typography","font"],"browserify":{},"author":{"name":"Dmitry Yv","email":"df.creative@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/a-vis/gl-text/issues"},"homepage":"https://github.com/a-vis/gl-text#readme","dependencies":{"color-normalize":"^1.1.0","css-font":"^1.2.0","detect-kerning":"^2.1.2","es6-weak-map":"^2.0.2","flatten-vertex-data":"^1.0.2","font-atlas":"^2.1.0","font-measure":"^1.2.2","gl-util":"^3.0.7","is-plain-obj":"^1.1.0","object-assign":"^4.1.1","parse-rect":"^1.2.0","parse-unit":"^1.0.1","pick-by-alias":"^1.2.0","regl":"^1.3.6","to-px":"^1.0.1","typedarray-pool":"^1.1.0"},"devDependencies":{"buble":"^0.19.3","fps-indicator":"^1.2.1","multi-regl":"^1.1.1","pan-zoom":"^3.1.0","raf":"^3.4.0","tape":"^4.9.0"},"gitHead":"23d6aaf9ad75e52bf6aca3bf5095573027dcd6db","_id":"@etpinard/gl-text@1.1.6","_npmVersion":"5.8.0","_nodeVersion":"8.11.1","_npmUser":{"name":"etpinard","email":"etienne.t.pinard@gmail.com"},"dist":{"integrity":"sha512-sN007FwlqdSKJt2/cnGZu3jsAN7G4R/wxk/D6ZivPuQtrwJ42B68iuAqysJPgFepUTAsDRtGAOd1U7tZxfDJwA==","shasum":"985791e31ef5ae591a2fd8d4401de64d34080196","tarball":"https://registry.npmjs.org/@etpinard/gl-text/-/gl-text-1.1.6.tgz","fileCount":9,"unpackedSize":56267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbPmnnCRA9TVsSAnZWagAADmsP+wWXW8O3mtbUPV3uEEyg\nazwZf9z0IjSUQ0LdwYyA3DJPjMXpWnnHh++pFvOV19KZceaqaMNj9Fslz34z\no2LwG8Uxn1NM/nDaWdgk8mib70Px9M4jJ8cZ93i73otuxw+UZdPW+Jse18+O\nVNg9zKYm9vPZSa3BYR73sEbAGEeMJVvgk2yPNqxPf6OX2wOL/nFq2MlCEhxQ\nQIr4ux1c+3XtbVnx5zIpqaSnTb+hoHIpoJWcIpnjqjJEC18Prw22idIIa6JZ\nVhB38fB8dt9sa5B3+fbSOfEl85DJ+oJ+j0hpzE94+adh9nFuyBSH846MlR5K\ncttUA+vxLVTiJ2OHt5QuLC7/wS5RYxSZlpnrW6a97LH2G8xuiSbIWuxqJbpu\nOT5Iog5zLDCBklz3aSH/TB1EBf5fVB+5EnprWFAfedbyeXLvh2g/u8YXFAh1\n+9NmlTdTYG6lVZyre5GDfeur+aGuZj6AzQ8VKGegv86qzc1E6L/7NkFE2JJs\n5fAwBcmsKkcaQ5/6gr6zROYFfqnbhobz/75kgJTzVoGUrp2pqjxZhMTaMk0v\nxlcqEg2g7iJ2OOqo8p2akAe7wNjpG+AXajpoxi6peGMThVsCIO55GSAGr+E0\nbGDxl58R/H+rDFeZlICWpKZatFQWDxV+xZUtPydxkYmLzXaLwwiEzRLzUAj7\nhm+m\r\n=zYv9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/ZrikPI0hYhP/kJ07NYMHRwE2e4eaJdXjzJ5rf10KEwIhAPglFWN3lzvQRXo1ZXw9O5qkNnxN9FT2DedimFd8O38V"}]},"maintainers":[{"name":"etpinard","email":"etienne.t.pinard@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gl-text_1.1.6_1530816999670_0.5634898186584463"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-05T18:56:39.417Z","1.1.6":"2018-07-05T18:56:39.722Z","modified":"2022-04-05T08:26:46.206Z"},"maintainers":[{"name":"etpinard","email":"etienne.t.pinard@gmail.com"}],"description":"Render text with WebGL","homepage":"https://github.com/a-vis/gl-text#readme","keywords":["regl","plotly","text","gl-text","typography","font"],"repository":{"type":"git","url":"git+https://github.com/a-vis/gl-text.git"},"author":{"name":"Dmitry Yv","email":"df.creative@gmail.com"},"bugs":{"url":"https://github.com/a-vis/gl-text/issues"},"license":"MIT","readme":"# gl-text [![unstable](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges)\n\nRender bitmap text with WebGL.\n\n## Usage\n\n[![npm install gl-text](https://nodei.co/npm/gl-text.png?mini=true)](https://npmjs.org/package/gl-text/)\n\n```js\nconst Text = require('gl-text')\n\nlet text1 = new Text()\n\ntext1.update({\n\tposition: [50, 50],\n\ttext: 'ABC',\n\tfont: '16px Helvetica, sans-serif'\n})\ntext1.render()\n\n// create another text renderer on the same context\nlet text2 = new Text(text1.gl)\ntext2.update({\n\tfont: {\n\t\tfamily: ['Helvetica', 'Arial', 'sans-serif'],\n\t\tsize: '1rem'\n\t}\n})\n```\n\n## API\n\n### `let text = new Text(gl|regl|canvas|container|options?)`\n\nCreate text renderer instance for the WebGL context `gl`, [`regl`](https://ghub.io/regl) instance, `canvas`/`container` element or based on `options`:\n\nOption | Meaning\n---|---\n`regl` | Existing `regl` instance. By default new one is created.\n`gl`/`context` | Existing WebGL context. By default new one is created.\n`canvas` | Existing `canvas` element.\n`container` | Existing `container` element. By default new canvas is created within the container.\n\nNo arguments call creates new fullscreen canvas.\n\n### `text.update(options)`\n\nUpdate state of a `Text` instance.\n\nOption | Description\n---|---\n`text` \t\t\t| Text string or array of strings to display.\t\t\t\t\t\t\t\t|\n`position` \t\t| Position of the text on the screen within the `range`, a couple `[x, y]` or array `[[x ,y], [x, y], ...]` corresponding to text.\t\t\t\t\t\t|\n`align` \t\t| Horizontal alignment relative to the `position`. Can be one of `left`, `right`, `center`/`middle`, `start`, `end`, or a number of em units. By default `left`. Can be an array, corresponding to text.\t\t\t\t\t\t\t|\n`baseline` \t\t| Vertical alignment value, by default `middle`. Can be a string one of `top`, `hanging`, `middle`, `alphabetic`, `ideographic`, `bottom` etc. (see [font-measure](https://ghub.io/font-measure)) or a number of em units, denoting `0` as alphabetic baseline. Can be an array corresponding to text.\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n`color` \t\t| Text color or array of colors. By default `black`.\t\t\t\t\t\t|\n`font` \t\t\t| Font family, CSS font string or an object with font properties like `{family, size, style}`, see [css-font](https://ghub.io/css-font). Can be an array.\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n`fontSize`/`em` | Font-size, can be changed independently of `font`.\t\t\t\t\t\t|\n`kerning` \t\t| Enable font kerning, by default `true`. Disable for the case of monospace fonts. See [detect-kerning](https://ghub.io/detect-kerning) package.\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n`offset` \t\t| Shift `position` by the number of ems. Useful for organizing multiple lines, indentation, sub/sup script etc. Does not get affected by `position` change. Can be a number for x-offset only or a couple `[x, y]` for single position or array `[[x, y], [x, y], ...]` for multiple positions.\t\t\t\t\t\t|\n`range` \t\t| Data area corresponding to position in viewport. Useful for organizing zoom/pan. By default is the same as the viewport `[0, 0, canvas.width, canvas.height]`.\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n`scale`/`translate` | An alternative to `range`.\t\t\t\t\t\t\t\t\t\t\t|\n`viewport` \t\t| Visible area within the canvas, an array `[left, top, width, height]` or rectangle `{x, y, width, height}`, see [parse-rect](https://ghub.io/parse-rect).\n\n<!-- `direction` | TODO -->\n<!-- `letterSpacing`, `tracking` | Distance between letters, fractions of `em`. By default `0`. -->\n\n### `text.render()`\n\nDraw text.\n\n### `text.destroy()`\n\nDispose text renderer.\n\n### Properties\n\n* `text.gl` - WebGL context.\n* `text.canvas` - canvas element.\n* `text.regl` - regl instance.\n\n\n## License\n\n© 2018 Dmitry Yv. MIT License\n\nDevelopment supported by [plot.ly](https://github.com/plotly/).\n","readmeFilename":"readme.md"}