![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Parse pixels to BitFontMaker2 JSON font format
Pixels 2 BitFontMaker2 (aka px2bfm) is a simple command line tool with the intention of allowing you to use your desired pixel editor to draw font glyphs, creating compatible BitFontMaker2 JSON, and allowing you to import it to generate a new bitmap font. This doesn't replace the app, just supports it.
This package requires npm and node.js. If you don't have npm or node.js on your local machine, check out this guide on getting setup.
$ npm install --global px2bfm
If you don't feel like installing it globally via npm, you can clone this repo and run the script directly:
$ ./bin/px2bfm
$ px2bfm --help
Usage: px2bfm [options] <file>
Parse pixels to BitFontMaker2 JSON font format
For more info visit https://github.com/sprngr/px2bfm
Options:
-v, --version output the version number
-f, --fontname <fontname> add name of the font
-c, --creator <creator> add name of the font creator
-h, --help output usage information
The fontname
and creator
arguments are optional, but you'll probably want to set that at some point.
Example:
$ px2bfm yourFileHere.png
# Output: {A lot of JSON}
To get this into a file:
$ px2bfm yourFileHere.png > bfm2.json # Or whatever you want to call it
To put it on the clipboard to paste into the textfield on the web app:
MacOS
$ px2bfm yourFileHere.png | pbcopy
Windows
# I'm pretty sure this is a standard tool
$ px2bfm yourFileHere.png | clip
Linux
# Let's be honest, if you're on linux you're a pro at this so why do I need to tell you
$ px2bfm yourFileHere.png | xclip
Using one of the font templates provided (or your own, as long as it fits within required dimensions), create a pixel font.
Sprite sheets must have a width of 208px to maintain some parity with the layout of BitFontMaker2. The height of the file must be a power of 16 (default is 128px), this will allow for future support of extended character sets.
Be sure to use black (hex #000000 / rgba 0, 0, 0) for glyph pixels, the image parser only cares about those. Any other colors & alpha values are ignored.
Each glyph must fit within a 16x16 pixel block, this is required by the web app.
Input
Output
{
"33": [0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 0, 8, 0, 0, 0, 0],
"34": [0, 0, 0, 0, 20, 20, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"35": [0, 0, 0, 0, 0, 40, 40, 124, 40, 124, 40, 40, 0, 0, 0, 0],
...
"name": "PixelFont",
"copy": "PixelFontMaker",
"letterspace": "64",
"basefont_size": "357",
"basefont_left": "62",
"basefont_top": "0",
"basefont": "None",
"basefont2": ""
}
Currently this supports the first set of 104 characters on BitFontMaker2:
# Set 1
ABCDEFGHIJKLM
NOPQRSTUVWXYZ
abcdefghijklm
nopqrstuvwxyz
0123456789!"#
$%&'()*+,-./:
;<=>?@[\]^_`{
|}~¡¢£€¤¥¦§¨©
Extended character support is planned for the future, as well as the additional 90 character slots allowed.
Font template includes guides. The blue dotted line creates the grid of 16x16 blocks, the red lines are the baseline like in the web app.
MIT © Michael Springer 2018
BitFontMaker2 is the property of Pentacom.
FAQs
Parse pixels to BitFontMaker2 JSON font format
We found that px2bfm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.