GithubHelp home page GithubHelp logo

j123b567 / lv_utils Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lvgl/lv_utils

0.0 3.0 0.0 6.56 MB

Convert images or system fonts to C arrays. Written for LittlevGL embedded GUI library

Home Page: https://littlevgl.com

PHP 100.00%

lv_utils's Introduction

These PHP scrips are the online converter tools:

Here you you can see how they work or download them to run offline.

Get started

This guide shows how to use the converters offline in a command line on Linux

  1. Install PHP: sudo apt-get install php7.0-cli
  2. Intall the Image manipulator extension for PHP: sudo apt-get install php7.0-gd
  3. Clone or download the lv_utils repository: git clone https://github.com/littlevgl/lv_utils.git
  4. Go to the lv_utils directory.

Run the Font converter offline

  1. Copy a TTF file you want to use into the lv_utils directory
  2. Run the script: php font_conv_core.php "name=arial_20&font=arial.ttf&height=20&bpp=4&uni_first=32&uni_last=126"
  3. Chek the craeted C file in lv_utils directory.

The required arguments of the script:

  • name name of the output file and font
  • font name of font file to use (must be a *.ttf file)
  • height desired height in px
  • bpp Bit-per-pixel (1, 2, 4 or 8)
  • uni_first the first unicode character to convert
  • uni_last the ast unicode character to convert

Optional arguments:

  • built_in convert a built in font with all bpp (0 or 1)
  • list list of characters to include (must be in rango of uni_first and uni_last and in ascendant order). E.g. "list=123abc"

Example with all options Convert only the numbers and + - sign with Arial font (The plus sign is replaced with %2B): php font_conv_core.php "name=arial_num_20&font=arial.ttf&height=20&bpp=8&uni_first=32&uni_last=126&list=%2B-0123456789&built_in=1"

Run the Image converter offline

  1. Copy a BMP, JPG or PNG file you want to use into the lv_utils directory
  2. Run the script: php img_conv_core.php "name=wallpaper&img=red_flower.png"
  3. Chek the created C file in lv_utils directory.

The required arguments of the script:

  • name name of the output file and image
  • img an image file

Optional arguments:

  • transp transparency handlig. Possible values are: none, alpha (add alpha byte to every pixel) or chroma (mark the image as chroma keyed). Default is none.
  • format C array or Binary output. Possible values are: c_array, bin_rgb332, bin_rgb565, bin_rgb888. Default is: c_array.

Example with all options Convert a bunny.png with alpha for all pixels to C array: php img_conv_core.php "name=icon&img=bunny.png&format=c_array&transp=alpha"

lv_utils's People

Contributors

kcmetercec avatar kisvegabor 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.