Projects STRLCPY cfonts Commits aef2d5d6
🤬
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■ ■
    README.md
    skipped 50 lines
    51 51   maxLength: '0', // define how many character can be on one line
    52 52   gradient: false, // define your two gradient colors
    53 53   independentGradient: false, // define if you want to recalculate the gradient for each new line
     54 + transitionGradient: false, // define if this is a transition between colors directly
     55 + env: 'node' // define the environment CFonts is being executed in
    54 56  });
    55 57  ```
    56 58   
    skipped 226 lines
    283 285  Only works in combination with the [gradient](#-g---gradient) option.
    284 286   
    285 287  ```shell
    286  -$ cfonts "text|next line" --gradient red,"#f80" --independentGradient
     288 +$ cfonts "text|next line" --gradient red,"#f80" --independent-gradient
    287 289  ```
    288 290   
    289 291  ![Independent gradient command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/independent-gradient.png)
    skipped 101 lines
    391 393  ![Max length command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/max-length.png)
    392 394   
    393 395   
     396 +#### -e, --env
     397 +Type: `<string>`
     398 +Default value: `node`
     399 + 
     400 +This option let's you use CFonts to generate HTML instead of ANSI code.
     401 +Note that `max-length` won't be automatically detected anymore and you will have to supply it if you want the text to wrap.
     402 +Best used in a node script.
     403 + 
     404 +```js
     405 +const CFonts = require('cfonts');
     406 +const path = require('path');
     407 +const fs = require('fs');
     408 + 
     409 +const output = CFonts.render('My text', {
     410 + colors: ['white'],
     411 + gradient: ['cyan', 'red'],
     412 + background: 'black',
     413 + space: false,
     414 + env: 'browser',
     415 +});
     416 + 
     417 +fs.writeFileSync(
     418 + path.normalize(`${ __dirname }/test.html`),
     419 + output.string,
     420 + {
     421 + encoding: 'utf8',
     422 + }
     423 +);
     424 +```
     425 + 
     426 +![Max length command](https://raw.githubusercontent.com/dominikwilkowski/cfonts/master/img/env.png)
     427 + 
     428 + 
    394 429  ## Consistency
    395 430  [Chalk](https://github.com/chalk/chalk) detects what colors are supported on your platform.
    396 431  It sets a [level of support](https://github.com/chalk/chalk#256-and-truecolor-color-support) automatically.
    skipped 76 lines
    473 508   
    474 509   
    475 510  ## Release History
     511 +* 2.7.8 - added environment support, added font `tiny`
    476 512  * 2.7.0 - added font `slick`, `grid` and `pallet`, added double quote to all fonts
    477 513  * 2.6.1 - fixed console `maxLength`, `gradient` and `lineHeight`, added more end-to-end tests
    478 514  * 2.6.0 - added transition gradients and sets
    skipped 50 lines
  • ■ ■ ■ ■ ■ ■
    fonts/tiny.json
     1 +{
     2 + "name": "tiny",
     3 + "version": "0.1.0",
     4 + "homepage": "https://github.com/dominikwilkowski/cfonts",
     5 + "colors": 1,
     6 + "lines": 2,
     7 + "buffer": [
     8 + "",
     9 + ""
     10 + ],
     11 + "letterspace": [
     12 + " ",
     13 + " "
     14 + ],
     15 + "chars": {
     16 + "A": [
     17 + "▄▀█",
     18 + "█▀█"
     19 + ],
     20 + "B": [
     21 + "█▄▄",
     22 + "█▄█"
     23 + ],
     24 + "C": [
     25 + "█▀▀",
     26 + "█▄▄"
     27 + ],
     28 + "D": [
     29 + "█▀▄",
     30 + "█▄▀"
     31 + ],
     32 + "E": [
     33 + "█▀▀",
     34 + "██▄"
     35 + ],
     36 + "F": [
     37 + "█▀▀",
     38 + "█▀ "
     39 + ],
     40 + "G": [
     41 + "█▀▀",
     42 + "█▄█"
     43 + ],
     44 + "H": [
     45 + "█ █",
     46 + "█▀█"
     47 + ],
     48 + "I": [
     49 + "█",
     50 + "█"
     51 + ],
     52 + "J": [
     53 + " █",
     54 + "█▄█"
     55 + ],
     56 + "K": [
     57 + "█▄▀",
     58 + "█ █"
     59 + ],
     60 + "L": [
     61 + "█ ",
     62 + "█▄▄"
     63 + ],
     64 + "M": [
     65 + "█▀▄▀█",
     66 + "█ ▀ █"
     67 + ],
     68 + "N": [
     69 + "█▄ █",
     70 + "█ ▀█"
     71 + ],
     72 + "O": [
     73 + "█▀█",
     74 + "█▄█"
     75 + ],
     76 + "P": [
     77 + "█▀█",
     78 + "█▀▀"
     79 + ],
     80 + "Q": [
     81 + "█▀█",
     82 + "▀▀█"
     83 + ],
     84 + "R": [
     85 + "█▀█",
     86 + "█▀▄"
     87 + ],
     88 + "S": [
     89 + "█▀▀",
     90 + "▄▄█"
     91 + ],
     92 + "T": [
     93 + "▀█▀",
     94 + " █ "
     95 + ],
     96 + "U": [
     97 + "█ █",
     98 + "█▄█"
     99 + ],
     100 + "V": [
     101 + "█ █",
     102 + "▀▄▀"
     103 + ],
     104 + "W": [
     105 + "█ █ █",
     106 + "▀▄▀▄▀"
     107 + ],
     108 + "X": [
     109 + "▀▄▀",
     110 + "█ █"
     111 + ],
     112 + "Y": [
     113 + "█▄█",
     114 + " █ "
     115 + ],
     116 + "Z": [
     117 + "▀█",
     118 + "█▄"
     119 + ],
     120 + "0": [
     121 + "▞█▚",
     122 + "▚█▞"
     123 + ],
     124 + "1": [
     125 + "▄█",
     126 + " █"
     127 + ],
     128 + "2": [
     129 + "▀█",
     130 + "█▄"
     131 + ],
     132 + "3": [
     133 + "▀▀█",
     134 + "▄██"
     135 + ],
     136 + "4": [
     137 + "█ █",
     138 + "▀▀█"
     139 + ],
     140 + "5": [
     141 + "█▀",
     142 + "▄█"
     143 + ],
     144 + "6": [
     145 + "█▄▄",
     146 + "█▄█"
     147 + ],
     148 + "7": [
     149 + "▀▀█",
     150 + " █"
     151 + ],
     152 + "8": [
     153 + "███",
     154 + "█▄█"
     155 + ],
     156 + "9": [
     157 + "█▀█",
     158 + "▀▀█"
     159 + ],
     160 + "!": [
     161 + "█",
     162 + "▄"
     163 + ],
     164 + "?": [
     165 + "▀█",
     166 + " ▄"
     167 + ],
     168 + ".": [
     169 + " ",
     170 + "▄"
     171 + ],
     172 + "+": [
     173 + "▄█▄",
     174 + " ▀ "
     175 + ],
     176 + "-": [
     177 + "▄▄",
     178 + " "
     179 + ],
     180 + "_": [
     181 + " ",
     182 + "▄▄"
     183 + ],
     184 + "=": [
     185 + "▀▀",
     186 + "▀▀"
     187 + ],
     188 + "@": [
     189 + "▛█▜",
     190 + "▙▟▃"
     191 + ],
     192 + "#": [
     193 + "▟▄▙",
     194 + "▜▀▛"
     195 + ],
     196 + "$": [
     197 + "▖█▗",
     198 + "▘█▝"
     199 + ],
     200 + "%": [
     201 + "▀ ▄▀",
     202 + "▄▀ ▄"
     203 + ],
     204 + "&": [
     205 + "▄▄█",
     206 + "█▄█"
     207 + ],
     208 + "(": [
     209 + "▄▀",
     210 + "▀▄"
     211 + ],
     212 + ")": [
     213 + "▀▄",
     214 + "▄▀"
     215 + ],
     216 + "/": [
     217 + " ▄▀",
     218 + "▄▀ "
     219 + ],
     220 + ":": [
     221 + "▀",
     222 + "▄"
     223 + ],
     224 + ";": [
     225 + " ",
     226 + "▄▀"
     227 + ],
     228 + ",": [
     229 + " ",
     230 + "█"
     231 + ],
     232 + "'": [
     233 + "▀",
     234 + " "
     235 + ],
     236 + "\"": [
     237 + "▛ ▜",
     238 + " "
     239 + ],
     240 + " ": [
     241 + " ",
     242 + " "
     243 + ]
     244 + }
     245 +}
     246 + 
  • img/env.png
  • img/tiny.png
  • ■ ■ ■ ■
    package.json
    1 1  {
    2 2   "name": "cfonts",
    3 3   "description": "Sexy fonts for the console",
    4  - "version": "2.7.0",
     4 + "version": "2.8.0",
    5 5   "homepage": "https://github.com/dominikwilkowski/cfonts",
    6 6   "author": {
    7 7   "name": "Dominik Wilkowski",
    skipped 101 lines
  • ■ ■ ■ ■ ■
    src/constants.js
    skipped 122 lines
    123 123   slick: 'slick',
    124 124   grid: 'grid',
    125 125   pallet: 'pallet',
     126 + tiny: 'tiny',
    126 127  };
    127 128   
    128 129  const CLIOPTIONS = {
    skipped 126 lines
  • test/unit/fonts.spec.js
    Unable to diff as some line is too long.
Please wait...
Page is in error, reload to recover