UNPKG

windows

Version:

A random but growing collection of utilities for Windows for Node.js

42 lines (30 loc) 1.25 kB
var registry = require('./registry'); var fonts = require('./fonts'); function suitableFonts(){ return fonts.getNames().TrueType.filter(function(s){ return /mono/i.test(s) && !/ita|oblique/i.test(s) }); } function addFont(name){ var key = (Math.random() * 1000 | 0).toString(); return consoleFonts().add(key, name); } function consoleFonts(){ var cached = registry('HKLM/Software/Microsoft/Windows NT/CurrentVersion/Console/TrueTypeFont'); consoleFonts = function consoleFonts(){ return cached }; return cached; } //consoleFonts()["TheSansMono-Light"].remove(); //console.log(addFont("Lucida Console")); //console.log(consoleFonts()); //suitableFonts().filter(function(s){ return !/bold|cond/i.test(s) }).map(addFont) // var confonts = consoleFonts(); // Object.keys(confonts).forEach(function(s, i){ // confonts[s].remove(); // confonts.add(Array(i+2).join('0'), s); // }); // console.log(registry('HKLM/Software/Microsoft/Windows/CurrentVersion')); // setTimeout(process.exit.bind(process), 50); // The font must be a fixed-pitch font. // The font cannot be an italic font. // The font cannot have a negative A or C space. // If it is a TrueType font, it must be FF_MODERN. // If it is not a TrueType font, it must be OEM_CHARSET.