# pixi-dynamic-bitmap-fonts

> [![NPM](https://nodei.co/npm/pixi-dynamic-bitmap-fonts.png)](https://npmjs.org/package/pixi-dynamic-bitmap-fonts)

Latest version **0.0.118** (published 2021-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install pixi-dynamic-bitmap-fonts
pnpm add pixi-dynamic-bitmap-fonts
yarn add pixi-dynamic-bitmap-fonts
bun add pixi-dynamic-bitmap-fonts
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.118 |
| Published | 2021-09-09 |
| First published | 2021-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Stefan Ginev |
| Maintainers | choephix |

## Links

- npm: https://www.npmjs.com/package/pixi-dynamic-bitmap-fonts
- Repository: https://github.com/sginev/pixi-dynamic-bitmap-fonts
- Homepage: https://github.com/sginev/pixi-dynamic-bitmap-fonts#readme
- Issues: https://github.com/sginev/pixi-dynamic-bitmap-fonts/issues
- npm.io page: https://npm.io/package/pixi-dynamic-bitmap-fonts

## Recent versions

- 0.0.118 (latest) — 2021-09-09
- 0.0.116 — 2021-04-27
- 0.0.115 — 2021-04-27
- 0.0.113 — 2021-04-09
- 0.0.112 — 2021-04-07
- 0.0.109 — 2021-04-07
- 0.0.108 — 2021-04-07
- 0.0.106 — 2021-04-06
- 0.0.105 — 2021-03-30
- 0.0.104 — 2021-03-30
- 0.0.103 — 2021-03-24
- 0.0.101 — 2021-03-23
- 0.0.5 — 2021-03-23
- 0.0.4 — 2021-03-23
- 0.0.4-typed — 2021-03-23
- … 4 more at https://npm.io/package/pixi-dynamic-bitmap-fonts/versions

## README

# pixi-dynamic-bitmap-fonts

[![NPM](https://nodei.co/npm/pixi-dynamic-bitmap-fonts.png)](https://npmjs.org/package/pixi-dynamic-bitmap-fonts)

## Disclaimer

This package is very early work in progress. There will be a lot of breaking changes in future versions and hopefully an actual human-understandable readme.

For now:

----

## Usage

```ts
const dbmf = new DynamicBitmapFonts.Manager();

/** Ref your translations object. 
 * This would typically be your localization json object,
 * filled with key-value pairs, the right side of which would be the
 * text, translated to the desired language.
 * 
 * DynamicBitmapFonts will in fact look through those values and
 * gather all unique symvbols found.
 */
dbmf.translation = myTranslationsObject;

/** Just in case, you might want to add characters, even if they aren't
 * found in the translations object.
 * 
 * Typically you'd use this if you want to have digits and perhaps the english alphabet,
 * regardless of the actual language displayed, to resolve dynamic content such as numeric values
 * and usernames.
 */

dbmf.requiredCharacters = DynamicBitmapFonts.shortcuts.CHARACTERS.ALPHANUMERIC;

/**
 * Keys would be the font name. Values -- that font's configurations.
 */
dmbf.configs = {
  "myAwesomeFont": {
    style: {
      fontFamily: 'Arial, Helvetica, sans-serif',
      fontSize: 24,
      fontWeight: 'bold',
      fill: '#FFFFFF',
    },
    options: {
      textureWidth: 1024,
      textureHeight: 1024,
      resolution: 1.0,
      padding: 1,
    },
    modifyTexture: shortcuts.modifyTextureAsPixiObject( (o) => {
      o.addTextureSpriteCopy();
      const [a,b] = o.children as PIXI.Sprite[];
      a.x -= 1;
      a.alpha = 0.5;
      a.blendMode = PIXI.BLEND_MODES.ADD;
      b.x += 1;
      a.alpha = 0.5;
      b.blendMode = PIXI.BLEND_MODES.ADD;
    })
  },
}

```

---
_Source: https://npm.io/package/pixi-dynamic-bitmap-fonts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
