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

pebble-fctx-compiler

v1.2.2

Published

Compiles SVG resources into a binary format for the pebble-fctx library.

Downloads

8

Readme

pebble-fctx-compiler

Compiles SVG resources into a binary format for use with the pebble-fctx drawing library.

Release notes

v1.2.2
  • Fixed crash bug when unicode-range attribute is not present. Fix c/o stefanheule
v1.2.1
  • Made output less verbose by default.
  • Added error handling for fonts that exceed 64kb in size.
  • Added installation and usage notes geared towards CloudPebble users.
  • Made the presence of a resources subdirectory optional.
v1.2
  • Added cap-height to the font metadata. Compatible with pebble-fctx version 1.6.

Installation and invocation

This is a Node.js package. To use it you must have node (with npm) installed on your computer. See nodejs.org for downloads and instructions.

For CloudPebble

Install fctx-compiler globally on your computer with npm:

npm install -g pebble-fctx-compiler

And then, from the folder that contains your SVG font, invoke the compiler:

fctx-compiler <your-file.svg> [-r <regex>]

Output will be written to the current directory, or if a resources subdirectory is present, output will be written to the resources directory.

To update to latest version of the compiler, run:

npm update -g pebble-fctx-compiler

For local SDK

To install as a local devDependency within your pebble project:

npm install pebble-fctx-compiler --save-dev

And then, from your pebble project directory, invoke the locally installed compiler:

./node_modules/.bin/fctx-compiler <path-to/your-file.svg> [-r <regex>]

Output will be written directly into the resources subdirectory, or if that directory does not exist (though it should), output will be written to the current directory.

If you have installed the compiler as a devDependency then the pebble build command should keep your packages, including pebble-fctx-compiler up to date, but if for some reason you need to update it, then, from your project directory, run:

npm update pebble-fctx-compiler

Usage

The compiler only looks for elements defined within the <defs> section of the SVG. It can handle <font> elements and <g d="..."> elements. Output files are named according to the id property of the element.

The -r <regex> option is recommended for selecting a subset of glyphs from a font.

For example, an SVG font definition <defs><font id="OpenSans-Regular"...> ... </font></defs> will be output to OpenSans-regular.ffont.

And an SVG path element defined as <defs><g id="hour-hand" d="..."> ... </g></defs> will be output to hour-hand.fpath.

Example workflow for converting a subset of glyphs from a font.

  1. Open the font in FontForge.
  2. Select File -> Generate Fonts..., then select SVG Font as the output format, and finally click Generate to convert the font.
  3. Open the SVG file in your favorite code or text editor to double check the id of the font and to do any formatting cleanup you like.
  4. Invoke fctx-compiler with the -r [0-9:AMP] option to compile glyph data for just the digits 0 through 9, the colon, and the letters A, M and P.