Code Monkey home page Code Monkey logo

burnfont's Introduction

burnfont Build Go Report Card License GoDoc

This is a hand-crafted 6x6 pixel font, defined by code, originally created in 1997.

Here is a generated image with all available letters in this font:

letters

Here is the same image, but scaled up 4x:

scaled

The font is a bit nostalgic to me, and was used in my small DOS drawing program named Burn. The palette that came with Burn is available here. The GUI was drawn with 320x200 pixels, 256 indexed colors (mode 13h), and looked like this:

burn screenshot

The font definition looks like this:

case 'k':
    fontLine("***", x, y)
    fontLine("-**", x, y+1)
    fontLine("**-**", x+1, y+2)
    fontLine("****-", x+1, y+3)
    fontLine("-**-**", x, y+4)
    fontLine("*** **", x, y+5)

* is a 100% opaque pixel, while - is a 25% opaque one (mostly transparent).

Contents

This Go package has a slice Available that lists all available runes. There is also a Draw function that takes an *image.RGBA value, a rune, a position (x and y) and a color (r, g and b) and draws a letter at that position in the image.

  • The cmd/scaled example outputs an image where each "pixel" of the font is 4x4 pixels.
  • The cmd/letters example outputs an image where each pixel is a pixel.
  • The cmd/txt2png example can render text as a PNG image.

Generating an image

The scaled utility can be built and run like this:

cd cmd/scaled
go build
./scaled

General information

burnfont's People

Contributors

dependabot[bot] avatar xyproto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.