vanessa-luna / banner-comments-plus

Figlet Font Code Comments (ascii fonts)
MIT License
14 stars 4 forks source link

Suggestion #6

Open altimmons opened 5 years ago

altimmons commented 5 years ago

I like the additional config in this package. But Ive gone back to ASCII Decorator- for the simple reason that they give a preview in the intergrated terminal. Which is really helpful..

https://github.com/helixquar/asciidecorator/

I think this is the relevant code:

function generateFontTestWithSelected(): void { let e = Window.activeTextEditor; let d = e.document; let sel = e.selections;

//get first selection only, ignore all others
let txt: string = d.getText(new Range(sel[0].start, sel[0].end));

generateFontTest(txt);

}

function generateFontTestWithLorem(): void { generateFontTest("Lorem ipsum"); }

function generateFontTest(text): void { var figlet = require('figlet'); var fonts = [];

figlet.fontsSync().forEach(function (font) {
    fonts.push(font);
}, this);

var fontTest = [];

fonts.forEach(function (font) {
    fontTest.push("Font: " + font);
    fontTest.push("\n");

    fontTest.push(
        figlet.textSync(text, {
            font: font,
            horizontalLayout: 'default',
            verticalLayout: 'default'
    }));

    fontTest.push("\n");
    fontTest.push("\n");
});

let fontTestWindow = Window.createOutputChannel("Font Test");

fontTestWindow.append(fontTest.join(""));
fontTestWindow.show();

}

vanessa-luna commented 4 years ago

I see why you appreciate this feature.

This plugin is setup more to accommodate those who have a couple favorite fonts, and configurations, which get saved to keyboard shortcuts. If you think you would be content saving and resuing only your favorite fonts, you could go to the http://patorjk.com/software/taag/ sandbox and play around until you find some you like, then save them to a config.

Unless I get a splurge of commitment to updating this, I do not think I will implement it. But I might should the energy spike. Thank you for the comment