gxs

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2023 License: GPL-3.0

README

g(o) x(cross) s(stitch)

Tools/utilities for cross stitching

build

gxs

G(o) x(cross) s(titch) is an application to produce patterns from text-based file definitions

bitstream

gxs can encode a simple string into a gxs pattern based on the bits from the input

echo "my string" | gxs bitstream

Or one could change the colors, disable repeating, etc.

echo "my other string" | gxs bitstream -width 5 -height 5 -square 3 -primary-color blue -secondary-color yellow

compile

to produce an svg output file from a gxs source input

gxs compile -input filename -output output.svg

encode to a bit stream, produce a gxs pattern, and compile directly

echo "my string" | gxs bitstream | gxs -output encoded.svg

transpile

it's possible to pipe "source code" into gxs and create a pattern from the source that can be stitched

cat Makefile | gxs transpile

though it may be ideal to specify some settings to change that transpile does

gxs transpile -input Makefile -lexer make -font-size 3x5

call gxs transpile -help-details for a full list of styles, fonts, and lexers

the outputs from gxs transpile are patterns that can be used in gxs compile

random

gxs can create a "random" output grid pattern from either input (or current time if no input is given")

gxs random -now

patterns

gxs uses a declaration of patterns which is based on building 1 to N layers and committing each layer once it is "complete" (allowing alterations on top of previous layers). This allows for an "ASCII-like" representation of the pattern to exist for editing via text editor (e.g. vim) while ending up with a full resulting pattern

example
mode

mode is the type of stitch that will be built

type explanation
xstitch full X cross stitch
topedge back stitch at the top edge
bottomedge back stitch at the bottom edge
leftedge back stitch on the left edge
rightedge back stitch on the right edge
hline back stitch horizontally through
vline back stitch vertically through
tlbrline back stitch top-left to bottom-right through
trblline back stitch top-right to bottom-left through
mode => {
    xstitch
}
palette

configures the colors to use within the pattern

palette => {
    x => red
    y => #333333
    z => NONE
}

in the above the "x" symbol will be red, "y" will be the css "#333333" and "z" uses the "NONE" special keyword to allow for spacing symbols but not producing a color.

When a named color is given that matches a known DMC floss, it will result in the RGB floss for that color, in the above example the 'red' value will match a floss

pattern

define the pattern to draw onto a resulting grid

pattern => {
    xyzyz
    zyxyz
    zzxzz
}

which will produce a simple pattern

action

finally tell gxs to commit the stitching layer

action => {
    commit
}
example
# comments start with '#' but can NOT be within a '{' and '}' block
palette => {
    x => red
    y => #333333
    z => NONE
}
mode => {
    xstitch
}
pattern => {
    xyzyz
    zyxyz
    zzxzz
}
action => {
    commit
}
# reuse the palette, single-line block (only for single-line commands)
mode => {topedge}
# patterns must always be redefined
pattern => {
    xxxxx
    zzzzz
    xxxxx
}
action => {commit}

see examples/ for more (or even the tests/inputs/).

Directories

Path Synopsis
compile is for pattern build from text file definitions.
compile is for pattern build from text file definitions.
Package internal handles common arguments.
Package internal handles common arguments.
bitstream
Package bitstream for generating a simple bitstreamd pattern from text.
Package bitstream for generating a simple bitstreamd pattern from text.
compile
Package compile handles compiling inputs to stitchable images
Package compile handles compiling inputs to stitchable images
flosses
Package handles floss upstream sources
Package handles floss upstream sources
fonts
Package fonts handles font definitions within gxs.
Package fonts handles font definitions within gxs.
fonts/generator
Package main generates fonts
Package main generates fonts
grids
Package grids handles making little grid patterns in gxs
Package grids handles making little grid patterns in gxs
random
Package random handles cli for random output patterns
Package random handles cli for random output patterns
transpile
Package transpile handles the transpiling process
Package transpile handles the transpiling process

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL