TypeScript parser and encoder for Brother ScanNCut FCM/VCM files.
FCM (and VCM) files are the native format for Brother ScanNCut cutting machines. They contain vector cut paths, thumbnails, and metadata. VCM files are specifically for print-and-cut workflows with registration marks.
import { readFcmFile, writeFcmFile } from "open-fcm";
// Parse an FCM file
const data = new Uint8Array(/* file bytes */);
const fcm = readFcmFile(data);
console.log(fcm.file_header.variant); // "FCM" or "VCM"
console.log(fcm.cut_data.file_type); // "Cut" or "PrintAndCut"
console.log(fcm.piece_table.pieces.length);
// Modify and re-encode
const output = writeFcmFile(fcm);import { SvgPathParser, PathTool } from "open-fcm";
const parser = new SvgPathParser({ dpi: 72 });
const shapes = parser.parse("M 0,0 L 100,0 L 100,100 L 0,100 Z");
// Use shapes to build FCM paths
const path = {
tool: PathTool.TOOL_CUT,
shape: shapes[0],
rhinestone_diameter: null,
rhinestones: [],
};import { PageSizes, getFcmAlignmentMarks, generateRegistrationMarksSvg } from "open-fcm";
// Get mark positions for FCM alignment data
const marks = getFcmAlignmentMarks(PageSizes.LETTER);
// Generate SVG with registration marks for printing
const svg = generateRegistrationMarksSvg(PageSizes.LETTER);import { generateThumbnail, generateBlankThumbnail } from "open-fcm";
// Generate thumbnail from paths (prevents machine reboots from invalid BMPs)
const thumbnail = generateThumbnail(paths);
// Or a blank white thumbnail
const blank = generateBlankThumbnail();| Module | Purpose |
|---|---|
readFcmFile / writeFcmFile |
Parse and encode complete FCM files |
SvgPathParser |
Convert SVG path d attributes to FCM format |
generateThumbnail |
Create valid 88×88 monochrome BMP thumbnails |
getFcmAlignmentMarks |
Registration mark positions for print-and-cut |
generateRegistrationMarksSvg |
SVG output with Brother-compatible marks |
This is a TypeScript port inspired by the original Rust library:
- fcmlib by justjanne — MPL 2.0 licensed, comprehensive FCM parser with examples
- fcmlib fork — Adds SVG path parsing, registration marks, and a sticker sheet example for print-and-cut workflows
The original Rust implementation is more mature and battle-tested.
"Brother" and "ScanNCut" are trademarks of Brother Industries, Ltd. This project is not affiliated with, endorsed by, or sponsored by Brother. The FCM/VCM file format was reverse-engineered for interoperability purposes.
- Brother ScanNCut — The cutting machines that use FCM files
scripts/make-sticker-sheet.ts— Example script for generating print-and-cut files