Giter Site home page Giter Site logo

foundations_of_programming_21_task_hexdisplay's Introduction

Hex display with python turtle

A simple program to draw decimal numbers as hexadecimals.

  • Digits are rendered from a font
  • A font is a directory with one svg file for each hexadecimal digit (0.svg ... F.svg)
  • Only a subset of the SVG spec is implemented
    • Only <path> tags are rendered
    • In the path tag's d attribute only the m/M, l/L, h/H, v/V, z/Z commands are supported
    • In the path tag's d attribute auto-separating doesn't work if there are two negative numbers after each other. Put a space or a comma in between
    • Transforms are not supported

There are two fonts included:

  • segment - 16-segment like look. SVG files taken from here, credit to Frantz Balinski
  • roman - an attempt at imagining what roman hexadecimal numbers could look like. It wasn't the best idea but here it is

Usage

usage: display.py [-h] [-f FONT] [--scale SCALE] [--speed SPEED] [--debug-font]

optional arguments:
-h, --help            show this help message and exit
-f FONT, --font FONT  Path to a directory containing the font. The directory should contain an svg file for each hexadecimal digit plus an x.svg
                      file for the `x` symbol.
--scale SCALE         Font scale
--speed SPEED         Turtle speed
--debug-font          Render all digits to test the font

To use the roman font:

python display.py -f roman

foundations_of_programming_21_task_hexdisplay's People

Contributors

mablin7 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tyushev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.