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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mtx-decompressor

v1.4.2

Published

MicroType Express (MTX) font decompressor — extracts TTF/OTF from compressed EOT containers.

Readme

mtx-decompressor

npm version CI license

A zero-dependency TypeScript library that decompresses MicroType Express (MTX) compressed font data found inside EOT (Embedded OpenType) containers, producing standard TrueType (.ttf) font binaries.

MTX is a font compression format developed by Monotype, used inside EOT containers commonly found in older web pages and embedded in Microsoft Office documents. This library extracts the compressed data and reconstructs a standard .ttf file usable with standard font APIs (e.g. the FontFace API). It has no dependencies and works in both the browser and Node.js.

▶️ Live demo · 📦 npm


Demo

Try it right in your browser — drop in an .eot file, download the extracted .ttf, and preview text rendered in the decompressed font:

https://christophervr.github.io/mtx-decompressor/

Install

npm install mtx-decompressor

Quick start

import { decompressMtx, decompressEotFont } from 'mtx-decompressor';

// Decompress MTX-compressed font data
const fontData: Uint8Array = /* extracted from EOT container */;
const ttfBytes = decompressMtx(fontData, { encrypted: false, compressed: true });
// => Uint8Array containing a valid TrueType font

// Convenience wrapper with explicit boolean parameters
const ttf = decompressEotFont(fontData, /* compressed */ true, /* encrypted */ false);

// XOR-obfuscated data
const decrypted = decompressMtx(encryptedData, { encrypted: true, compressed: true });

API

decompressMtx(fontData, options?)

Decompress an MTX-compressed font into a TrueType binary.

| Parameter | Type | Description | | -------------------- | ---------------------------- | ----------------------------------------------------------------------------- | | fontData | Uint8Array | Raw font bytes (MTX-compressed, optionally encrypted) | | options.encrypted | boolean (default: false) | If true, XOR-decrypt with key 0x50 before decompression | | options.compressed | boolean (default: true) | If false, skip decompression and return the (possibly decrypted) data as-is | | Returns | Uint8Array | A valid TrueType (.ttf) font binary |

decompressEotFont(fontData, compressed, encrypted)

Convenience wrapper around decompressMtx taking explicit boolean parameters; returns a TrueType binary.

unpackMtx(data, size)

Low-level: unpack an MTX blob into three LZCOMP-decompressed streams. Returns { streams: Uint8Array[], sizes: number[] }.

The exported SFNTContainer and SFNTTable types describe the reconstructed font tables.

How it works

The pipeline: optional XOR decryption → MTX header parsing (splits into three LZCOMP blocks) → LZCOMP decompression (sliding-window LZ with adaptive Huffman coding) → CTF parsing (reconstructs TrueType tables from the three Compact TrueType Font streams) → SFNT assembly (table directory, alignment, checksums).

Provenance

A TypeScript port of the MTX decompression code from libeot by Brennan Vincent (MPL-2.0). The original C implementation is based on the MicroType Express specification submitted to the W3C by Monotype Imaging.

License

MPL-2.0. As a TypeScript port of the MPL-2.0-licensed libeot, this library inherits the Mozilla Public License 2.0 — modifications to the licensed files must remain open under the same terms.