AsciiWriter: Difference between revisions

From creative crowd wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
=Use asciiWriter=
=Use asciiWriter=


=== marks ===
== marks ==
With marks you can specify what kind of text you are passing on to asciiWriter.
With marks you can specify what kind of text you are passing on to asciiWriter.
   
   
==== random() ====
=== random() ===
==== sentence(str) ====
=== sentence(str) ===
==== text(str) ====
=== text(str) ===
==== single(str) ====
=== single(str) ===
==== space(str) ====
=== space(str) ===


=== patterns ===
== patterns ==
You can draw patterns with the following functions.
You can draw patterns with the following functions.


==== diagonal(x, y, width, height, mark, blank) ====
=== diagonal(x, y, width, height, mark, blank) ===
Draw a diagnal line from top left to bottom right.
Draw a diagnal line from top left to bottom right.


==== cross(x, y, width, height, mark, blank) ====
=== cross(x, y, width, height, mark, blank) ===
Draw two diagonals.
Draw two diagonals.


==== horizontal(y) ====  
=== horizontal(y) ===  
Draw horizontal line at given Y position.
Draw horizontal line at given Y position.


==== vertical(x) ====  
=== vertical(x) ===  
Draw a vertical line at given X position.
Draw a vertical line at given X position.


==== sinus_vertical(period=0.2, amplitude=0.5, offset_t=0, offset=0) ====  
=== sinus_vertical(period=0.2, amplitude=0.5, offset_t=0, offset=0) ===  
Draw a sinus shape vertically.
Draw a sinus shape vertically.


==== sinus_horizontal(period=0.2, amplitude=0.5, offset_t=0, offset=0) ====  
=== sinus_horizontal(period=0.2, amplitude=0.5, offset_t=0, offset=0) ===  
Draw a sinus shape horizontally.
Draw a sinus shape horizontally.


==== image(path, threshold=128) ====  
=== image(path, threshold=128) ===  
Put marks based on a mask. Requires Pillow to be installed.
Put marks based on a mask. Requires Pillow to be installed.


  $ pip3 install pillow
  $ pip3 install pillow


=== text ===
== text ==


=== utils ===
== utils ==


=== wrap_single_line ===
== wrap_single_line ==

Revision as of 10:31, 7 April 2023


Install asciiWriter

$ pip3 install asciiwriter

Use asciiWriter

marks

With marks you can specify what kind of text you are passing on to asciiWriter.

random()

sentence(str)

text(str)

single(str)

space(str)

patterns

You can draw patterns with the following functions.

diagonal(x, y, width, height, mark, blank)

Draw a diagnal line from top left to bottom right.

cross(x, y, width, height, mark, blank)

Draw two diagonals.

horizontal(y)

Draw horizontal line at given Y position.

vertical(x)

Draw a vertical line at given X position.

sinus_vertical(period=0.2, amplitude=0.5, offset_t=0, offset=0)

Draw a sinus shape vertically.

sinus_horizontal(period=0.2, amplitude=0.5, offset_t=0, offset=0)

Draw a sinus shape horizontally.

image(path, threshold=128)

Put marks based on a mask. Requires Pillow to be installed.

$ pip3 install pillow

text

utils

wrap_single_line