npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

oled-font-pack

v1.0.1

Published

A set of fonts made for oled displays, compatible with oled-i2c-bus version 1.0.12 and higher.

Downloads

120

Readme

oled-font-pack

This package includes a set of various fonts that can be used on OLED displays. These have been tested with SSD1306 driver chip on a Raspberry Pi.

For convenience, this package also includes the original oled-font-3x5 and oled-font-5x7 both of which are available from npm.

https://www.npmjs.com/package/oled-font-3x5

https://www.npmjs.com/package/oled-font-5x7

Baseline requirements to use this package

It should be noted that every font in this package has a character height and width that is less than or equal to 32 pixels.

Version 1.0.12 of the NPM oled-i2c-bus project supports the use of these fonts.

https://www.npmjs.com/package/oled-i2c-bus

IMPORTANT:

You may use version 1.0.11 or lower of the oled-i2c-bus project, however, you are restricted to using only a font with character height and width that is less than or equal to 8 pixels. Fonts outside of this range will only render the top-most 8 pixels of a character glyph.

Notes regarding additional fonts

The these additional fonts were originally a set of fonts for the UTFT library from Rinky-Dink Electronics. These fonts have been trans-coded from C source code such that they can now be used as OLED display fonts.

For reference see:

http://www.rinkydinkelectronics.com/r_fonts.php

Permission to publish these fonts was generously granted by the site owner (Thanks Henning!).

If you wish to contact the site owner you may do so at:

http://www.rinkydinkelectronics.com/contact.php

Version History:

1.0.0

  • Initial Release

1.0.1

  • Add font cp437_8x8 (Glyph's imported from NPM max7219-display)

Names of available fonts

  • oled_3x5
  • tiny_4x6
  • oled_5x7
  • small_6x8
  • sinclair_8x8
  • sinclair_inverted_8x8
  • tiny_8x8
  • cp437_8x8
  • myke2_8x9
  • small_8x12
  • tron_8x12
  • retro_8x16
  • medium_numbers_12x16
  • big_numbers_14x24
  • arial_bold_16x16
  • arial_italic_16x16
  • arial_normal_16x16
  • big_16x16
  • franklin_gothic_normal_16x16
  • hallfetica_normal_16x16
  • nadianne_16x16
  • sinclair_medium_16x16
  • sinclair_medium_inverted_16x16
  • swiss_721_outline_16x16
  • various_symbols_16x16
  • dot_matrix_medium_16x22
  • dot_matrix_medium_zero_slash_16x22
  • dot_matrix_medium_numbers_only_16x22
  • arial_round_16x24
  • ocr_a_extended_medium_16x24
  • sixteen_segment_16x24
  • grotesk_16x32
  • grotesk_bold_16x32
  • retro_16x32
  • various_symbols_16x32
  • various_symbols_v2_16x32
  • dot_matrix_large_numbers_only_24x29
  • inconsola_24x32
  • ubuntu_24x32
  • ubuntu_bold_24x32
  • dingbats1_extra_large_32x24
  • various_symbols_32x32

Performance improvement through demand-loading

For performance reasons and a smaller memory footprint, demand-loading of fonts has been provided. If a font is requested, it will be loaded and kept in memory until such time as the process ends or the user explicitly deletes the font from the package. Note that once deleted, it can be loaded again with no side-effects. See example usage below for an example illustrating how to unload a loaded a font using 'delete'.

Example Usage (see examples/usage.js):

'use strict';
//const FontPack = require('oled-font-pack');
const FontPack = require('../index.js');

function main() {
    // List names of available fonts.
    console.log(FontPack._available);
    // List names of currently loaded fonts.
    console.log("Currently currently loaded fonts (_loaded):");
    console.log(FontPack._loaded);
    // Load the legacy oled-font-3x5
    let font3x5 = FontPack.oled_3x5;
    // Load the legacy oled-font-5x7;
    let font5x7 = FontPack.oled_5x7;
    // List names of loaded fonts using Object.keys.
    console.log("Currently currently loaded fonts (Object.keys):");
    console.log(Object.keys(FontPack));
    let sinclairMedium16x16 = FontPack["sinclair_medium_16x16"];
    let sinclairMediumInverted16x16 = FontPack.sinclair_medium_inverted_16x16;
    // If needed, users may unload fonts no longer needed.
    delete FontPack.oled_5x7;
    // List names of loaded fonts using a loop.
    console.log("Currently currently loaded fonts (for in):");
    for (let key in FontPack) {
        console.log(key);
    }
}

main();