Skip to content

Commit f4b2833

Browse files
committed
#428, add support for GDScript
1 parent 9456c88 commit f4b2833

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

resources/gdscript.ascii

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{0} _.aMb dMe._
2+
{0} 'H8888b, ,d8888H'
3+
{0} . .:88888d8888888888:. .
4+
{0} .d8b.dM888888888888888888Mb.d8b.
5+
{0}d88888888888888888888888888888888b
6+
{0}'V888888888888888888888888888888V'
7+
{0} 88888888888888888888888888888888
8+
{0} 8888P' {2}--{0} "V88888888V" {2}--{0} 'V8888
9+
{0} 8888" {2}dMMb {0}'888{2}''{0}888' {2}d88b {0}"8888
10+
{0} 8888b {2}:HH: {0}/888{2} {0}888\ {2}:HH: {0}d8888
11+
{0} 8888be._.ad8888{2}..{0}8888be._.ad8888
12+
{0} WW8888888888888888888888888888WW
13+
{0} {2}#######{0}YW88/{2}########{0}\88WY{2}#######
14+
{0} MWbzxe{2}##{0}8MW;{2}##{0}8888{2}##{0};8MW{2}##{0}aezdWM
15+
{0} 'Y8888b.{2}#####{0}/8888\{2}#####{0}.d8888Y'
16+
{0} "V8888888888888888888888888V"
17+
{0} '^YV8888888888888888888VP^'
18+
{0} '"^^VY888888888VY^^'

src/onefetch/language.rs

+1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ define_languages! {
179179
{ Forth, "forth.ascii", "Forth", define_colors!( [Color::Red] ) },
180180
{ FortranModern, "f90.ascii", "Fortran", define_colors!( [Color::White, Color::Green, Color::Cyan, Color::Yellow, Color::Red] ), "fortran" },
181181
{ FSharp, "fsharp.ascii", "F#", define_colors!( [Color::Cyan, Color::Cyan] ), "f#" },
182+
{ GdScript, "gdscript.ascii", "GDScript", define_colors!( [Color::Cyan, Color::White] : [Color::TrueColor{ r:69, g:141, b:192 }, Color::TrueColor{ r:255, g:255, b:255}] ) },
182183
{ Go, "go.ascii", "Go", define_colors!( [Color::Cyan, Color::White, Color::Yellow] : [Color::TrueColor{ r:116, g:205, b:221 }, Color::TrueColor{ r:255, g:255, b:255 }, Color::TrueColor{ r:246, g:210, b:162 }] ) },
183184
{ Graphql, "graphql.ascii", "GraphQL", define_colors!( [Color::Magenta] ) },
184185
{ Groovy, "groovy.ascii", "Groovy", define_colors!( [Color::Cyan, Color::White] ) },

tools/image_to_ascii.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"--resolution",
3535
nargs=2,
3636
metavar=("height", "width"),
37-
help="set custom resolution, default 25 45",
37+
help="set custom resolution, default 25 40",
3838
type=int,
39-
default=[25, 45],
39+
default=[25, 40],
4040
)
4141
parser.add_argument(
4242
"-s",
@@ -55,8 +55,8 @@
5555

5656
image = Image.open(args.file)
5757
scaleFac = 1.0
58-
charWidth = int(args.resolution[1])
5958
charHeight = int(args.resolution[0])
59+
charWidth = int(args.resolution[1])
6060
w, h = image.size
6161
image = image.resize((charWidth, charHeight), Image.NEAREST)
6262
w, h = image.size
@@ -83,9 +83,9 @@ def getSomeChar(h):
8383
print(getSomeChar(grey), end="")
8484
print("")
8585

86-
if charHeight > 25 or charWidth > 45:
86+
if charHeight > 25 or charWidth > 40:
8787
print(
88-
"WARNING: Custom resolution exceeds maximum 25*45 (height*width). See: \n"
88+
"WARNING: Custom resolution exceeds maximum 25*40 (height*width). See: \n"
8989
"https://github.com/o2sh/onefetch/blob/master/CONTRIBUTING.md#ascii-logo"
9090
)
9191

0 commit comments

Comments
 (0)