Coder Social home page Coder Social logo

utils's Introduction

Utilities

Utilities to convert

  • pictures
  • operation system fonts

to raw C arrays.

The utilities are written to be compatible with the Littlev Graphics Library.

GitHub: https://github.com/littlevgl/lvgl

Website: http://www.gl.littlev.hu

Usage

Both of the utilities are using Python scripts. So you has to install Python on your operation system.

Clone or download the repository: git clone https://github.com/littlevgl/utils.git

Image converter

  1. Copy an image to img_conv folder
  2. Open a Terminal and go to this directory
  3. Type to the Terminal: python img_cony.py test.png 16 1. Parameters:
    • Image file name
    • Color depth: 8/16/24
    • Set Transp. bit in the header or not (it means pixels with a specific color are not drawn - aka color keying)
  4. Check the output img_test.c and img_test.bin

For more iformation visit http://www.gl.littlev.hu/image-converter/

Font converter

  1. Install BMfont with font_create/install_bmfont_1.13.exe
  2. Open BMfont:
    1. In Options/Font settings choose a font, set its size and other settings (bold, italian etc.)
    2. In Options/Export settings choose XML file format and .png texture. Set the texture width and height to 512.
    3. Save the fnt file: Options/Save bitmap font as…
  3. According to font_create/test_conf create/modify a configuration file:
    • CFontName The file name of the .fnt file without extension
    • BytesWidth How much bytes are needed to represent the full width of the letters. One pixel means one bit, so 2 bytes are enough for maximum 16 pixel width.
    • BytesHeight The same as the font height in Font settings of BMFont.
    • FirstAscii and LastAscii the range of letters.
  4. Be sure the fnt file, the configuration file and fnt2py.py are in the same folder
  5. In Terminal go to this folder and type: python fnt2py.py font_conf
  6. Check the generated .c and h files

For more information visit: http://www.gl.littlev.hu/font-import/

utils's People

Contributors

kisvegabor avatar kcmetercec avatar

Watchers

James Cloos 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.