Code Monkey home page Code Monkey logo

qle's Introduction

QMK logo editor

Font and graphics editor for the QMK keyboard firmware. Live demo:

QMK uses "classic" fixed-space Adafruit_GFX 1.0 bitmap font. There are two basic API calls in the latest QMK OLED Driver:

  • oled_write_P(const char *string, bool invert) Writes zero-terminated string using default font (0x0A is line break)
  • oled_write_raw_P(const char *data, uint16_t size) Writes string of characters in 0..255 range using data as 8x8 font

There are a few ways of adding a custom font to your keyboard (all they use local config files of the keymap):

  • SRC in rules.mk: SRC += ./lib/glcdfont.c (crkbd)
  • LOCAL_GLCDFONT in rules.mk: LOCAL_GLCDFONT = yes (gergo)
  • OLED_FONT_H in config.h: #define OLED_FONT_H "keyboards/lily58/lib/glcdfont.c" (lily58)

The latest official way is redefining OLED_FONT_H in the config.h of your keymap (there also other settings):

References

qle's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qle's Issues

Graphics from Aseprite seem to only load as 0xFF

Steps to reproduce:

  1. Upload this file
    oled-island000
  2. See that it only renders as
static const char PROGMEM font[] = {
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
    0xFF, 0xFF, 0xFF, 0xFF,
};

Other images work just fine.

Add support

Specifically, for the RAW mode. So that you can use a rotated image?

Remove hard 256 pixel limit on rows and columns

As far as I can tell, there is no reason an imported image can't be bigger than 256 pixels in one dimension since the image's ratio has no influence on the outputted bytes. The bytes simply correspond with 1x8 pixel sections that freely wrap around at the end of an image row to produce the one-dimensional byte array output.

Why this is relevant

I was trying to parse the bytes for an image of size 270x32, namely this one:

font-export

In this font, each character is 4 qmk-font-rows high and I arranged all the characters in one single row on the image so it's easier to find the matching sections of characters when displaying them (e.g. to display a 1 I write bytes 4 and 5 in the first OLED row, bytes 34 and 35 in the second and so on).

To use this tool as it is, it was necessary to rearrange the image like this

font-export-rearranged

to avoid the hard 256 pixel limit on the width and still get the same arrangement for easy displaying. The same exact byte output can also be achieved by simply removing the code snippet that limits the image's dimensions and using the first image that would otherwise be too wide.

Editing logo does not update the byte array

When editing font or raw, the byte array is updated immediately. However when editing logo, it doesn't seem to ever update the byte array. There are no errors thrown to the JS console.

Raw Image Editor

Instead of having a set size based on the keyboard, it would be nice to have a number of options, or even a "custom" option. Eg:

  • 128x32
  • 128x64
  • 64x32
  • etc

This will allow a lot more customization of the OLED screen and the possibility of doing animations that are not full screen.

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.