A simple command line tool for creating font palettes for engines like libtcod

Overview

palscii

A simple command line tool for creating font palettes for engines like libtcod.

Usage

This can also be viewed by running palscii --help.

palscii - generate ASCII font palettes for rougelike engines

palscii is designed to be a dead-simple UNIX-like tool. It takes font files and makes PNG palettes,
and it aims to do that well.

### NOTES

The glyph parameters `width` and `height` are scaled to on a best-case scenario. In situations where
it is not possible to do so, cropping will occur and may result in undesirable visual artifacts.

In DEBUG builds of palscii, an assertion checks the validity of the scale operation, so palscii will
exit with an error.

USAGE:
    palscii [OPTIONS]

OPTIONS:
    -h, --height 
   
    
            Optional maximum glyph height, defualt: 16. See **Notes** for more details

            [default: 16]

        --help
            Print help information

    -i, --input 
    
            Optional path to input file, if not provided, STDIN will be used

    -o, --output 
    
            Optional path to output to, if not provided, STDOUT will be used

    -w, --width 
     
      
            Optional maximum glyph width, default: 8. See **Notes** for more details

            [default: 8]

     
   

Building

TL;DR: cargo build or cargo build --release and you should be up-and-running.

This is a Rust project so it requries a Rust toolchain. See the official Rust website for getting that set up.

After that, it should be as easy as:

  • git clone the repo
  • cargo build to build, if you don't want debug assertions, cargo build --release
  • outputs go into target/; the palscii bin is self-contained and portable

I developed and tested exclusively the following environment:

  • MacOs version 11.6 (Big Sur)
  • rustc version 1.54.0
  • cargo version 1.54.0

I don't anticipate that Palscii would have any problems running on Linux distros, but Windows users might run into some quirks due to different handling of paths.

Testing

  • cargo test

If you'd like to manually test, I've included a couple OFL-licensed fonts along with their respective attribution and license text under resources/.

About

Palscii, at a high level, takes an OTF or TTF font, and creates a 16x16 PNG palette for use in rougelike game engines such as libtcod or bracket-lib.

I created Palscii over a weekend + a few hours here and there in order to play with different fonts while reading Herbert Wolverson's Rougelike in Rust book. That book can be found here and I highly recommend it for anyone interested in Rust and rougelike games.

I designed Palscii to be a simple tool following the UNIX philosophy; namely, it does one thing and tries to do it well. Since this was also a total hack project that I made for fun (and to support my main fun project which is making a rougelike), it's still pretty rough around the edges in v0.1.0. If something doesn't quite work the way you'd like, feel free to fork me and/or PR a fix here.

You might also like...
Figma Agent for Linux (a.k.a. Font Helper)

Figma Agent for Linux (a.k.a. Font Helper)

🔣 nerdfix helps you to find/fix obsolete Nerd Font icons in your project.

🔣 nerdfix nerdfix helps you to find/fix obsolete Nerd Font icons in your project. 💭 Why Nerd Fonts is used in many projects for a beautiful UI. It p

Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

A command-line shell like fish, but POSIX compatible.
A command-line shell like fish, but POSIX compatible.

A command-line shell like fish, but POSIX compatible.

dog is a command-line DNS client, like dig
dog is a command-line DNS client, like dig

dog dog is a command-line DNS client. Dogs can look up! dog is a command-line DNS client, like dig. It has colourful output, understands normal comman

A command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects.

CCake CCake is a command line tool written in Rust and designed to be a modern build tool + package manager for C/C++ projects. Goals To be easily und

A dead simple functional testing tool for command line applications

Pharaoh : build that test pyramid! What it is Pharaoh is a dead simple, no permission needed, functional test runner for command line applications, wr

☘️ A simple command line tool to manage your Minecraft Bedrock worlds
☘️ A simple command line tool to manage your Minecraft Bedrock worlds

☘️ Haze A simple command line tool to manage your Minecraft Bedrock worlds Haze allows you to keep your project's worlds out of the com.mojang directo

This is a simple command-line interface tool that allows you to interact with ChatGPT from OpenAI or Azure.

HeyGPT This is a simple command-line interface tool that allows you to interact with ChatGPT from OpenAI or Azure. You can use it to: Chat with ChatGP

Owner
Steve Troetti
Software engineer currently residing in Boston, MA.
Steve Troetti
ufo2nft is a CLI Rust tool to automate creating on-chain SVG NFTs from UFO font sources

ufo2nft is a CLI Rust program created by Eli Heuer at the 2022 Seattle Solana Hacker House event. It uses Norad to create on-chain SVG images from UFO font sources, and prepares them for minting as Solana NFTs. For Ethereum NFTs the program can just export the SVGs and Ethereum NFTs can be built manually.

Eli Heuer 1 Feb 10, 2022
Convert your favorite images and wallpapers with your favorite color palettes/themes

dipc doprz' image palette converter Convert your favorite images and wallpapers with your favorite color palettes/themes Color Palettes/Themes catppuc

null 50 Apr 26, 2023
Blazingly fast interpolated LUT generator and applicator for arbitrary and popular color palettes.

lutgen-rs A blazingly fast interpolated LUT generator and applicator for arbitrary and popular color palettes. Theme any image to your dekstop colorsc

null 12 Jun 16, 2023
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Universal Windows library for discovering common render engines functions. Supports DirectX9 (D3D9), DirectX10 (D3D10), DirectX11 (D3D11), DirectX12 (D3D12).

Shroud Universal library for discovering common render engines functions. Supports DirectX9 (D3D9), DirectX10 (D3D10), DirectX11 (D3D11), DirectX12 (D

Chase 6 Dec 10, 2022
CarLI is a framework for creating single-command and multi-command CLI applications in Rust

CarLI is a framework for creating single-command and multi-command CLI applications in Rust. The framework provides error and IO types better suited for the command line environment, especially in cases where unit testing is needed.

Kevin Herrera 3 Jan 21, 2022
A tool to compare how Typst documents would look using different fonts or font variants.

typst-font-compare A tool to compare how Typst documents would look using different fonts or font variants. Installation cargo install --path . Usage

null 3 Feb 15, 2024
rpsc is a *nix command line tool to quickly search for file systems items matching varied criterions like permissions, extended attributes and much more.

rpsc rpsc is a *nix command line tool to quickly search for file systems items matching varied criterions like permissions, extended attributes and mu

null 3 Dec 15, 2022
Pink is a command-line tool inspired by the Unix man command.

Pink is a command-line tool inspired by the Unix man command. It displays custom-formatted text pages in the terminal using a subset of HTML-like tags.

null 3 Nov 2, 2023
A Rust 🦀️ font loading, positioning and rendering toolkit

Toolkit used to load, match, measure and render texts. NOTE: This project is a work in progress. Text measuring and positioning is a complex topic. A

Alibaba 63 Dec 27, 2022