dominikwilkowski / cfonts Goto Github PK
View Code? Open in Web Editor NEWSexy fonts for the console
Home Page: https://www.npmjs.com/package/cfonts
License: GNU General Public License v3.0
Sexy fonts for the console
Home Page: https://www.npmjs.com/package/cfonts
License: GNU General Public License v3.0
In version 3.1.0 this does not work
cfonts "Not Working" --gradient "magenta",'#07d569',"#f80" -t --spaceless -a center
Works fine in version 2.10.1
If my program contains custom properties for Array, then CheckInput() throws a "TypeError: userColors[color].toLowerCase() is not a function" error. This is because for (var color in userColors)
iterates over both the array elements and the custom properties. I believe changing for...in to for...of will fix it. To reproduce:
Array.prototype.foo = () => { return 0; };
const cfonts = require('cfonts');
cfonts.say('Hello', { colors: [ 'green' ] });
Could you support sending Hexadecimal Color as font color and background color?
Thanks a lot!
When this module is used in a process that runs non-interactively (non-TTY, for example, when it's a child process), it throws:
TypeError {
message: 'Cannot read property \'width\' of undefined',
}
Object.render (node_modules/cfonts/index.js:464:121)
I would suggest using term-size
instead of window-size
, as it works even when non-TTY. Alternatively, you could fall back to a width of 80.
brew install cfonts
Warning: No available formula with the name "cfonts". Did you mean conftest?
==> Searching for similarly named formulae...
This similarly named formula was found:
conftest
To install it, run:
brew install conftest
==> Searching for a previously deleted formula (in the last
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.
Is it possible to force the color spectrum/support programmatically?
If not would it be possible to add that?
Thank you for making our lifes more colorful <3
Hi,
do you have an example for the classic ASCII art banner that draws my String with lines in Rust?
When just reading the options in the code it's not immediately clear it's the background color. This would also better match the colors
option.
$ npm install -g cfonts
/home/chaz/.local/bin/cfonts -> /home/chaz/.local/lib/node_modules/cfonts/bin/font.js
/home/chaz/.local/lib
└── [email protected]
$ which cfonts
~/.local/bin/cfonts
$ cfonts
Ouch: Please provide text to convert with cfonts -t "Text"
Run cfonts --help for more infos
$ cfonts -t "Text"
error: unknown option `-t'
If I can provide any more useful information please let me know.
When I build my project with webpack,then run the .js file, I got error:
Error: ENOENT: no such file or directory, open '/package.json'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
Can webpack cfonts into one file? Thanks.
Line 28 in 27f8c68
Could there be issues using temp-env 0.3.0?
As you may know, I am maintaining a Python port of cfonts.
At beginning, I just translate node js code to Python, but after the major refactor, I write my own code to implement new features. I would like to know if I can apply a different license other than GPL2.0, say, MIT?
could you add an option to center text horizontally?
Sorry if this is a dumb question, but is there any way to use this in python? I can't just copy paste, it completely breaks. I know there's a version of this made in python, called python-cfonts, by frostming, but the gradients don't look good. I know the console supports more colors, but is there a way to use it in python? TIA!
When using CFonts.say() I think it would be nice to be able to add a new line. An example of this might be:
CFonts.say( `Please some stuff \n Some stuff on a new line`, {
font: 'console',
align: 'center',
colors: [ 'white' ],
});
I understand that you can do:
CFonts.say( `Please some stuff | Some stuff on a new line`, {
font: 'console',
align: 'center',
colors: [ 'white' ],
});
Happy for this to be closed if it's not possible. I just thought it would be nice to mimic default console.log
behaviour in this instance.
If I set TERM=xterm-256color or TERM=xterm, I don't get a smooth gradient transition, but it works if I set FORCE_COLOR=3.
Does this mean color detection is not working as intended?
To reproduce:
$ cfonts "$(seq 200)" -f console -g red,magenta
thread 'main' panicked at src/gradient.rs:443:32:
range end index 3 out of range for slice of length 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This bug depends on the width of the terminal and the length of the text.
If you can't reproduce the panic, try it in a narrower window or increase the seq
argument.
Look like there are just 7 fonts we can use?
First of all, thanks for this awesome piece of code !
I could not see a previous question related to that, hence, here it is:
Is it possible:
cfonts
For example:
cfonts "hello" -f "simple3d" -c "red" "world" -f "3d" -c "green"
I'm using rust crate but this can be applicable to all cfonts
flavor ?
(I tried multiple tests with render
but did not succeed on reaching the result described above )
可以提供typescript d.ts 类型声明吗?
Overdue... !
We get an error when installing:
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9".
Likely fix, upgrade or remove upath
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.