10000 GitHub - pearmini/apack: Write alphabets in the Chinese character style.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pearmini/apack

Repository files navigation

APack: Alphabet Packing Writing System

APack is a writing system that explores writing alphabets in a Chinese character style. Instead of placing letters sequentially, APack packs letters for one word into a single grid.

English and Chinese use fundamentally different writing systems. In English or other Latin scripts, letters are pre-defined and arranged in a linear sequence. In contrast, Chinese characters are spatially composed using strokes rather than following a strict left-to-right structure.

What if we could write English in a Chinese-style manner—arranging the letters of a word spatially into a single unified character? Potential applications include stamps, wallpapers, concrete poems, icons, and more.

Get started

You can create your own piece using the online APack editor. If you’d like to use APack in your project, it’s also available as a JavaScript package, just follow the instructions below to get started.

$ npm install apackjs -S
import * as ap from "apackjs";

const node = ap.text("hello world").render();

document.body.append(node);

API Reference

# ap.text(content[, options])

Renders the given content with optional styling and layout options.

ap.text("hello world");

example-render-content

# options.cellSize

Sets the size of each cell.

ap.text("hello world", {cellSize: 200});

example-options-cellsize

# 7B6C options.cellWidth

# options.cellHeight

Sets the dimensions of each cell, defaults to options.cellSize.

ap.text("hello world", {
  cellWidth: 320,
  cellHeight: 320,
  style: {styleBackground: "#F1BB4D"},
  word: {stroke: "#492577", strokeWidth: 10},
  font: "astrology",
});

example-options-dimension

# options.font

Specifies the font to use for rendering.

ap.text("hello world", {font: "astrology"});

example-options-font

# options.layout

Set the layout for packing.

ap.text("hello world", {
  layout: {type: "treemap", grid: true},
});

example-options-layout

# options.word

Customizes the word styling.

ap.text("hello world", {
  word: {
    stroke: "red",
    strokeWidth: 3,
    fill: "none",
  },
});

example-options-word

# options.style

Configures the overall style of the output.

ap.text("hello world", {
  style: {
    styleBackground: "red",
  },
});

example-options-style

# options.grid

Adds and customizes a grid overlay.

ap.text("hello world", {
  grid: {
    stroke: "#ccc",
    fill: "none",
  },
});

example-options-grid

# options.padding

Sets the padding around the content.

ap.text("hello world", {padding: 0.2, grid: true});

example-options-padding

About

Write alphabets in the Chinese character style.

Resources

Stars

Watchers

Forks

Releases

No releases published
0