Crate cp437_tools

source ·
Expand description

logo

CP437 tools

A small collection of tools to handle CP437 files.

§Binaries

These require rust nightly, since they make use of the nightly feature try_trait_v2.

§Meta handling

  • cp437-check-meta

    Reads a file’s metadata and run some validations to see if there’s any issues with it.

  • cp437-read-meta

    Reads and prints a file’s metadata, highlighting values to show potential errors, as well as showing the effective value when a real one is missing.

  • cp437-remove-meta

    Takes a file and strips its metadata, piping the resulting file to stdout.

  • cp437-set-meta

    Takes a file and modifies its metadata, piping the resulting file to stdout.

    If the file has no metadata, it will add one filled with default values, and then proceed to add set the given field.

§Rendering

  • cp437-to-png

    Renders the given file as a PNG image, piping the resulting file to stdout.

    It will also embed the file’s metadata, if available.

    to-png

  • cp437-to-svg

    NOTE: This binary is still a WIP. Redering seems to be kinda wonky.

    Renders the given file as an SVG image, piping the resulting file to stdout.

    It will also embed the file’s metadata, if available.

    to-svg

  • cp437-to-txt

    Takes the contents of the file and transpiles them to UTF-8 encoding, piping the resulting file to stdout.

    to-txt

§Library

Note that this crate is primary written to supply the CLI commands shown above, not as a reusable library. As such, by default it will pull unnecessary dependencies.

To avoid this, disable the default “binaries” feature.

(see cargo#1982 issue for more details on why this workaround is even needed)

Modules§

  • ANSI colours
  • CP437 to/from UTF-8
  • Fonts used for rendering PNG images
  • Handling of file’s metadata
  • A list of things likely to be required by most dependents.