├── support ├── test-data │ ├── Canvas-text.png │ ├── Canvas-bitmap.png │ ├── Canvas-canvas.png │ ├── Canvas-lines.png │ ├── Canvas-circles.png │ ├── Canvas-triangles.png │ └── Canvas-rectangles.png ├── arduino │ ├── library.properties.in │ ├── rastr.h │ ├── README.md │ └── Examples │ │ └── SimpleTest │ │ ├── SimpleTest.ino │ │ └── default_monospace_7.h ├── rastr.h.in └── doxygen │ ├── footer.html │ ├── header.html │ ├── sl-doxygen.css │ └── doxy-boot.js ├── .gitmodules ├── test ├── main.cpp ├── src │ ├── CanvasTestFunctions.h │ ├── displays │ │ ├── GDisplayPush2.h │ │ ├── GDisplayMaschineMK2.h │ │ ├── GDisplayMaschineMikro.h │ │ ├── GDisplayMaschineMK1.h │ │ ├── GDisplayMaschineMikro.cpp │ │ ├── GDisplayMaschineMK2.cpp │ │ ├── GDisplayPush2.cpp │ │ ├── NullCanvas.h │ │ └── GDisplayMaschineMK1.cpp │ ├── CanvasTestHelpers.h │ ├── Color.cpp │ ├── CanvasTestHelpers.cpp │ ├── Canvas.cpp │ ├── fonts │ │ ├── default_monospace_5.h │ │ ├── default_monospace_7.h │ │ └── default_monospace_8.h │ └── Roboto_Bold_10_1bpp.h └── CMakeLists.txt ├── .gitignore ├── cmake-modules ├── Coveralls.cmake ├── colors.cmake └── FindPNG.cmake ├── arduinify.sh ├── LICENSE ├── tools ├── CMakeLists.txt ├── rastr-png.cpp └── rastr-ttf.cpp ├── README.md ├── inc └── rastr │ ├── StaticCanvas.hpp │ ├── Util.hpp │ ├── DynamicCanvas.hpp │ ├── CanvasGrayscale8.hpp │ ├── CanvasRGB888.hpp │ ├── CanvasMonochrome.hpp │ ├── CanvasRGB565.hpp │ ├── Types.hpp │ └── Color.hpp ├── .clang-format └── CMakeLists.txt /support/test-data/Canvas-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaduzlabs/rastr/HEAD/support/test-data/Canvas-text.png -------------------------------------------------------------------------------- /support/test-data/Canvas-bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaduzlabs/rastr/HEAD/support/test-data/Canvas-bitmap.png -------------------------------------------------------------------------------- /support/test-data/Canvas-canvas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaduzlabs/rastr/HEAD/support/test-data/Canvas-canvas.png -------------------------------------------------------------------------------- /support/test-data/Canvas-lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaduzlabs/rastr/HEAD/support/test-data/Canvas-lines.png -------------------------------------------------------------------------------- /support/test-data/Canvas-circles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaduzlabs/rastr/HEAD/support/test-data/Canvas-circles.png -------------------------------------------------------------------------------- /support/test-data/Canvas-triangles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaduzlabs/rastr/HEAD/support/test-data/Canvas-triangles.png -------------------------------------------------------------------------------- /support/test-data/Canvas-rectangles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaduzlabs/rastr/HEAD/support/test-data/Canvas-rectangles.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "modules/libpng"] 2 | path = modules/libpng 3 | url = https://github.com/glennrp/libpng.git 4 | [submodule "modules/catch2"] 5 | path = modules/catch2 6 | url = https://github.com/catchorg/Catch2.git 7 | [submodule "modules/clara"] 8 | path = modules/clara 9 | url = https://github.com/catchorg/Clara 10 | -------------------------------------------------------------------------------- /test/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #define CATCH_CONFIG_MAIN 9 | #include 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build products 2 | build/ 3 | artifacts/ 4 | ipch/ 5 | .env/ 6 | cmake_install.cmake 7 | Makefile 8 | 9 | # Mac specific 10 | *.DS_Store 11 | xcuserdata/ 12 | project.xcworkspace/ 13 | *.pbxuser 14 | 15 | # Windows specific 16 | *.bak 17 | *.opt 18 | *.user 19 | *.suo 20 | *.sdf 21 | *.ncb 22 | *.opensdf 23 | 24 | # Temporary files 25 | *~ 26 | 27 | # Documentation 28 | docs/_build 29 | docs/doxyoutput 30 | docs/api 31 | -------------------------------------------------------------------------------- /support/arduino/library.properties.in: -------------------------------------------------------------------------------- 1 | name=rastr 2 | version=@RASTR_VERSION_MAJOR@.@RASTR_VERSION_MINOR@.@RASTR_VERSION_MICRO@ 3 | author=Vincenzo Pacella 4 | maintainer=Vincenzo Pacella 5 | sentence=A small, lightweight header-only graphics library 6 | paragraph=rastr is a lightweight graphics library that provides basic drawing primitives, uses integer arithmetic and has no external dependencies 7 | category=Display 8 | url=https://github.com/shaduzlabs/arduino-rastr 9 | architectures=* 10 | -------------------------------------------------------------------------------- /support/arduino/rastr.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | -------------------------------------------------------------------------------- /cmake-modules/Coveralls.cmake: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------------------------------ # 2 | # coveralls-cmake # 3 | # ------------------------------------------------------------------------------------------------ # 4 | 5 | function (addCoverallsCMake) 6 | if(DEFINED COVERALLS_CMAKE_PATH) 7 | message(STATUS "Coveralls-cmake is already available") 8 | else() 9 | checkout_external_project(coveralls-cmake https://github.com/JoakimSoderberg/coveralls-cmake.git master) 10 | set(COVERALLS_CMAKE_PATH "${CMAKE_BINARY_DIR}/coveralls-cmake/src/coveralls-cmake/cmake" PARENT_SCOPE) 11 | endif() 12 | endfunction() 13 | -------------------------------------------------------------------------------- /support/rastr.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #define RASTR_VERSION_MAJOR @RASTR_VERSION_MAJOR@ 11 | #define RASTR_VERSION_MINOR @RASTR_VERSION_MINOR@ 12 | #define RASTR_VERSION_MICRO @RASTR_VERSION_MICRO@ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | -------------------------------------------------------------------------------- /arduinify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | rm -f $2/rastr-arduino.zip 4 | rm -rf $2/arduino/* 5 | mkdir -p $2/arduino/rastr/rastr 6 | mkdir -p $2/arduino/rastr/Examples 7 | cp $1/inc/rastr/* $2/arduino/rastr/rastr/. 8 | cp $1/inc/rastr/fonts/* $2/arduino/rastr/. 9 | cp -r $1/src/* $2/arduino/rastr/ 10 | cp -r $1/support/arduino/Examples/* $2/arduino/rastr/Examples/ 11 | cp $1/support/arduino/README.md $2/arduino/rastr/ 12 | cp $2/library.properties $2/arduino/rastr/. 13 | cp $2/rastr.h $2/arduino/rastr/. 14 | sed -n '/#include /!p' $2/rastr.h > $2/arduino/rastr/rastr.h 15 | rm $2/arduino/rastr/rastr/DynamicCanvas.hpp 16 | find $2/arduino/rastr -type f -name *.cpp -print0 | xargs -0 -I%%% mv %%% $2/arduino/rastr/ 17 | zip -9 -r $2/rastr-arduino.zip $2/arduino 18 | -------------------------------------------------------------------------------- /support/arduino/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | ,-. ,-. ,-. |- ,-. 3 | | ,-| `-. | | 4 | ' `-^ `-' `' ' 5 | ``` 6 | 7 | `rastr` is a lightweight graphics library written in c++. 8 | 9 | ### Features 10 | - No dependency to other software libraries (not even the `libstd`) 11 | - No dynamic memory allocation (except for `DynamicCanvas`) 12 | - Basic drawing primitives (lines, triangles, rectangles, circles) and bitmap images/fonts support 13 | - Only integer arithmetic: can be used even on small embedded devices (tested on Arduino, Teensy, ESP32 and many other platforms) 14 | - Comes with a set of tools (see below) to convert fonts and images to a format that is usable by the library 15 | - Header only 16 | 17 | ### Tools 18 | PNG and TrueType conversion utilities are available in the [main repository](https://www.github.com/shaduzlabs/rastr) -------------------------------------------------------------------------------- /support/arduino/Examples/SimpleTest/SimpleTest.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include 9 | 10 | #include "default_monospace_7.h" 11 | 12 | //-------------------------------------------------------------------------------------------------- 13 | 14 | sl::rastr::CanvasMonochrome<128,64> canvas; 15 | 16 | //-------------------------------------------------------------------------------------------------- 17 | 18 | void setup(){ 19 | canvas.putText(8, 8, "Hello world!", sl::rastr::Color{0xff}, k_font_DefaultMonospace_7); 20 | } 21 | 22 | void loop() { 23 | 24 | } -------------------------------------------------------------------------------- /support/doxygen/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) 2018 Vincenzo Pacella 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/src/CanvasTestFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | //-------------------------------------------------------------------------------------------------- 13 | 14 | namespace sl 15 | { 16 | namespace rastr 17 | { 18 | namespace test 19 | { 20 | 21 | //-------------------------------------------------------------------------------------------------- 22 | 23 | void lines(Canvas* /*c_*/); 24 | 25 | void circles(Canvas* /*c_*/); 26 | 27 | void triangles(Canvas* /*c_*/); 28 | 29 | void rectangles(Canvas* /*c_*/); 30 | 31 | void text(Canvas* /*c_*/); 32 | 33 | void canvas(Canvas* /*c_*/); 34 | 35 | void bitmap(Canvas* /*c_*/); 36 | 37 | //-------------------------------------------------------------------------------------------------- 38 | 39 | } // namespace test 40 | } // namespace rastr 41 | } // namespace sl 42 | -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com ####### 7 | 8 | # Tools ------------------------------------------------------------------------------------------ # 9 | 10 | include(FindFreetype) 11 | if (NOT FREETYPE_FOUND) 12 | message(FATAL_ERROR "FreeType is required and could not be found.") 13 | endif() 14 | 15 | set( src_rastr_png_SRCS rastr-png.cpp ) 16 | add_executable( rastr-png ${src_rastr_png_SRCS} ) 17 | target_include_directories(rastr-png PRIVATE ${Boost_INCLUDE_DIRS} ${CLARA_INCLUDE_DIRS}) 18 | target_link_libraries(rastr-png PUBLIC rastr png ${Boost_LIBRARIES}) 19 | 20 | set( src_rastr_ttf_SRCS rastr-ttf.cpp ) 21 | add_executable( rastr-ttf ${src_rastr_ttf_SRCS} ) 22 | target_include_directories(rastr-ttf PRIVATE ${Boost_INCLUDE_DIRS}) 23 | target_include_directories(rastr-ttf PRIVATE ${FREETYPE_INCLUDE_DIRS} ${CLARA_INCLUDE_DIRS}) 24 | target_link_libraries(rastr-ttf PUBLIC rastr ${Boost_LIBRARIES} ${FREETYPE_LIBRARIES}) 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | ,-. ,-. ,-. |- ,-. 3 | | ,-| `-. | | 4 | ' `-^ `-' `' ' 5 | ``` 6 | 7 | `rastr` is a lightweight graphics library written in c++. 8 | 9 | ### Features 10 | - No dependency to other software libraries (not even the `libstd`) 11 | - No dynamic memory allocation (except for `DynamicCanvas`) 12 | - Basic drawing primitives (lines, triangles, rectangles, circles) and bitmap images/fonts support 13 | - Only integer arithmetic: can be used even on small embedded devices (tested on Arduino, Teensy, ESP32 and many other platforms) 14 | - Comes with a set of tools (see below) to convert fonts and images to a format that is usable by the library 15 | - Header only 16 | 17 | ### Tools 18 | The tools below can be used to convert, respectively, png images and TrueType fonts to header files that can be used by `rastr`. 19 | Please be aware that, in contrast to the library itself, the tools have some dependencies that need to be installed when building (`boost`, `libfreetype` and `libpng`). 20 | 21 | #### Png converter 22 | Images in `png` format can be converted to a header file using `rastr-png`. The library only supports 1bpp (monochrome) and 8bpp (grayscale) images. For the full list of parameters, please run the utility with `--help`. 23 | 24 | #### Font converter 25 | Fonts in TrueType format can be converted to a header file using `rastr-ttf`. Characters are rendered as a bitmaps (either 1bpp or 8bpp). For the full list of parameters, please run the utility with `--help`. 26 | -------------------------------------------------------------------------------- /cmake-modules/colors.cmake: -------------------------------------------------------------------------------- 1 | # from http://stackoverflow.com/questions/18968979/how-to-get-colorized-output-with-cmake 2 | 3 | if(NOT WIN32) 4 | string(ASCII 27 Esc) 5 | set(ColourReset "${Esc}[m") 6 | set(ColourBold "${Esc}[1m") 7 | set(Red "${Esc}[31m") 8 | set(Green "${Esc}[32m") 9 | set(Yellow "${Esc}[33m") 10 | set(Blue "${Esc}[34m") 11 | set(Magenta "${Esc}[35m") 12 | set(Cyan "${Esc}[36m") 13 | set(White "${Esc}[37m") 14 | set(BoldRed "${Esc}[1;31m") 15 | set(BoldGreen "${Esc}[1;32m") 16 | set(BoldYellow "${Esc}[1;33m") 17 | set(BoldBlue "${Esc}[1;34m") 18 | set(BoldMagenta "${Esc}[1;35m") 19 | set(BoldCyan "${Esc}[1;36m") 20 | set(BoldWhite "${Esc}[1;37m") 21 | endif() 22 | 23 | function(message) 24 | list(GET ARGV 0 MessageType) 25 | if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR) 26 | list(REMOVE_AT ARGV 0) 27 | _message(${MessageType} "${BoldRed}${ARGV}${ColourReset}") 28 | elseif(MessageType STREQUAL WARNING) 29 | list(REMOVE_AT ARGV 0) 30 | _message(${MessageType} "${BoldYellow}${ARGV}${ColourReset}") 31 | elseif(MessageType STREQUAL AUTHOR_WARNING) 32 | list(REMOVE_AT ARGV 0) 33 | _message(${MessageType} "${BoldCyan}${ARGV}${ColourReset}") 34 | elseif(MessageType STREQUAL STATUS) 35 | list(REMOVE_AT ARGV 0) 36 | _message(${MessageType} "${Green}${ARGV}${ColourReset}") 37 | else() 38 | _message("${ARGV}") 39 | endif() 40 | endfunction() 41 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayPush2.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include "cabl/gfx/CanvasBase.h" 11 | 12 | #include 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | class GDisplayPush2 : public CanvasBase<960, 160, 1024 * 160 * 2> 22 | { 23 | public: 24 | //! Set a pixel 25 | /*! 26 | \param x_ The X coordinate of the pixel 27 | \param y_ The Y coordinate of the pixel 28 | \param color_ The pixel color (RGB + monochrome) 29 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 30 | */ 31 | void setPixel( 32 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_ = true) override; 33 | 34 | //! Get the pixel value as an RGB color 35 | /*! 36 | \param x_ The X coordinate of the pixel 37 | \param y_ The Y coordinate of the pixel 38 | \return The color of the selected pixel 39 | */ 40 | Color pixel(int x_, int y_) const override; 41 | }; 42 | 43 | //-------------------------------------------------------------------------------------------------- 44 | 45 | } // namespace cabl 46 | } // namespace sl 47 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayMaschineMK2.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include "cabl/gfx/CanvasBase.h" 11 | 12 | #include 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | class GDisplayMaschineMK2 : public CanvasBase<256, 64, 2048, 8> 22 | { 23 | public: 24 | //! Set a pixel 25 | /*! 26 | \param x_ The X coordinate of the pixel 27 | \param y_ The Y coordinate of the pixel 28 | \param color_ The pixel color (RGB + monochrome) 29 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 30 | */ 31 | void setPixel( 32 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_ = true) override; 33 | 34 | //! Get the pixel value as an RGB color 35 | /*! 36 | \param x_ The X coordinate of the pixel 37 | \param y_ The Y coordinate of the pixel 38 | \return The color of the selected pixel 39 | */ 40 | Color pixel(int x_, int y_) const override; 41 | }; 42 | 43 | //-------------------------------------------------------------------------------------------------- 44 | 45 | } // namespace cabl 46 | } // namespace sl 47 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayMaschineMikro.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include "cabl/gfx/CanvasBase.h" 11 | 12 | #include 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | class GDisplayMaschineMikro : public CanvasBase<128, 64, 1024, 4> 22 | { 23 | public: 24 | //! Set a pixel 25 | /*! 26 | \param x_ The X coordinate of the pixel 27 | \param y_ The Y coordinate of the pixel 28 | \param color_ The pixel color (RGB + monochrome) 29 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 30 | */ 31 | void setPixel( 32 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_ = true) override; 33 | 34 | //! Get the pixel value as an RGB color 35 | /*! 36 | \param x_ The X coordinate of the pixel 37 | \param y_ The Y coordinate of the pixel 38 | \return The color of the selected pixel 39 | */ 40 | Color pixel(int x_, int y_) const override; 41 | }; 42 | 43 | //-------------------------------------------------------------------------------------------------- 44 | 45 | } // namespace cabl 46 | } // namespace sl 47 | -------------------------------------------------------------------------------- /test/src/CanvasTestHelpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | #include 13 | 14 | //-------------------------------------------------------------------------------------------------- 15 | 16 | #define DO_WRITE_PICTURES 1 // Enable this to generate the pngs, must be disabled on build servers 17 | 18 | //-------------------------------------------------------------------------------------------------- 19 | 20 | namespace sl 21 | { 22 | namespace rastr 23 | { 24 | namespace test 25 | { 26 | 27 | //-------------------------------------------------------------------------------------------------- 28 | 29 | class PngCanvas : public DynamicCanvas 30 | { 31 | public: 32 | PngCanvas(); 33 | PngCanvas(unsigned w_, unsigned h_, unsigned size_ = 0); 34 | 35 | void read(const std::string& fileName_); 36 | void write(const std::string& fileName_); 37 | }; 38 | 39 | //-------------------------------------------------------------------------------------------------- 40 | 41 | bool matchColorForAllPixels(const Canvas* /*canvas_*/, const Color& /*color_*/); 42 | 43 | bool compare(const Canvas* /*c1_*/, const Canvas* /*c2_*/); 44 | 45 | //-------------------------------------------------------------------------------------------------- 46 | 47 | } // namespace test 48 | } // namespace rastr 49 | } // namespace sl 50 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayMaschineMK1.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include "cabl/gfx/CanvasBase.h" 11 | 12 | #include 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | class GDisplayMaschineMK1 : public CanvasBase<255, 64, 10880, 22> 22 | { 23 | public: 24 | GDisplayMaschineMK1(); 25 | 26 | void white() override; 27 | 28 | void black() override; 29 | 30 | 31 | //! Set a pixel 32 | /*! 33 | \param x_ The X coordinate of the pixel 34 | \param y_ The Y coordinate of the pixel 35 | \param color_ The pixel color (RGB + monochrome) 36 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 37 | */ 38 | void setPixel( 39 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_ = true) override; 40 | 41 | //! Get the pixel value as an RGB color 42 | /*! 43 | \param x_ The X coordinate of the pixel 44 | \param y_ The Y coordinate of the pixel 45 | \return The color of the selected pixel 46 | */ 47 | Color pixel(int x_, int y_) const override; 48 | }; 49 | 50 | //-------------------------------------------------------------------------------------------------- 51 | 52 | } // namespace cabl 53 | } // namespace sl 54 | -------------------------------------------------------------------------------- /inc/rastr/StaticCanvas.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | //-------------------------------------------------------------------------------------------------- 13 | 14 | namespace sl 15 | { 16 | namespace rastr 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | /** 22 | \class StaticCanvas 23 | \brief The canvas base class 24 | 25 | */ 26 | template 27 | class StaticCanvas : public Canvas 28 | { 29 | 30 | public: 31 | StaticCanvas() 32 | { 33 | invalidate(); 34 | } 35 | 36 | unsigned width() const noexcept override 37 | { 38 | return W; 39 | } 40 | 41 | unsigned height() const noexcept override 42 | { 43 | return H; 44 | } 45 | 46 | unsigned canvasWidthInBytes() const noexcept override 47 | { 48 | return H > 0 ? S / H : 0; 49 | } 50 | 51 | unsigned bufferSize() const override 52 | { 53 | return S; 54 | } 55 | 56 | const uint8_t* data() const override 57 | { 58 | return &m_data[0]; 59 | } 60 | 61 | protected: 62 | uint8_t* data() override 63 | { 64 | return &m_data[0]; 65 | } 66 | 67 | uint8_t m_data[S]; //!< The raw Canvas data 68 | }; 69 | 70 | //-------------------------------------------------------------------------------------------------- 71 | 72 | } // namespace rastr 73 | } // namespace sl 74 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | AccessModifierOffset: -2 4 | AlignAfterOpenBracket: false 5 | AlignEscapedNewlinesLeft: true 6 | AlignOperands: true 7 | AlignTrailingComments: true 8 | AllowAllParametersOfDeclarationOnNextLine: true 9 | AllowShortBlocksOnASingleLine: false 10 | AllowShortIfStatementsOnASingleLine: false 11 | AllowShortLoopsOnASingleLine: false 12 | AllowShortFunctionsOnASingleLine: false 13 | AlwaysBreakTemplateDeclarations: true 14 | AlwaysBreakBeforeMultilineStrings: false 15 | BreakBeforeBinaryOperators: true 16 | BreakBeforeTernaryOperators: true 17 | BreakConstructorInitializersBeforeComma: true 18 | BinPackArguments: false 19 | BinPackParameters: false 20 | BreakBeforeBraces: Allman 21 | ColumnLimit: 100 22 | CommentPragmas: '^!' 23 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 24 | ConstructorInitializerIndentWidth: 2 25 | ContinuationIndentWidth: 2 26 | Cpp11BracedListStyle: true 27 | DerivePointerAlignment: false 28 | DisableFormat: false 29 | ExperimentalAutoDetectBinPacking: false 30 | IndentCaseLabels: true 31 | IndentFunctionDeclarationAfterType: false 32 | IndentWrappedFunctionNames: false 33 | IndentWidth: 2 34 | KeepEmptyLinesAtTheStartOfBlocks: true 35 | MaxEmptyLinesToKeep: 2 36 | NamespaceIndentation: None 37 | PenaltyBreakBeforeFirstCallParameter: 19 38 | PenaltyBreakComment: 300 39 | PenaltyBreakString: 1000 40 | PenaltyBreakFirstLessLess: 120 41 | PenaltyExcessCharacter: 100 42 | PenaltyReturnTypeOnItsOwnLine: 600 43 | PointerAlignment: Left 44 | SpaceBeforeAssignmentOperators: true 45 | SpaceBeforeParens: ControlStatements 46 | SpaceInEmptyParentheses: false 47 | SpacesBeforeTrailingComments: 1 48 | SpacesInAngles: false 49 | SpacesInContainerLiterals: true 50 | SpacesInCStyleCastParentheses: false 51 | SpacesInParentheses: false 52 | Standard: Cpp11 53 | TabWidth: 2 54 | UseTab: Never 55 | ... 56 | -------------------------------------------------------------------------------- /inc/rastr/Util.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2017 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | // ------------------------------------------------------------------------------------------------- 11 | 12 | namespace sl 13 | { 14 | namespace rastr 15 | { 16 | namespace util 17 | { 18 | 19 | // ------------------------------------------------------------------------------------------------- 20 | 21 | template 22 | void swap(T& t1, T& t2) 23 | { 24 | T temp(t1); 25 | t1 = t2; 26 | t2 = temp; 27 | } 28 | 29 | // ------------------------------------------------------------------------------------------------- 30 | 31 | template 32 | inline T nmax(T a, T b) 33 | { 34 | return a > b ? a : b; 35 | } 36 | 37 | // ------------------------------------------------------------------------------------------------- 38 | 39 | template 40 | A nmax(A a, A b, Args... args) 41 | { 42 | return nmax(nmax(a, b), args...); 43 | } 44 | 45 | //-------------------------------------------------------------------------------------------------- 46 | 47 | template 48 | inline T nmin(T a, T b) 49 | { 50 | return a < b ? a : b; 51 | } 52 | 53 | // ------------------------------------------------------------------------------------------------- 54 | 55 | template 56 | A nmin(A a, A b, Args... args) 57 | { 58 | return nmin(nmin(a, b), args...); 59 | } 60 | 61 | // ------------------------------------------------------------------------------------------------- 62 | 63 | } // namespace util 64 | } // namespace rastr 65 | } // namespace sl 66 | -------------------------------------------------------------------------------- /cmake-modules/FindPNG.cmake: -------------------------------------------------------------------------------- 1 | # - Find the native PNG includes and library 2 | # 3 | # This module defines 4 | # PNG_INCLUDE_DIRS, where to find png.h, etc. 5 | # PNG_LIBRARIES, the libraries to link against to use PNG. 6 | # PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files. 7 | # PNG_FOUND, If false, do not try to use PNG. 8 | # also defined, but not for general use are 9 | # PNG_LIBRARIES, where to find the PNG library. 10 | # None of the above will be defined unles zlib can be found. 11 | # PNG depends on Zlib 12 | # 13 | # Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. 14 | # See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. 15 | 16 | include(FindZLIB) 17 | set(PNG_FOUND FALSE) 18 | 19 | if(ZLIB_FOUND) 20 | 21 | FIND_PATH(PNG_INCLUDE_DIRS png.h 22 | /usr/local/include 23 | /usr/include 24 | ) 25 | 26 | find_library(PNG_LIBRARIES 27 | NAMES png libpng 28 | PATHS /lib /usr/lib /usr/lib64 /usr/local/lib 29 | ) 30 | 31 | if (PNG_LIBRARIES AND PNG_INCLUDE_DIRS) 32 | set(PNG_INCLUDE_DIRS ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ) 33 | set(PNG_LIBRARIES ${PNG_LIBRARIES} ${ZLIB_LIBRARY}) 34 | set(PNG_FOUND TRUE) 35 | endif (PNG_LIBRARIES AND PNG_INCLUDE_DIRS) 36 | 37 | else (ZLIB_FOUND) 38 | 39 | message(FATAL_ERROR "Could not find ZLib library") 40 | 41 | endif(ZLIB_FOUND) 42 | 43 | if (PNG_FOUND) 44 | if (NOT PNG_FIND_QUIETLY) 45 | message(STATUS "Found PNG: ${PNG_LIBRARIES}") 46 | endif (NOT PNG_FIND_QUIETLY) 47 | 48 | add_library(png INTERFACE) 49 | target_link_libraries( png INTERFACE ${PNG_LIBRARIES} ) 50 | target_include_directories( png INTERFACE ${PNG_INCLUDE_DIRS} ) 51 | 52 | else (PNG_FOUND) 53 | 54 | if (PNG_FIND_REQUIRED) 55 | message(FATAL_ERROR "Could not find PNG library") 56 | endif (PNG_FIND_REQUIRED) 57 | 58 | endif (PNG_FOUND) 59 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayMaschineMikro.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include "gfx/displays/GDisplayMaschineMikro.h" 9 | 10 | #include "cabl/util/Functions.h" 11 | 12 | //-------------------------------------------------------------------------------------------------- 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | void GDisplayMaschineMikro::setPixel( 22 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_) 23 | { 24 | if (x_ >= width() || y_ >= height() || color_.transparent()) 25 | { 26 | return; 27 | } 28 | 29 | Color oldColor = pixel(x_, y_); 30 | 31 | bool isWhite{color_.active()}; 32 | if (color_.blendMode() == BlendMode::invert) 33 | { 34 | isWhite = !oldColor.active(); 35 | } 36 | unsigned byteIndex = (width() * (y_ >> 3)) + x_; 37 | 38 | 39 | if (isWhite) 40 | { 41 | data()[byteIndex] |= 0x01 << (y_ & 7); 42 | } 43 | else 44 | { 45 | data()[byteIndex] &= ~(0x01 << (y_ & 7)); 46 | } 47 | 48 | if (bSetDirtyChunk_ && oldColor.active() != isWhite) 49 | { 50 | setDirtyChunk(y_); 51 | } 52 | } 53 | 54 | //-------------------------------------------------------------------------------------------------- 55 | 56 | Color GDisplayMaschineMikro::pixel(int x_, int y_) const 57 | { 58 | if (x_ >= width() || y_ >= height()) 59 | { 60 | return {}; 61 | } 62 | 63 | if (((data()[x_ + (width() * (y_ >> 3))] >> ((y_)&7)) & 0x01) == 0) 64 | { 65 | return {0}; 66 | } 67 | 68 | return {0xff}; 69 | } 70 | 71 | //-------------------------------------------------------------------------------------------------- 72 | 73 | } // namespace cabl 74 | } // namespace sl 75 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayMaschineMK2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include "gfx/displays/GDisplayMaschineMK2.h" 9 | 10 | #include "cabl/util/Functions.h" 11 | 12 | //-------------------------------------------------------------------------------------------------- 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | void GDisplayMaschineMK2::setPixel( 22 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_) 23 | { 24 | if (x_ >= width() || y_ >= height() || color_.transparent()) 25 | { 26 | return; 27 | } 28 | 29 | Color oldColor = pixel(x_, y_); 30 | 31 | bool isWhite{color_.active()}; 32 | if (color_.blendMode() == BlendMode::invert) 33 | { 34 | isWhite = !oldColor.active(); 35 | } 36 | unsigned byteIndex = (canvasWidthInBytes() * y_) + (x_ >> 3); 37 | 38 | if (isWhite) 39 | { 40 | data()[byteIndex] |= (0x80 >> (x_ & 7)); 41 | } 42 | else 43 | { 44 | data()[byteIndex] &= (~0x80 >> (x_ & 7)); 45 | } 46 | 47 | if (bSetDirtyChunk_ && oldColor.active() != isWhite) 48 | { 49 | setDirtyChunk(y_); 50 | } 51 | } 52 | 53 | //-------------------------------------------------------------------------------------------------- 54 | 55 | Color GDisplayMaschineMK2::pixel(int x_, int y_) const 56 | { 57 | if (x_ >= width() || y_ >= height()) 58 | { 59 | return {}; 60 | } 61 | 62 | if ((data()[(canvasWidthInBytes() * y_) + (x_ >> 3)] & (0x80 >> (x_ & 7))) == 0) 63 | { 64 | return {0}; 65 | } 66 | 67 | return {0xff}; 68 | } 69 | 70 | //-------------------------------------------------------------------------------------------------- 71 | 72 | } // namespace cabl 73 | } // namespace sl 74 | -------------------------------------------------------------------------------- /support/doxygen/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | $projectname: $title 16 | $title 17 | 18 | 19 | $treeview 20 | $search 21 | $mathjax 22 | 23 | $extrastylesheet 24 | 25 | 26 | 27 | 28 | 29 | 30 | 37 |
38 |
39 |
40 |
41 |
42 |
43 | 44 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayPush2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include "gfx/displays/GDisplayPush2.h" 9 | 10 | #include "cabl/util/Functions.h" 11 | 12 | //-------------------------------------------------------------------------------------------------- 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | void GDisplayPush2::setPixel( 22 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_) 23 | { 24 | if (x_ >= width() || y_ >= height() || color_.transparent()) 25 | { 26 | return; 27 | } 28 | 29 | Color oldColor = pixel(x_, y_); 30 | Color newColor = color_; 31 | if (color_.blendMode() == BlendMode::invert) 32 | { 33 | newColor = oldColor; 34 | newColor.invert(); 35 | } 36 | 37 | unsigned byteIndex = (canvasWidthInBytes() * y_) + (x_ * 2); 38 | uint8_t green = static_cast(((newColor.green() / 255.0) * 63) + 0.5); 39 | 40 | data()[byteIndex + 1] 41 | = (static_cast(((newColor.blue() / 255.0) * 31) + 0.5) << 3) | ((green >> 3) & 0x07); 42 | 43 | data()[byteIndex ] 44 | = ((green << 5) & 0xE0) | static_cast(((newColor.red() / 255.0) * 31) + 0.5); 45 | 46 | if (bSetDirtyChunk_ && oldColor != newColor) 47 | { 48 | setDirtyChunk(y_); 49 | } 50 | } 51 | 52 | //-------------------------------------------------------------------------------------------------- 53 | 54 | Color GDisplayPush2::pixel(int x_, int y_) const 55 | { 56 | if (x_ >= width() || y_ >= height()) 57 | { 58 | return {}; 59 | } 60 | unsigned index = (canvasWidthInBytes() * y_) + (x_ * 2); 61 | 62 | return {static_cast((((data()[index ] & 0x1F) / 31.0) * 255) + 0.5), 63 | static_cast( 64 | ((((data()[index] & 0x07) << 3 | (data()[index + 1] & 0xE0) >> 5) / 63.0) * 255) + 0.5), 65 | static_cast((((data()[index + 1] >> 3) / 31.0) * 255) + 0.5)}; 66 | } 67 | 68 | //-------------------------------------------------------------------------------------------------- 69 | 70 | } // namespace cabl 71 | } // namespace sl 72 | -------------------------------------------------------------------------------- /inc/rastr/DynamicCanvas.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace sl 13 | { 14 | namespace rastr 15 | { 16 | 17 | //-------------------------------------------------------------------------------------------------- 18 | 19 | /** 20 | \class StaticCanvas 21 | \brief The canvas base class 22 | 23 | */ 24 | 25 | class DynamicCanvas : public Canvas 26 | { 27 | 28 | public: 29 | DynamicCanvas(unsigned w_, unsigned h_, unsigned size_ = 0) 30 | : m_width(w_), m_height(h_), m_size(size_ == 0 ? w_ * h_ * 3 : size_) 31 | { 32 | if (m_size > 0) 33 | { 34 | m_data = new uint8_t[m_size]; 35 | } 36 | black(); 37 | } 38 | 39 | ~DynamicCanvas() override 40 | { 41 | if (m_data != nullptr) 42 | { 43 | delete[] m_data; 44 | } 45 | } 46 | 47 | unsigned width() const noexcept override 48 | { 49 | return m_width; 50 | } 51 | 52 | unsigned height() const noexcept override 53 | { 54 | return m_height; 55 | } 56 | 57 | unsigned canvasWidthInBytes() const noexcept override 58 | { 59 | return m_height > 0 ? m_size / m_height : 0; 60 | } 61 | 62 | unsigned bufferSize() const override 63 | { 64 | return m_size; 65 | } 66 | 67 | const uint8_t* data() const override 68 | { 69 | return m_data; 70 | } 71 | 72 | protected: 73 | uint8_t* data() override 74 | { 75 | return m_data; 76 | } 77 | 78 | void resize(unsigned width_, unsigned height_, unsigned size_) 79 | { 80 | m_width = width_; 81 | m_height = height_; 82 | m_size = size_; 83 | if (m_data != nullptr) 84 | { 85 | delete[] m_data; 86 | } 87 | if (size_ > 0) 88 | { 89 | m_data = new uint8_t[size_]; 90 | } 91 | } 92 | 93 | private: 94 | unsigned m_width{0U}; 95 | unsigned m_height{0U}; 96 | unsigned m_size{0U}; 97 | 98 | uint8_t* m_data{nullptr}; //!< The raw Canvas data 99 | }; 100 | 101 | //-------------------------------------------------------------------------------------------------- 102 | 103 | } // namespace rastr 104 | } // namespace sl 105 | -------------------------------------------------------------------------------- /inc/rastr/CanvasGrayscale8.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace sl 13 | { 14 | namespace rastr 15 | { 16 | 17 | //-------------------------------------------------------------------------------------------------- 18 | 19 | template 20 | class CanvasGrayscale8 : public StaticCanvas 21 | { 22 | public: 23 | //------------------------------------------------------------------------------------------------ 24 | 25 | //! Set a pixel 26 | /*! 27 | \param x_ The X coordinate of the pixel 28 | \param y_ The Y coordinate of the pixel 29 | \param color_ The pixel color (RGB + monochrome) 30 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 31 | */ 32 | void setPixel(int x_, int y_, const Color& color_, bool invalidate_) override 33 | { 34 | if (x_ >= this->width() || y_ >= this->height() || color_.transparent()) 35 | { 36 | return; 37 | } 38 | 39 | Color oldColor = pixel(x_, y_); 40 | Color newColor = color_; 41 | if (color_.blendMode() == BlendMode::invert) 42 | { 43 | newColor = oldColor; 44 | newColor.invert(); 45 | } 46 | 47 | unsigned byteIndex = (this->canvasWidthInBytes() * y_) + x_; 48 | 49 | this->data()[byteIndex] = color_.mono(); 50 | 51 | if (invalidate_ && oldColor.mono() != newColor.mono()) 52 | { 53 | Canvas::invalidate(x_, y_); 54 | } 55 | } 56 | 57 | //------------------------------------------------------------------------------------------------ 58 | 59 | //! Get the pixel value as an RGB color 60 | /*! 61 | \param x_ The X coordinate of the pixel 62 | \param y_ The Y coordinate of the pixel 63 | \return The color of the selected pixel 64 | */ 65 | Color pixel(int x_, int y_) const override 66 | { 67 | if (x_ >= this->width() || y_ >= this->height()) 68 | { 69 | return {}; 70 | } 71 | unsigned index = (this->canvasWidthInBytes() * y_) + x_; 72 | 73 | return Color{static_cast(this->data()[index])}; 74 | } 75 | }; 76 | 77 | //-------------------------------------------------------------------------------------------------- 78 | 79 | } // namespace rastr 80 | } // namespace sl 81 | -------------------------------------------------------------------------------- /inc/rastr/CanvasRGB888.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace sl 13 | { 14 | namespace rastr 15 | { 16 | 17 | //-------------------------------------------------------------------------------------------------- 18 | 19 | template 20 | class CanvasRGB888 : public StaticCanvas 21 | { 22 | public: 23 | //------------------------------------------------------------------------------------------------ 24 | 25 | //! Set a pixel 26 | /*! 27 | \param x_ The X coordinate of the pixel 28 | \param y_ The Y coordinate of the pixel 29 | \param color_ The pixel color (RGB + monochrome) 30 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 31 | */ 32 | void setPixel(int x_, int y_, const Color& color_, bool invalidate_) override 33 | { 34 | if (x_ >= this->width() || y_ >= this->height() || color_.transparent()) 35 | { 36 | return; 37 | } 38 | 39 | Color oldColor = pixel(x_, y_); 40 | Color newColor = color_; 41 | if (color_.blendMode() == BlendMode::invert) 42 | { 43 | newColor = oldColor; 44 | newColor.invert(); 45 | } 46 | 47 | unsigned byteIndex = (this->canvasWidthInBytes() * y_) + (x_ * 3); 48 | 49 | this->data()[byteIndex++] = newColor.red(); 50 | this->data()[byteIndex++] = newColor.green(); 51 | this->data()[byteIndex] = newColor.blue(); 52 | 53 | if (invalidate_ && oldColor != newColor) 54 | { 55 | Canvas::invalidate(x_, y_); 56 | } 57 | } 58 | 59 | //------------------------------------------------------------------------------------------------ 60 | 61 | //! Get the pixel value as an RGB color 62 | /*! 63 | \param x_ The X coordinate of the pixel 64 | \param y_ The Y coordinate of the pixel 65 | \return The color of the selected pixel 66 | */ 67 | Color pixel(int x_, int y_) const override 68 | { 69 | if (x_ >= this->width() || y_ >= this->height()) 70 | { 71 | return {}; 72 | } 73 | unsigned index = (this->canvasWidthInBytes() * y_) + (x_ * 3); 74 | 75 | return {this->data()[index++], this->data()[index++], this->data()[index]}; 76 | } 77 | }; 78 | 79 | //-------------------------------------------------------------------------------------------------- 80 | 81 | } // namespace rastr 82 | } // namespace sl 83 | -------------------------------------------------------------------------------- /inc/rastr/CanvasMonochrome.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace sl 13 | { 14 | namespace rastr 15 | { 16 | 17 | //-------------------------------------------------------------------------------------------------- 18 | 19 | template 20 | class CanvasMonochrome : public StaticCanvas 21 | { 22 | public: 23 | //------------------------------------------------------------------------------------------------ 24 | 25 | //! Set a pixel 26 | /*! 27 | \param x_ The X coordinate of the pixel 28 | \param y_ The Y coordinate of the pixel 29 | \param color_ The pixel color (RGB + monochrome) 30 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 31 | */ 32 | void setPixel(int x_, int y_, const Color& color_, bool invalidate_) override 33 | { 34 | if (x_ >= static_cast(this->width()) || y_ >= static_cast(this->height()) 35 | || color_.transparent()) 36 | { 37 | return; 38 | } 39 | 40 | auto oldColor = pixel(x_, y_); 41 | 42 | bool isWhite{color_.active()}; 43 | if (color_.blendMode() == sl::rastr::BlendMode::invert) 44 | { 45 | isWhite = !oldColor.active(); 46 | } 47 | unsigned byteIndex = (this->width() * (y_ >> 3)) + x_; 48 | 49 | 50 | if (isWhite) 51 | { 52 | this->data()[byteIndex] |= 0x01 << (y_ & 7); 53 | } 54 | else 55 | { 56 | this->data()[byteIndex] &= ~(0x01 << (y_ & 7)); 57 | } 58 | 59 | if (invalidate_ && oldColor.active() != isWhite) 60 | { 61 | this->invalidate(x_, y_); 62 | } 63 | } 64 | 65 | //------------------------------------------------------------------------------------------------ 66 | 67 | //! Get the pixel value as an RGB color 68 | /*! 69 | \param x_ The X coordinate of the pixel 70 | \param y_ The Y coordinate of the pixel 71 | \return The color of the selected pixel 72 | */ 73 | Color pixel(int x_, int y_) const override 74 | { 75 | if (x_ >= static_cast(this->width()) || y_ >= static_cast(this->height())) 76 | { 77 | return {}; 78 | } 79 | 80 | if (((this->data()[x_ + (this->width() * (y_ >> 3))] >> ((y_)&7)) & 0x01) == 0) 81 | { 82 | return sl::rastr::Color{0}; 83 | } 84 | 85 | return sl::rastr::Color{0xff}; 86 | } 87 | }; 88 | 89 | //-------------------------------------------------------------------------------------------------- 90 | 91 | } // namespace rastr 92 | } // namespace sl 93 | -------------------------------------------------------------------------------- /inc/rastr/CanvasRGB565.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | 12 | namespace sl 13 | { 14 | namespace rastr 15 | { 16 | 17 | //-------------------------------------------------------------------------------------------------- 18 | 19 | template 20 | class CanvasRGB565 : public StaticCanvas 21 | { 22 | public: 23 | //------------------------------------------------------------------------------------------------ 24 | 25 | //! Set a pixel 26 | /*! 27 | \param x_ The X coordinate of the pixel 28 | \param y_ The Y coordinate of the pixel 29 | \param color_ The pixel color (RGB + monochrome) 30 | \param bSetDirtyChunk_ If TRUE, the dirty flag for the pertaining chunk is set 31 | */ 32 | void setPixel(int x_, int y_, const Color& color_, bool invalidate_ = true) override 33 | { 34 | if (x_ >= this->width() || y_ >= this->height() || color_.transparent()) 35 | { 36 | return; 37 | } 38 | 39 | Color oldColor = pixel(x_, y_); 40 | Color newColor = color_; 41 | if (color_.blendMode() == BlendMode::invert) 42 | { 43 | newColor = oldColor; 44 | newColor.invert(); 45 | } 46 | 47 | unsigned byteIndex = (this->canvasWidthInBytes() * y_) + (x_ * 2); 48 | uint8_t green = newColor.green() >> 2; 49 | 50 | this->data()[byteIndex] = ((green << 5) & 0xE0) | (newColor.red() >> 3); 51 | this->data()[byteIndex + 1] = (newColor.blue() & 0xF8) | ((green >> 3) & 0x07); 52 | 53 | if (invalidate_ && oldColor != newColor) 54 | { 55 | Canvas::invalidate(x_, y_); 56 | } 57 | } 58 | 59 | //------------------------------------------------------------------------------------------------ 60 | 61 | //! Get the pixel value as an RGB color 62 | /*! 63 | \param x_ The X coordinate of the pixel 64 | \param y_ The Y coordinate of the pixel 65 | \return The color of the selected pixel 66 | */ 67 | Color pixel(int x_, int y_) const override 68 | { 69 | if (x_ >= this->width() || y_ >= this->height()) 70 | { 71 | return {}; 72 | } 73 | unsigned index = (this->canvasWidthInBytes() * y_) + (x_ * 2); 74 | 75 | return {static_cast((this->data()[index] & 0x1F) << 3), 76 | static_cast((this->data()[index] & 0xE0) | ((this->data()[index + 1] & 0x07) << 2)), 77 | static_cast((this->data()[index + 1] & 0xF8))}; 78 | } 79 | }; 80 | 81 | //-------------------------------------------------------------------------------------------------- 82 | 83 | } // namespace rastr 84 | } // namespace sl 85 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com ####### 7 | 8 | # ------------------------------------------------------------------------------------------------ # 9 | # Unit tests # 10 | # ------------------------------------------------------------------------------------------------ # 11 | 12 | include_directories( ${CATCH_INCLUDE_DIRS} ) 13 | 14 | project(unit-tests) 15 | 16 | set( 17 | test_SRCS 18 | main.cpp 19 | ) 20 | 21 | set( 22 | test_src_SRCS 23 | src/Canvas.cpp 24 | src/CanvasTestFunctions.cpp 25 | src/CanvasTestFunctions.h 26 | src/CanvasTestHelpers.cpp 27 | src/CanvasTestHelpers.h 28 | ) 29 | 30 | set( 31 | test_gfx_displays_SRCS 32 | gfx/displays/TextDisplay7Segments.cpp 33 | gfx/displays/TextDisplayGeneric.cpp 34 | gfx/displays/TextDisplayKompleteKontrol.cpp 35 | gfx/displays/NullCanvas.cpp 36 | gfx/displays/GDisplayMaschineMikro.cpp 37 | gfx/displays/GDisplayMaschineMK1.cpp 38 | gfx/displays/GDisplayMaschineMK2.cpp 39 | gfx/displays/GDisplayPush2.cpp 40 | ) 41 | 42 | set( 43 | test_util_SRCS 44 | util/Color.cpp 45 | ) 46 | 47 | source_group("" FILES ${test_SRCS}) 48 | source_group("src" FILES ${test_src_SRCS}) 49 | 50 | set( 51 | Test_FILES 52 | ${test_SRCS} 53 | ${test_src_SRCS} 54 | ) 55 | 56 | add_executable( 57 | ${PROJECT_NAME} 58 | ${Test_FILES} 59 | ) 60 | 61 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD 62 | COMMAND ${CMAKE_COMMAND} -E copy_directory ${RASTR_ROOT_DIR}/support/test-data $/test-data 63 | ) 64 | 65 | if(COVERALLS) 66 | set_target_properties ( ${PROJECT_NAME} PROPERTIES LINK_FLAGS " -Wall -fprofile-arcs -ftest-coverage") 67 | endif() 68 | 69 | target_include_directories( ${PROJECT_NAME} PRIVATE ${CATCH_INCLUDE_DIRS} ${CMAKE_CURRENT_LIST_DIR} ${RASTR_ROOT_DIR}/src) 70 | target_link_libraries( ${PROJECT_NAME} PRIVATE rastr png) 71 | 72 | set(CATCH_CMDARGS "") 73 | if(RASTRL_TEST_ALL) 74 | set(CATCH_CMDARGS "${CATCH_CMDARGS} -s") 75 | endif() 76 | if(RASTR_TEST_JUNIT) 77 | set(CATCH_CMDARGS "${CATCH_CMDARGS} -r junit -o test-report.junit.xml") 78 | else() 79 | set(CATCH_CMDARGS "${CATCH_CMDARGS} -r compact") 80 | endif() 81 | 82 | if(WIN32) 83 | separate_arguments(CATCH_CMDARGS_LIST WINDOWS_COMMAND "${CATCH_CMDARGS}") 84 | else() 85 | separate_arguments(CATCH_CMDARGS_LIST UNIX_COMMAND "${CATCH_CMDARGS}") 86 | endif() 87 | 88 | add_test( NAME ${PROJECT_NAME} WORKING_DIRECTORY $ COMMAND ${PROJECT_NAME} ${CATCH_CMDARGS_LIST}) 89 | 90 | add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_BUILD_TYPE} DEPENDS ${PROJECT_NAME}) 91 | -------------------------------------------------------------------------------- /test/src/displays/NullCanvas.h: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include "cabl/gfx/CanvasBase.h" 11 | 12 | namespace sl 13 | { 14 | namespace cabl 15 | { 16 | 17 | //-------------------------------------------------------------------------------------------------- 18 | 19 | class NullCanvas : public CanvasBase<0, 0, 0> 20 | { 21 | public: 22 | bool dirty() const override 23 | { 24 | return false; 25 | } 26 | 27 | bool dirtyChunk(unsigned) const override 28 | { 29 | return false; 30 | } 31 | 32 | void resetDirtyFlags() const override 33 | { 34 | } 35 | 36 | void setDirtyChunk(unsigned) const override 37 | { 38 | } 39 | 40 | void white() override 41 | { 42 | } 43 | 44 | void black() override 45 | { 46 | } 47 | 48 | void invert() override 49 | { 50 | } 51 | 52 | void fill(uint8_t) override 53 | { 54 | } 55 | 56 | void line(unsigned, unsigned, unsigned, unsigned, const Color&) override 57 | { 58 | } 59 | 60 | void lineVertical(unsigned, unsigned, unsigned, const Color&) override 61 | { 62 | } 63 | 64 | void lineHorizontal(unsigned, unsigned, unsigned, const Color&) override 65 | { 66 | } 67 | 68 | void triangle( 69 | unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, const Color&) override 70 | { 71 | } 72 | 73 | void triangleFilled(unsigned, 74 | unsigned, 75 | unsigned, 76 | unsigned, 77 | unsigned, 78 | unsigned, 79 | const Color&, 80 | const Color&) override 81 | { 82 | } 83 | 84 | void rectangle(unsigned, unsigned, unsigned, unsigned, const Color&) override 85 | { 86 | } 87 | 88 | void rectangleFilled( 89 | unsigned, unsigned, unsigned, unsigned, const Color&, const Color&) override 90 | { 91 | } 92 | 93 | void rectangleRounded( 94 | unsigned, unsigned, unsigned, unsigned, unsigned, const Color&) override 95 | { 96 | } 97 | 98 | void rectangleRoundedFilled( 99 | unsigned, unsigned, unsigned, unsigned, unsigned, const Color&, const Color&) 100 | override 101 | { 102 | } 103 | 104 | void circle(unsigned, unsigned, unsigned, const Color&, CircleType) override 105 | { 106 | } 107 | 108 | void circleFilled( 109 | unsigned, unsigned, unsigned, const Color&, const Color&, CircleType) override 110 | { 111 | } 112 | 113 | void putBitmap( 114 | unsigned, unsigned, unsigned, unsigned, const uint8_t*, const Color&) override 115 | { 116 | } 117 | 118 | void putCanvas(const Canvas&, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned) override 119 | { 120 | } 121 | 122 | void putCharacter(unsigned, unsigned, char, const Color&, const std::string&) override 123 | { 124 | } 125 | 126 | void putText( 127 | unsigned, unsigned, const char*, const Color&, const std::string&, unsigned) override 128 | { 129 | } 130 | }; 131 | 132 | //-------------------------------------------------------------------------------------------------- 133 | 134 | } // cabl 135 | } // sl 136 | -------------------------------------------------------------------------------- /test/src/displays/GDisplayMaschineMK1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2015 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include "gfx/displays/GDisplayMaschineMK1.h" 9 | 10 | #include "cabl/util/Functions.h" 11 | 12 | //-------------------------------------------------------------------------------------------------- 13 | 14 | namespace sl 15 | { 16 | namespace cabl 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | GDisplayMaschineMK1::GDisplayMaschineMK1() 22 | { 23 | black(); 24 | } 25 | 26 | //-------------------------------------------------------------------------------------------------- 27 | 28 | void GDisplayMaschineMK1::white() 29 | { 30 | fill(0x00); 31 | setDirty(); 32 | } 33 | 34 | //-------------------------------------------------------------------------------------------------- 35 | 36 | void GDisplayMaschineMK1::black() 37 | { 38 | fill(0xff); 39 | setDirty(); 40 | } 41 | 42 | //-------------------------------------------------------------------------------------------------- 43 | 44 | void GDisplayMaschineMK1::setPixel( 45 | int x_, int y_, const Color& color_, bool bSetDirtyChunk_) 46 | { 47 | if (x_ >= width() || y_ >= height() || color_.transparent()) 48 | { 49 | return; 50 | } 51 | 52 | Color oldColor = pixel(x_, y_); 53 | unsigned byteIndex = (canvasWidthInBytes() * y_) + ((x_ / 3) * 2); 54 | uint8_t pixelValue{0}; 55 | if (color_.blendMode() == BlendMode::invert) 56 | { 57 | Color newColor = oldColor; 58 | newColor.invert(); 59 | pixelValue = (static_cast((newColor.mono() / 255.0) * 31 + 0.5f)); 60 | } 61 | else 62 | { 63 | pixelValue = (static_cast((color_.mono() / 255.0) * 31 + 0.5f)); 64 | } 65 | 66 | switch (x_ % 3) 67 | { 68 | case 0: 69 | data()[byteIndex] |= 0xF8; 70 | data()[byteIndex] &= ~(pixelValue << 3); 71 | break; 72 | case 1: 73 | data()[byteIndex] |= 0x07; 74 | data()[byteIndex + 1] |= 0xC0; 75 | data()[byteIndex] &= ~(pixelValue >> 2); 76 | data()[byteIndex + 1] &= ~(pixelValue << 6); 77 | break; 78 | case 2: 79 | data()[byteIndex + 1] |= 0x1F; 80 | data()[byteIndex + 1] &= ~(pixelValue); 81 | break; 82 | } 83 | 84 | if (bSetDirtyChunk_ && oldColor != color_) 85 | { 86 | setDirtyChunk(y_); 87 | } 88 | } 89 | 90 | //-------------------------------------------------------------------------------------------------- 91 | 92 | Color GDisplayMaschineMK1::pixel(int x_, int y_) const 93 | { 94 | if (x_ >= width() || y_ >= height()) 95 | { 96 | return {}; 97 | } 98 | 99 | uint8_t blockIndex = x_ % 3; // 5 bits per pixel, 2 bytes pack 3 pixels 100 | unsigned byteIndex = (canvasWidthInBytes() * y_) + ((x_ / 3) * 2); 101 | uint8_t pixelValue{0}; 102 | switch (blockIndex) 103 | { 104 | case 0: 105 | pixelValue = ~(static_cast((((data()[byteIndex] & 0xF8) >> 3) / 31.0) * 255)); 106 | break; 107 | case 1: 108 | pixelValue = ~(static_cast( 109 | ((((data()[byteIndex] & 0x07) << 2) | (data()[byteIndex + 1] & 0xC0) >> 6) / 31.0) * 255)); 110 | break; 111 | case 2: 112 | pixelValue = ~(static_cast(((data()[byteIndex + 1] & 0x1F) / 31.0) * 255)); 113 | break; 114 | } 115 | 116 | return {pixelValue}; 117 | } 118 | 119 | //-------------------------------------------------------------------------------------------------- 120 | 121 | } // namespace cabl 122 | } // namespace sl 123 | -------------------------------------------------------------------------------- /support/doxygen/sl-doxygen.css: -------------------------------------------------------------------------------- 1 | /* Custom Look and feel - Can be edited 2 | ----------------------------------- */ 3 | #navrow1, #navrow2, #navrow3, #navrow4, #navrow5{ 4 | border-bottom: 1px solid #EEEEEE; 5 | } 6 | 7 | .adjust-right { 8 | margin-left: 30px !important; 9 | font-size: 1.15em !important; 10 | } 11 | 12 | /* DOXYGEN Code Styles - These are from doxygen but can be changed to fit the theme 13 | ----------------------------------- */ 14 | 15 | a.qindex { 16 | font-weight: bold; 17 | } 18 | 19 | a.qindexHL { 20 | font-weight: bold; 21 | background-color: #9CAFD4; 22 | color: #ffffff; 23 | border: 1px double #869DCA; 24 | } 25 | 26 | .contents a.qindexHL:visited { 27 | color: #ffffff; 28 | } 29 | 30 | a.code, a.code:visited, a.line, a.line:visited { 31 | color: #4665A2; 32 | } 33 | 34 | a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { 35 | color: #4665A2; 36 | } 37 | 38 | /* @end */ 39 | 40 | dl.el { 41 | margin-left: -1cm; 42 | } 43 | 44 | pre.fragment { 45 | border: 1px solid #C4CFE5; 46 | background-color: #FBFCFD; 47 | padding: 4px 6px; 48 | margin: 4px 8px 4px 2px; 49 | overflow: auto; 50 | word-wrap: break-word; 51 | font-size: 9pt; 52 | line-height: 125%; 53 | font-family: monospace, fixed; 54 | font-size: 105%; 55 | } 56 | 57 | div.fragment { 58 | padding: 4px 6px; 59 | margin: 4px 8px 4px 2px; 60 | border: 1px solid #C4CFE5; 61 | } 62 | 63 | div.line { 64 | font-family: monospace, fixed; 65 | font-size: 13px; 66 | min-height: 13px; 67 | line-height: 1.0; 68 | text-wrap: unrestricted; 69 | white-space: -moz-pre-wrap; /* Moz */ 70 | white-space: -pre-wrap; /* Opera 4-6 */ 71 | white-space: -o-pre-wrap; /* Opera 7 */ 72 | white-space: pre-wrap; /* CSS3 */ 73 | word-wrap: break-word; /* IE 5.5+ */ 74 | text-indent: -53px; 75 | padding-left: 53px; 76 | padding-bottom: 0px; 77 | margin: 0px; 78 | -webkit-transition-property: background-color, box-shadow; 79 | -webkit-transition-duration: 0.5s; 80 | -moz-transition-property: background-color, box-shadow; 81 | -moz-transition-duration: 0.5s; 82 | -ms-transition-property: background-color, box-shadow; 83 | -ms-transition-duration: 0.5s; 84 | -o-transition-property: background-color, box-shadow; 85 | -o-transition-duration: 0.5s; 86 | transition-property: background-color, box-shadow; 87 | transition-duration: 0.5s; 88 | } 89 | 90 | div.line.glow { 91 | background-color: cyan; 92 | box-shadow: 0 0 10px cyan; 93 | } 94 | 95 | 96 | span.lineno { 97 | padding-right: 4px; 98 | text-align: right; 99 | border-right: 2px solid #0F0; 100 | background-color: #E8E8E8; 101 | white-space: pre; 102 | } 103 | span.lineno a { 104 | background-color: #D8D8D8; 105 | } 106 | 107 | span.lineno a:hover { 108 | background-color: #C8C8C8; 109 | } 110 | 111 | div.groupHeader { 112 | margin-left: 16px; 113 | margin-top: 12px; 114 | font-weight: bold; 115 | } 116 | 117 | div.groupText { 118 | margin-left: 16px; 119 | font-style: italic; 120 | } 121 | 122 | /* @group Code Colorization */ 123 | 124 | span.keyword { 125 | color: #008000 126 | } 127 | 128 | span.keywordtype { 129 | color: #604020 130 | } 131 | 132 | span.keywordflow { 133 | color: #e08000 134 | } 135 | 136 | span.comment { 137 | color: #800000 138 | } 139 | 140 | span.preprocessor { 141 | color: #806020 142 | } 143 | 144 | span.stringliteral { 145 | color: #002080 146 | } 147 | 148 | span.charliteral { 149 | color: #008080 150 | } 151 | 152 | span.vhdldigit { 153 | color: #ff00ff 154 | } 155 | 156 | span.vhdlchar { 157 | color: #000000 158 | } 159 | 160 | span.vhdlkeyword { 161 | color: #700070 162 | } 163 | 164 | span.vhdllogic { 165 | color: #ff0000 166 | } 167 | 168 | blockquote { 169 | background-color: #F7F8FB; 170 | border-left: 2px solid #9CAFD4; 171 | margin: 0 24px 0 4px; 172 | padding: 0 12px 0 16px; 173 | } 174 | 175 | -------------------------------------------------------------------------------- /test/src/Color.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include "catch.hpp" 9 | 10 | #include 11 | 12 | namespace sl 13 | { 14 | namespace rastr 15 | { 16 | namespace test 17 | { 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | TEST_CASE("Color: constructors", "[util][Color]") 22 | { 23 | Color color; 24 | CHECK(color.red() == 0); 25 | CHECK(color.green() == 0); 26 | CHECK(color.blue() == 0); 27 | CHECK(color.mono() == 0); 28 | 29 | Color color2(18); 30 | CHECK(color2.red() == 18); 31 | CHECK(color2.green() == 18); 32 | CHECK(color2.blue() == 18); 33 | CHECK(color2.mono() == 18); 34 | 35 | Color color3(20, 40, 60); 36 | CHECK(color3.red() == 20); 37 | CHECK(color3.green() == 40); 38 | CHECK(color3.blue() == 60); 39 | CHECK(color3.mono() == 60); 40 | 41 | Color color4(20, 40, 60, 80); 42 | CHECK(color4.red() == 20); 43 | CHECK(color4.green() == 40); 44 | CHECK(color4.blue() == 60); 45 | CHECK(color4.mono() == 80); 46 | } 47 | 48 | //-------------------------------------------------------------------------------------------------- 49 | 50 | TEST_CASE("Color: getters/setters", "[util][Color]") 51 | { 52 | Color color; 53 | 54 | color.setRed(22); 55 | color.setGreen(33); 56 | color.setBlue(44); 57 | color.setMono(55); 58 | CHECK(color.red() == 22); 59 | CHECK(color.green() == 33); 60 | CHECK(color.blue() == 44); 61 | CHECK(color.mono() == 55); 62 | CHECK(color.getValue() == 0x16212C); 63 | 64 | color.black(); 65 | CHECK(color.red() == 0); 66 | CHECK(color.green() == 0); 67 | CHECK(color.blue() == 0); 68 | CHECK(color.mono() == 0); 69 | CHECK(color.getValue() == 0); 70 | 71 | color.white(); 72 | CHECK(color.red() == 255); 73 | CHECK(color.green() == 255); 74 | CHECK(color.blue() == 255); 75 | CHECK(color.mono() == 255); 76 | CHECK(color.getValue() == 0xFFFFFF); 77 | } 78 | 79 | //-------------------------------------------------------------------------------------------------- 80 | 81 | TEST_CASE("Color: distance", "[util][Color]") 82 | { 83 | Color color1; 84 | Color color2; 85 | Color color3(127); 86 | 87 | color1.black(); 88 | color2.white(); 89 | CHECK(color2.distance(color1) == color1.distance(color2)); 90 | CHECK(color2.distance(color1) > color3.distance(color2)); 91 | } 92 | 93 | //-------------------------------------------------------------------------------------------------- 94 | 95 | TEST_CASE("Color: comparison", "[util][Color]") 96 | { 97 | Color color1a(12); 98 | Color color1b(12); 99 | Color color2(127); 100 | 101 | CHECK(color1a == color1b); 102 | CHECK(color2 != color1a); 103 | CHECK(color1a <= color2); 104 | CHECK(color1a < color2); 105 | CHECK(color2 > color1a); 106 | CHECK(color2 >= color1a); 107 | CHECK(color2 >= color2); 108 | } 109 | 110 | //-------------------------------------------------------------------------------------------------- 111 | 112 | TEST_CASE("Color: streaming", "[util][Color]") 113 | { 114 | Color color(11, 33, 55, 77); 115 | std::stringstream os; 116 | os << color; 117 | CHECK(os.str() == "11,33,55,77"); 118 | } 119 | 120 | //-------------------------------------------------------------------------------------------------- 121 | 122 | TEST_CASE("Color: blend modes", "[util][Color]") 123 | { 124 | Color color(11, 33, 55, 77); 125 | 126 | color.setBlendMode(BlendMode::invert); 127 | 128 | CHECK(color.red() == static_cast(~(11))); 129 | CHECK(color.green() == static_cast(~(33))); 130 | CHECK(color.blue() == static_cast(~(55))); 131 | CHECK(color.mono() == static_cast(~(77))); 132 | } 133 | 134 | //-------------------------------------------------------------------------------------------------- 135 | 136 | } // namespace test 137 | } // namespace rastr 138 | } // namespace sl 139 | -------------------------------------------------------------------------------- /inc/rastr/Types.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | namespace sl 14 | { 15 | namespace rastr 16 | { 17 | 18 | //-------------------------------------------------------------------------------------------------- 19 | 20 | //! The alignment type 21 | enum class Alignment 22 | { 23 | left, //!< Align to the left 24 | center, //!< Center 25 | right, //!< Align to the right 26 | }; 27 | 28 | //-------------------------------------------------------------------------------------------------- 29 | 30 | //! The blend mode 31 | enum class BlendMode 32 | { 33 | normal, // Normal mode 34 | invert, // Invert the current color 35 | transparent, // Ignore the current color 36 | }; 37 | 38 | //-------------------------------------------------------------------------------------------------- 39 | 40 | struct Bitmap 41 | { 42 | uint16_t width; 43 | uint16_t height; 44 | uint8_t bitsPerPixel; 45 | const uint8_t* data; 46 | }; 47 | 48 | //-------------------------------------------------------------------------------------------------- 49 | 50 | struct Character 51 | { 52 | uint8_t width; 53 | uint8_t height; 54 | int8_t xOffset; 55 | int8_t yOffset; 56 | uint8_t xAdvance; 57 | const uint8_t* data; 58 | }; 59 | 60 | //-------------------------------------------------------------------------------------------------- 61 | 62 | class FontId 63 | { 64 | public: 65 | FontId(const char* name_, unsigned size_) : m_name(name_), m_size(size_) 66 | { 67 | } 68 | 69 | const char* name() const 70 | { 71 | return m_name; 72 | } 73 | unsigned size() const 74 | { 75 | return m_size; 76 | } 77 | 78 | bool operator<(const FontId& id) const 79 | { 80 | if (m_size < id.m_size) 81 | { 82 | return true; 83 | } 84 | return m_name < id.m_name; 85 | } 86 | 87 | private: 88 | const char* m_name; 89 | unsigned m_size; 90 | }; 91 | 92 | //-------------------------------------------------------------------------------------------------- 93 | 94 | struct Font 95 | { 96 | FontId id; 97 | uint8_t bitsPerPixel; 98 | uint8_t lineHeight; 99 | uint8_t firstCharacter; 100 | uint8_t lastCharacter; 101 | 102 | const Character* characters; 103 | }; 104 | 105 | //-------------------------------------------------------------------------------------------------- 106 | 107 | class Rectangle{ 108 | public: 109 | 110 | Rectangle() = default; 111 | 112 | Rectangle(int x_, int y_, unsigned width_, unsigned height_) 113 | : m_x(x_) 114 | , m_y(y_) 115 | , m_width(width_) 116 | , m_height(height_) 117 | { 118 | } 119 | 120 | int x() const noexcept { return m_x; } 121 | void setX(int x_) noexcept { m_x = x_; } 122 | 123 | int y() const noexcept { return m_y; } 124 | void setY(int y_) noexcept { m_y = y_; } 125 | 126 | unsigned width() const noexcept { return m_width; } 127 | void setWidth(unsigned width_) noexcept { m_width = width_; } 128 | 129 | unsigned height() const noexcept { return m_height; } 130 | void setHeight(unsigned height_) noexcept { m_height = height_; } 131 | 132 | void set(int x_, int y_, unsigned width_, unsigned height_) noexcept 133 | { 134 | m_x = x_; 135 | m_y = y_; 136 | m_width = width_; 137 | m_height = height_; 138 | } 139 | 140 | void grow(int x_, int y_, unsigned width_, unsigned height_) noexcept 141 | { 142 | m_x = abs(x_) > abs(m_x) ? x_ : m_x; 143 | m_y = abs(y_) > abs(m_y) ? y_ : m_y; 144 | m_width = width_ > m_width ? width_ : m_width; 145 | m_height = height_ > m_height ? height_ : m_height; 146 | } 147 | 148 | void grow(int x_, int y_) noexcept 149 | { 150 | if(x_ < m_x) 151 | { 152 | auto deltaX = m_x - x_; 153 | m_x = x_; 154 | m_width += deltaX; 155 | } 156 | else if(x_ > static_cast(m_x + m_width)) 157 | { 158 | auto deltaX = x_ - m_width - m_x; 159 | m_width += deltaX; 160 | } 161 | if(y_ < m_y) 162 | { 163 | auto deltaY = m_y - y_; 164 | m_y = y_; 165 | m_height += deltaY; 166 | } 167 | else if(y_ > static_cast(m_y + m_height)) 168 | { 169 | auto deltaY = y_ - m_height - m_y; 170 | m_height += deltaY; 171 | } 172 | } 173 | 174 | void reset() noexcept 175 | { 176 | m_x = 0; 177 | m_y = 0; 178 | m_width = 0U; 179 | m_height = 0U; 180 | } 181 | 182 | operator bool() const noexcept { return m_width > 0 && m_height > 0; } 183 | 184 | private: 185 | int m_x{0}; 186 | int m_y{0}; 187 | unsigned m_width{0U}; 188 | unsigned m_height{0U}; 189 | }; 190 | 191 | } // namespace rastr 192 | } // namespace sl 193 | -------------------------------------------------------------------------------- /support/doxygen/doxy-boot.js: -------------------------------------------------------------------------------- 1 | $( document ).ready(function() { 2 | 3 | $("div.headertitle").addClass("page-header"); 4 | $("div.title").addClass("h1"); 5 | 6 | $('li > a[href="index.html"] > span').before(" "); 7 | $('li > a[href="index.html"] > span').text("rastr"); 8 | $('li > a[href="modules.html"] > span').before(" "); 9 | $('li > a[href="namespaces.html"] > span').before(" "); 10 | $('li > a[href="annotated.html"] > span').before(" "); 11 | $('li > a[href="classes.html"] > span').before(" "); 12 | $('li > a[href="inherits.html"] > span').before(" "); 13 | $('li > a[href="functions.html"] > span').before(" "); 14 | $('li > a[href="functions_func.html"] > span').before(" "); 15 | $('li > a[href="functions_vars.html"] > span').before(" "); 16 | $('li > a[href="functions_enum.html"] > span').before(" "); 17 | $('li > a[href="functions_eval.html"] > span').before(" "); 18 | $('img[src="ftv2ns.png"]').replaceWith('N '); 19 | $('img[src="ftv2cl.png"]').replaceWith('C '); 20 | 21 | $("ul.tablist").addClass("nav nav-pills nav-justified"); 22 | $("ul.tablist").css("margin-top", "0.5em"); 23 | $("ul.tablist").css("margin-bottom", "0.5em"); 24 | $("li.current").addClass("active"); 25 | $("iframe").attr("scrolling", "yes"); 26 | 27 | $("#nav-path > ul").addClass("breadcrumb"); 28 | 29 | $("table.params").addClass("table"); 30 | $("div.ingroups").wrapInner(""); 31 | $("div.levels").css("margin", "0.5em"); 32 | $("div.levels > span").addClass("btn btn-default btn-xs"); 33 | $("div.levels > span").css("margin-right", "0.25em"); 34 | 35 | $("table.directory").addClass("table table-striped"); 36 | $("div.summary > a").addClass("btn btn-default btn-xs"); 37 | $("table.fieldtable").addClass("table"); 38 | $(".fragment").addClass("well"); 39 | $(".memitem").addClass("panel panel-default"); 40 | $(".memproto").addClass("panel-heading"); 41 | $(".memdoc").addClass("panel-body"); 42 | $("span.mlabel").addClass("label label-info"); 43 | 44 | $("table.memberdecls").addClass("table"); 45 | $("[class^=memitem]").addClass("active"); 46 | 47 | $("div.ah").addClass("btn btn-default"); 48 | $("span.mlabels").addClass("pull-right"); 49 | $("table.mlabels").css("width", "100%") 50 | $("td.mlabels-right").addClass("pull-right"); 51 | 52 | $("div.ttc").addClass("panel panel-primary"); 53 | $("div.ttname").addClass("panel-heading"); 54 | $("div.ttname a").css("color", 'white'); 55 | $("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body"); 56 | 57 | $('#MSearchBox').parent().remove(); 58 | 59 | $('div.fragment.well div.line:first').css('margin-top', '15px'); 60 | $('div.fragment.well div.line:last').css('margin-bottom', '15px'); 61 | 62 | $('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){ 63 | $(this).prepend(''); 64 | $(this).find('tbody > tr:first').prependTo($(this).find('thead')); 65 | 66 | $(this).find('td > span.success').parent().addClass('success'); 67 | $(this).find('td > span.warning').parent().addClass('warning'); 68 | $(this).find('td > span.danger').parent().addClass('danger'); 69 | }); 70 | 71 | 72 | 73 | if($('div.fragment.well div.ttc').length > 0) 74 | { 75 | $('div.fragment.well div.line:first').parent().removeClass('fragment well'); 76 | } 77 | 78 | $('table.memberdecls').find('.memItemRight').each(function(){ 79 | $(this).contents().appendTo($(this).siblings('.memItemLeft')); 80 | $(this).siblings('.memItemLeft').attr('align', 'left'); 81 | }); 82 | 83 | function getOriginalWidthOfImg(img_element) { 84 | var t = new Image(); 85 | t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src; 86 | return t.width; 87 | } 88 | 89 | $('div.dyncontent').find('img').each(function(){ 90 | if(getOriginalWidthOfImg($(this)[0]) > $('#content>div.container').width()) 91 | $(this).css('width', '100%'); 92 | }); 93 | 94 | $(".memitem").removeClass('memitem'); 95 | $(".memproto").removeClass('memproto'); 96 | $(".memdoc").removeClass('memdoc'); 97 | $("span.mlabel").removeClass('mlabel'); 98 | $("table.memberdecls").removeClass('memberdecls'); 99 | $("[class^=memitem]").removeClass('memitem'); 100 | $("span.mlabels").removeClass('mlabels'); 101 | $("table.mlabels").removeClass('mlabels'); 102 | $("td.mlabels-right").removeClass('mlabels-right'); 103 | $(".navpath").removeClass('navpath'); 104 | $("li.navelem").removeClass('navelem'); 105 | $("a.el").removeClass('el'); 106 | $("div.ah").removeClass('ah'); 107 | $("div.header").removeClass("header"); 108 | 109 | $('.mdescLeft').each(function(){ 110 | if($(this).html()==" ") { 111 | $(this).siblings('.mdescRight').attr('colspan', 2); 112 | $(this).remove(); 113 | } 114 | }); 115 | $('td.memItemLeft').each(function(){ 116 | if($(this).siblings('.memItemRight').html()=="") { 117 | $(this).attr('colspan', 2); 118 | $(this).siblings('.memItemRight').remove(); 119 | } 120 | }); 121 | }); 122 | -------------------------------------------------------------------------------- /test/src/CanvasTestHelpers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include "CanvasTestHelpers.h" 9 | 10 | #include 11 | 12 | #define PNG_DEBUG 3 13 | #include 14 | 15 | 16 | //-------------------------------------------------------------------------------------------------- 17 | 18 | namespace sl 19 | { 20 | namespace rastr 21 | { 22 | namespace test 23 | { 24 | 25 | //-------------------------------------------------------------------------------------------------- 26 | 27 | PngCanvas::PngCanvas() : DynamicCanvas(0, 0) 28 | { 29 | } 30 | 31 | //-------------------------------------------------------------------------------------------------- 32 | 33 | PngCanvas::PngCanvas(unsigned w_, unsigned h_, unsigned size_) 34 | : DynamicCanvas(w_, h_, size_) 35 | { 36 | } 37 | 38 | //-------------------------------------------------------------------------------------------------- 39 | 40 | void PngCanvas::read(const std::string& fileName_) 41 | { 42 | unsigned char header[8]; // 8 is the maximum size that can be checked 43 | 44 | FILE* fp = fopen(fileName_.c_str(), "rb"); 45 | if (!fp) 46 | { 47 | throw std::runtime_error(fileName_ + " could not be opened for reading"); 48 | } 49 | fread(header, 1, 8, fp); 50 | if (png_sig_cmp(static_cast(header), 0, 8)) 51 | { 52 | throw std::runtime_error(fileName_ + " is not recognized as a PNG file"); 53 | } 54 | 55 | auto png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 56 | 57 | if (!png_ptr) 58 | { 59 | throw std::runtime_error("png_create_read_struct failed"); 60 | } 61 | auto info_ptr = png_create_info_struct(png_ptr); 62 | if (!info_ptr) 63 | { 64 | throw std::runtime_error("png_create_info_struct failed"); 65 | } 66 | if (setjmp(png_jmpbuf(png_ptr))) 67 | { 68 | throw std::runtime_error("Error during init_io"); 69 | } 70 | 71 | png_init_io(png_ptr, fp); 72 | png_set_sig_bytes(png_ptr, 8); 73 | 74 | png_read_info(png_ptr, info_ptr); 75 | 76 | const auto width = png_get_image_width(png_ptr, info_ptr); 77 | const auto height = png_get_image_height(png_ptr, info_ptr); 78 | png_read_update_info(png_ptr, info_ptr); 79 | 80 | if (setjmp(png_jmpbuf(png_ptr))) 81 | { 82 | throw std::runtime_error("Error while reading image"); 83 | } 84 | 85 | auto* rows = (png_bytep*)malloc(sizeof(png_bytep) * height); 86 | const auto bytesPerRow = png_get_rowbytes(png_ptr, info_ptr); 87 | resize(width, height, bytesPerRow * height); 88 | 89 | for (auto y = 0; y < height; y++) 90 | { 91 | rows[y] = data() + (y * bytesPerRow); 92 | } 93 | 94 | png_read_image(png_ptr, &rows[0]); 95 | 96 | free(rows); 97 | 98 | fclose(fp); 99 | } 100 | 101 | //-------------------------------------------------------------------------------------------------- 102 | 103 | void PngCanvas::write(const std::string& fileName_) 104 | { 105 | FILE* fp = fopen(fileName_.c_str(), "wb"); 106 | if (!fp) 107 | abort(); 108 | 109 | png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 110 | if (!png) 111 | abort(); 112 | 113 | png_infop info = png_create_info_struct(png); 114 | if (!info) 115 | abort(); 116 | 117 | if (setjmp(png_jmpbuf(png))) 118 | abort(); 119 | 120 | png_init_io(png, fp); 121 | 122 | png_set_IHDR(png, 123 | info, 124 | width(), 125 | height(), 126 | 8, 127 | PNG_COLOR_TYPE_RGB, 128 | PNG_INTERLACE_NONE, 129 | PNG_COMPRESSION_TYPE_DEFAULT, 130 | PNG_FILTER_TYPE_DEFAULT); 131 | png_write_info(png, info); 132 | 133 | auto* rows = (png_bytep*)malloc(sizeof(png_bytep) * height()); 134 | const auto bytesPerRow = png_get_rowbytes(png, info); 135 | 136 | for (auto y = 0; y < height(); y++) 137 | { 138 | rows[y] = data() + (bytesPerRow * y); 139 | } 140 | 141 | png_write_image(png, rows); 142 | png_write_end(png, NULL); 143 | 144 | free(rows); 145 | 146 | fclose(fp); 147 | } 148 | 149 | //-------------------------------------------------------------------------------------------------- 150 | 151 | bool matchColorForAllPixels(const Canvas* canvas_, const Color& color_) 152 | { 153 | for (unsigned x = 0U; x < canvas_->width(); x++) 154 | { 155 | for (unsigned y = 0U; y < canvas_->height(); y++) 156 | { 157 | if (color_ != canvas_->pixel(x, y)) 158 | { 159 | return false; 160 | } 161 | } 162 | } 163 | return true; 164 | } 165 | 166 | //-------------------------------------------------------------------------------------------------- 167 | 168 | bool compare(const Canvas* c1_, const Canvas* c2_) 169 | { 170 | if (c1_->width() != c2_->width() || c1_->height() != c2_->height()) 171 | { 172 | return false; 173 | } 174 | for (unsigned x = 0U; x < c1_->width(); x++) 175 | { 176 | for (unsigned y = 0U; y < c1_->height(); y++) 177 | { 178 | if (c1_->pixel(x, y) != c2_->pixel(x, y)) 179 | { 180 | return false; 181 | } 182 | } 183 | } 184 | 185 | return true; 186 | } 187 | 188 | //-------------------------------------------------------------------------------------------------- 189 | 190 | } // namespace test 191 | } // namespace rastr 192 | } // namespace sl 193 | -------------------------------------------------------------------------------- /test/src/Canvas.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include 9 | 10 | #include "CanvasTestFunctions.h" 11 | #include "CanvasTestHelpers.h" 12 | 13 | #include 14 | #include 15 | 16 | 17 | #include 18 | 19 | //-------------------------------------------------------------------------------------------------- 20 | 21 | namespace sl 22 | { 23 | namespace rastr 24 | { 25 | namespace test 26 | { 27 | 28 | //-------------------------------------------------------------------------------------------------- 29 | 30 | namespace 31 | { 32 | 33 | std::string pngFileName(const std::string& test_) 34 | { 35 | return "test-data/Canvas-" + test_ + ".png"; 36 | } 37 | 38 | } // namespace 39 | 40 | //-------------------------------------------------------------------------------------------------- 41 | 42 | TEST_CASE("Canvas: constructor", "[gfx][Canvas]") 43 | { 44 | StaticCanvas<16, 5> c; 45 | CHECK(c.width() == 16); 46 | CHECK(c.height() == 5); 47 | CHECK(c.invalidRegion()); 48 | c.resetInvalidRegion(); 49 | CHECK_FALSE(c.invalidRegion()); 50 | c.setPixel(2,2,Color(0xff)); 51 | CHECK(c.invalidRegion()); 52 | 53 | CHECK(c.pixel(2, 2) == Color(0xff)); 54 | CHECK(c.pixel(2000, 2000) == Color()); 55 | } 56 | 57 | //-------------------------------------------------------------------------------------------------- 58 | 59 | TEST_CASE("Canvas: lines", "[gfx][Canvas]") 60 | { 61 | PngCanvas display{128, 128}; 62 | PngCanvas displayFromPng; 63 | lines(&display); 64 | std::string fileNameSuffix("lines"); 65 | #ifdef DO_WRITE_PICTURES 66 | REQUIRE_NOTHROW(display.write(pngFileName(fileNameSuffix))); 67 | #endif 68 | REQUIRE_NOTHROW(displayFromPng.read(pngFileName(fileNameSuffix))); 69 | 70 | CHECK(compare(&display, &displayFromPng)); 71 | } 72 | 73 | //-------------------------------------------------------------------------------------------------- 74 | 75 | TEST_CASE("Canvas: circles", "[gfx][Canvas]") 76 | { 77 | PngCanvas display{128, 128}; 78 | PngCanvas displayFromPng; 79 | circles(&display); 80 | std::string fileNameSuffix("circles"); 81 | #ifdef DO_WRITE_PICTURES 82 | REQUIRE_NOTHROW(display.write(pngFileName(fileNameSuffix))); 83 | #endif 84 | REQUIRE_NOTHROW(displayFromPng.read(pngFileName(fileNameSuffix))); 85 | 86 | CHECK(compare(&display, &displayFromPng)); 87 | } 88 | 89 | //-------------------------------------------------------------------------------------------------- 90 | 91 | TEST_CASE("Canvas: triangles", "[gfx][Canvas]") 92 | { 93 | PngCanvas display{128, 128}; 94 | PngCanvas displayFromPng; 95 | triangles(&display); 96 | std::string fileNameSuffix("triangles"); 97 | #ifdef DO_WRITE_PICTURES 98 | REQUIRE_NOTHROW(display.write(pngFileName(fileNameSuffix))); 99 | #endif 100 | REQUIRE_NOTHROW(displayFromPng.read(pngFileName(fileNameSuffix))); 101 | 102 | CHECK(compare(&display, &displayFromPng)); 103 | } 104 | 105 | //-------------------------------------------------------------------------------------------------- 106 | 107 | TEST_CASE("Canvas: rectangles", "[gfx][Canvas]") 108 | { 109 | PngCanvas display{128, 128}; 110 | PngCanvas displayFromPng; 111 | rectangles(&display); 112 | std::string fileNameSuffix("rectangles"); 113 | 114 | REQUIRE_NOTHROW(display.write(pngFileName(fileNameSuffix))); 115 | REQUIRE_NOTHROW(displayFromPng.read(pngFileName(fileNameSuffix))); 116 | 117 | CHECK(compare(&display, &displayFromPng)); 118 | } 119 | 120 | //-------------------------------------------------------------------------------------------------- 121 | 122 | TEST_CASE("Canvas: text", "[gfx][Canvas]") 123 | { 124 | PngCanvas display{128, 128}; 125 | PngCanvas displayFromPng; 126 | text(&display); 127 | std::string fileNameSuffix("text"); 128 | #ifdef DO_WRITE_PICTURES 129 | REQUIRE_NOTHROW(display.write(pngFileName(fileNameSuffix))); 130 | #endif 131 | REQUIRE_NOTHROW(displayFromPng.read(pngFileName(fileNameSuffix))); 132 | 133 | CHECK(compare(&display, &displayFromPng)); 134 | } 135 | 136 | //-------------------------------------------------------------------------------------------------- 137 | 138 | TEST_CASE("Canvas: canvas", "[gfx][Canvas]") 139 | { 140 | PngCanvas display{128, 128}; 141 | PngCanvas displayFromPng; 142 | canvas(&display); 143 | std::string fileNameSuffix("canvas"); 144 | #ifdef DO_WRITE_PICTURES 145 | REQUIRE_NOTHROW(display.write(pngFileName(fileNameSuffix))); 146 | #endif 147 | REQUIRE_NOTHROW(displayFromPng.read(pngFileName(fileNameSuffix))); 148 | 149 | CHECK(compare(&display, &displayFromPng)); 150 | } 151 | 152 | //-------------------------------------------------------------------------------------------------- 153 | 154 | TEST_CASE("Canvas: bitmap", "[gfx][Canvas]") 155 | { 156 | PngCanvas display{128, 128}; 157 | PngCanvas displayFromPng; 158 | bitmap(&display); 159 | std::string fileNameSuffix("bitmap"); 160 | #ifdef DO_WRITE_PICTURES 161 | REQUIRE_NOTHROW(display.write(pngFileName(fileNameSuffix))); 162 | #endif 163 | REQUIRE_NOTHROW(displayFromPng.read(pngFileName(fileNameSuffix))); 164 | 165 | CHECK(compare(&display, &displayFromPng)); 166 | } 167 | 168 | //-------------------------------------------------------------------------------------------------- 169 | 170 | } // namespace test 171 | } // namespace rastr 172 | } // namespace sl 173 | -------------------------------------------------------------------------------- /inc/rastr/Color.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2017 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #pragma once 9 | 10 | // ------------------------------------------------------------------------------------------------- 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | // ------------------------------------------------------------------------------------------------- 18 | 19 | namespace sl 20 | { 21 | namespace rastr 22 | { 23 | 24 | // ------------------------------------------------------------------------------------------------- 25 | 26 | class Color 27 | { 28 | public: 29 | //------------------------------------------------------------------------------------------------ 30 | 31 | Color() : m_blendMode(BlendMode::transparent) 32 | { 33 | } 34 | 35 | //------------------------------------------------------------------------------------------------ 36 | 37 | explicit Color(const BlendMode blendMode_) : m_blendMode(blendMode_) 38 | { 39 | } 40 | 41 | //------------------------------------------------------------------------------------------------ 42 | 43 | explicit Color(const uint8_t mono_) : Color(mono_, mono_, mono_, 0xFF) 44 | { 45 | } 46 | 47 | //------------------------------------------------------------------------------------------------ 48 | 49 | Color(const Color& color_, const uint8_t level_) : m_alpha(level_) 50 | { 51 | m_red = color_.red() == 0 ? 0 : static_cast(level_ * (color_.red()) >> 8); 52 | m_green = color_.green() == 0 ? 0 : static_cast(level_ * (color_.green()) >> 8); 53 | m_blue = color_.blue() == 0 ? 0 : static_cast(level_ * (color_.blue()) >> 8); 54 | } 55 | 56 | //------------------------------------------------------------------------------------------------ 57 | 58 | Color(const uint8_t red_, uint8_t const green_, const uint8_t blue_) 59 | : Color(red_, green_, blue_, 0xFF) 60 | { 61 | } 62 | 63 | //------------------------------------------------------------------------------------------------ 64 | 65 | Color(const uint8_t red_, const uint8_t green_, const uint8_t blue_, const uint8_t alpha_) 66 | : m_red(red_) 67 | , m_green(green_) 68 | , m_blue(blue_) 69 | , m_alpha(alpha_) 70 | , m_mono(util::nmax(red_, green_, blue_)) // Max decomposition: take the highest value 71 | { 72 | } 73 | 74 | //------------------------------------------------------------------------------------------------ 75 | 76 | uint8_t red() const 77 | { 78 | return (m_blendMode == BlendMode::invert) ? ~m_red : m_red; 79 | } 80 | 81 | //------------------------------------------------------------------------------------------------ 82 | 83 | uint8_t green() const 84 | { 85 | return (m_blendMode == BlendMode::invert) ? ~m_green : m_green; 86 | } 87 | 88 | //------------------------------------------------------------------------------------------------ 89 | 90 | uint8_t blue() const 91 | { 92 | return (m_blendMode == BlendMode::invert) ? ~m_blue : m_blue; 93 | } 94 | 95 | //------------------------------------------------------------------------------------------------ 96 | 97 | uint8_t alpha() const 98 | { 99 | return m_alpha; 100 | } 101 | 102 | //------------------------------------------------------------------------------------------------ 103 | 104 | uint8_t mono() const 105 | { 106 | return m_mono; 107 | } 108 | 109 | //------------------------------------------------------------------------------------------------ 110 | 111 | bool active() const 112 | { 113 | return util::nmax(m_red, m_green, m_blue) > 127; 114 | } 115 | //------------------------------------------------------------------------------------------------ 116 | 117 | BlendMode blendMode() const 118 | { 119 | return m_blendMode; 120 | } 121 | //------------------------------------------------------------------------------------------------ 122 | 123 | bool transparent() const 124 | { 125 | return m_blendMode == BlendMode::transparent; 126 | } 127 | 128 | //------------------------------------------------------------------------------------------------ 129 | 130 | void setRed(const uint8_t red_) 131 | { 132 | m_red = red_; 133 | } 134 | 135 | //------------------------------------------------------------------------------------------------ 136 | 137 | void setGreen(const uint8_t green_) 138 | { 139 | m_green = green_; 140 | } 141 | 142 | //------------------------------------------------------------------------------------------------ 143 | 144 | void setBlue(const uint8_t blue_) 145 | { 146 | m_blue = blue_; 147 | } 148 | 149 | //------------------------------------------------------------------------------------------------ 150 | 151 | void setAlpha(const uint8_t alpha_) 152 | { 153 | m_alpha = alpha_; 154 | } 155 | 156 | //------------------------------------------------------------------------------------------------ 157 | 158 | void setBlendMode(const BlendMode blendMode_) 159 | { 160 | m_blendMode = blendMode_; 161 | } 162 | 163 | //------------------------------------------------------------------------------------------------ 164 | 165 | void black() 166 | { 167 | m_alpha = 0xFF; 168 | m_red = m_blue = m_green = m_mono = 0; 169 | m_blendMode = BlendMode::normal; 170 | } 171 | 172 | //------------------------------------------------------------------------------------------------ 173 | 174 | void white() 175 | { 176 | m_red = m_blue = m_green = m_alpha = m_mono = 0xFF; 177 | m_blendMode = BlendMode::normal; 178 | } 179 | 180 | //------------------------------------------------------------------------------------------------ 181 | 182 | void invert() 183 | { 184 | m_red ^= 0xFF; 185 | m_green ^= 0xFF; 186 | m_blue ^= 0xFF; 187 | m_mono ^= 0xFF; 188 | } 189 | 190 | 191 | //------------------------------------------------------------------------------------------------ 192 | 193 | bool operator==(const Color& other_) const 194 | { 195 | return (m_red == other_.m_red) && (m_green == other_.m_green) && (m_blue == other_.m_blue) 196 | && (m_alpha == other_.m_alpha) && (m_blendMode == other_.m_blendMode); 197 | } 198 | 199 | //------------------------------------------------------------------------------------------------ 200 | 201 | bool operator!=(const Color& other_) const 202 | { 203 | return !(operator==(other_)); 204 | } 205 | 206 | //------------------------------------------------------------------------------------------------ 207 | 208 | bool operator<(const Color& other_) const 209 | { 210 | return getValue() < other_.getValue() && m_alpha < other_.m_alpha 211 | && m_blendMode <= other_.m_blendMode; 212 | } 213 | 214 | //------------------------------------------------------------------------------------------------ 215 | 216 | bool operator<=(const Color& other_) const 217 | { 218 | return getValue() <= other_.getValue() && m_alpha <= other_.m_alpha 219 | && m_blendMode <= other_.m_blendMode; 220 | } 221 | 222 | //------------------------------------------------------------------------------------------------ 223 | 224 | bool operator>(const Color& other_) const 225 | { 226 | return getValue() > other_.getValue() && m_alpha > other_.m_alpha 227 | && m_blendMode >= other_.m_blendMode; 228 | } 229 | 230 | //------------------------------------------------------------------------------------------------ 231 | 232 | bool operator>=(const Color& other_) const 233 | { 234 | return getValue() >= other_.getValue() && m_alpha >= other_.m_alpha 235 | && m_blendMode >= other_.m_blendMode; 236 | } 237 | 238 | //------------------------------------------------------------------------------------------------ 239 | 240 | uint32_t getValue() const 241 | { 242 | return (static_cast(m_red) << 16) | (static_cast(m_green) << 8) | m_blue; 243 | } 244 | 245 | //------------------------------------------------------------------------------------------------ 246 | 247 | private: 248 | uint8_t m_red{0U}; 249 | uint8_t m_green{0U}; 250 | uint8_t m_blue{0U}; 251 | uint8_t m_alpha{255U}; 252 | uint8_t m_mono{0U}; 253 | BlendMode m_blendMode{BlendMode::normal}; 254 | }; 255 | 256 | // ------------------------------------------------------------------------------------------------- 257 | 258 | } // namespace rastr 259 | } // namespace sl 260 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com ####### 7 | 8 | cmake_minimum_required (VERSION 3.1) 9 | project (rastr) 10 | 11 | set(RASTR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}) 12 | set(RASTR_BUILD_DIR ${CMAKE_BINARY_DIR}) 13 | set(RASTR_MODULES_DIR ${RASTR_ROOT_DIR}/modules) 14 | 15 | if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) 16 | set(IS_RASTR ON) 17 | else() 18 | set(IS_RASTR OFF) 19 | endif() 20 | 21 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules") 22 | 23 | if(IS_RASTR) 24 | include(colors) 25 | endif() 26 | 27 | set( CMAKE_CXX_STANDARD 11 ) 28 | 29 | # Options ---------------------------------------------------------------------------------------- # 30 | 31 | option( BUILD_SHARED_LIBS "Build as shared library" OFF ) 32 | option( BUILD_STATIC_LIBS "Build as static library" ON ) 33 | 34 | option( RASTR_FORCE_BUILD_DEPENDENCIES "Force download and build dependencies" OFF) 35 | 36 | option( RASTR_TOOLS "Build rastr tools" ${IS_RASTR} ) 37 | option( RASTR_TEST "Build rastr tests" ${IS_RASTR} ) 38 | option( RASTR_DOCS "Build rastr docs" ${IS_RASTR} ) 39 | 40 | option( COVERALLS "Turn on Coveralls support" OFF ) 41 | option( COVERALLS_UPLOAD "Upload the generated Coveralls json" ON ) 42 | 43 | option( RASTR_TEST_ALL "Generate test ouput for successful tests as well" OFF ) 44 | option( RASTR_TEST_JUNIT "Generate a JUNIT xml test report" OFF ) 45 | option( RASTR_INSTALL_PATH "/usr/local/include/") 46 | 47 | 48 | # Dependencies ----------------------------------------------------------------------------------- # 49 | 50 | if(${RASTR_TOOLS} OR ${RASTR_TEST}) 51 | 52 | set(Boost_USE_STATIC_LIBS OFF) 53 | set(Boost_USE_MULTITHREADED ON) 54 | set(Boost_USE_STATIC_RUNTIME OFF) 55 | find_package(Boost 1.62.0 COMPONENTS system filesystem REQUIRED) 56 | if(UNIX AND NOT ${RASTR_FORCE_BUILD_DEPENDENCIES}) 57 | include(FindPNG REQUIRED) 58 | else() 59 | set(PNG_TESTS OFF) 60 | add_subdirectory(${RASTR_MODULES_DIR}/libpng) 61 | endif() 62 | 63 | endif() 64 | 65 | set(CATCH_INCLUDE_DIRS ${RASTR_MODULES_DIR}/catch2/single_include ) 66 | set(CLARA_INCLUDE_DIRS ${RASTR_MODULES_DIR}/clara/single_include ) 67 | 68 | 69 | # Version ---------------------------------------------------------------------------------------- # 70 | 71 | string(TIMESTAMP RASTR_BUILD_DATE "%Y-%m-%d") 72 | 73 | 74 | set (RASTR_VERSION_MAJOR 0) 75 | set (RASTR_VERSION_MINOR 1) 76 | set (RASTR_VERSION_MICRO 1) 77 | set (RASTR_VERSION_STRING "${RASTR_VERSION_MAJOR}.${RASTR_VERSION_MINOR}.${RASTR_VERSION_MICRO}") 78 | 79 | if($ENV{APPVEYOR}) 80 | set (RASTR_BUILD_HOST "Appveyor") 81 | set (RASTR_BUILD_NUMBER ".$ENV{APPVEYOR_BUILD_NUMBER}") 82 | set (RASTR_GIT_BRANCH $ENV{APPVEYOR_REPO_BRANCH}) 83 | execute_process(COMMAND appveyor UpdateBuild -Version ${RASTR_VERSION_STRING}) 84 | elseif($ENV{TRAVIS}) 85 | set (RASTR_BUILD_HOST "Travis-CI") 86 | set (RASTR_BUILD_NUMBER ".$ENV{TRAVIS_BUILD_NUMBER}") 87 | set (RASTR_GIT_BRANCH $ENV{TRAVIS_BRANCH}) 88 | else() 89 | set (RASTR_BUILD_HOST "a local machine") 90 | set (RASTR_BUILD_NUMBER "") 91 | execute_process( 92 | COMMAND git rev-parse --abbrev-ref HEAD 93 | WORKING_DIRECTORY ${RASTR_ROOT_DIR} 94 | OUTPUT_VARIABLE RASTR_GIT_BRANCH 95 | OUTPUT_STRIP_TRAILING_WHITESPACE 96 | ) 97 | endif() 98 | 99 | if(${RASTR_GIT_BRANCH} STREQUAL "master") 100 | set(RASTR_BUILD_TYPE "release version") 101 | set (RASTR_VERSION_STRING "${RASTR_VERSION_STRING}${RASTR_BUILD_NUMBER}") 102 | elseif(${RASTR_GIT_BRANCH} STREQUAL "develop") 103 | set(RASTR_BUILD_TYPE "development version") 104 | set (RASTR_VERSION_STRING "${RASTR_VERSION_STRING}${RASTR_BUILD_NUMBER}-dev") 105 | else() 106 | set(RASTR_BUILD_TYPE "development version from feature branch: ${GIT_BRANCH}") 107 | set (RASTR_VERSION_STRING "${RASTR_VERSION_STRING}${RASTR_BUILD_NUMBER}-fb") 108 | endif() 109 | 110 | configure_file ( 111 | "${RASTR_ROOT_DIR}/support/rastr.h.in" 112 | "${CMAKE_CURRENT_BINARY_DIR}/rastr.h" 113 | ) 114 | 115 | if($ENV{APPVEYOR}) 116 | execute_process(COMMAND appveyor UpdateBuild -Version ${RASTR_VERSION_STRING}) 117 | set(ENV{APPVEYOR_BUILD_VERSION} "${RASTR_VERSION_STRING}") 118 | endif() 119 | 120 | if(IS_RASTR) 121 | message( "${White}") 122 | message( "${White} ,-. ,-. ,-. |- ,-. ") 123 | message( "${White} | ,-| `-. | | ") 124 | message( "${White} ' `-^ `-' `' ' ") 125 | set(RASTR_BUILD_DESCRIPTION "${Magenta}a tiny graphic library${ColourReset}") 126 | message( " ${RASTR_BUILD_DESCRIPTION} ") 127 | message( " v. ${RASTR_VERSION_STRING}") 128 | message( " ") 129 | message( " ") 130 | message( " ${RASTR_BUILD_TYPE} built on ${RASTR_BUILD_HOST} (${RASTR_BUILD_DATE})") 131 | message( " ") 132 | message( " ") 133 | endif() 134 | 135 | # Source files ----------------------------------------------------------------------------------- # 136 | 137 | set( 138 | inc_rastr_INCLUDES 139 | inc/rastr/Canvas.hpp 140 | inc/rastr/CanvasMonochrome.hpp 141 | inc/rastr/CanvasGrayscale8.hpp 142 | inc/rastr/CanvasRGB565.hpp 143 | inc/rastr/CanvasRGB888.hpp 144 | inc/rastr/Color.hpp 145 | inc/rastr/StaticCanvas.hpp 146 | inc/rastr/DynamicCanvas.hpp 147 | inc/rastr/Types.hpp 148 | ) 149 | source_group("inc\\rastr" FILES ${inc_rastr_INCLUDES}) 150 | 151 | set( 152 | rastr_ALL 153 | ${inc_rastr_INCLUDES} 154 | ) 155 | 156 | add_library( rastr INTERFACE ) 157 | target_include_directories( rastr INTERFACE inc "${CMAKE_CURRENT_BINARY_DIR}" ) 158 | 159 | # OS X and Linux --------------------------------------------------------------------------------- # 160 | 161 | if( UNIX ) 162 | 163 | if(${IS_RASTR}) 164 | 165 | install (DIRECTORY inc/rastr DESTINATION "${RASTR_INSTALL_PATH}") 166 | 167 | install ( 168 | FILES "${CMAKE_CURRENT_BINARY_DIR}/rastr.h" 169 | DESTINATION "${RASTR_INSTALL_PATH}/" 170 | ) 171 | endif() 172 | 173 | endif() 174 | 175 | 176 | # Tools ------------------------------------------------------------------------------------------ # 177 | 178 | if(${RASTR_TOOLS}) 179 | add_subdirectory(tools) 180 | endif() 181 | 182 | 183 | # Unit tests ------------------------------------------------------------------------------------- # 184 | 185 | if(${RASTR_TEST}) 186 | enable_testing(true) 187 | add_subdirectory(test) 188 | endif() 189 | 190 | 191 | # Coveralls -------------------------------------------------------------------------------------- # 192 | 193 | if(COVERALLS) 194 | include(Coveralls) 195 | message("Coverage build enabled") 196 | addCoverallsCMake() 197 | list(APPEND CMAKE_MODULE_PATH "${COVERALLS_CMAKE_PATH}") 198 | include(Coveralls) 199 | coveralls_turn_on_coverage() 200 | coveralls_setup( 201 | "${RASTR_ALL}" 202 | ${COVERALLS_UPLOAD} 203 | "${COVERALLS_CMAKE_PATH}" 204 | ) 205 | endif() 206 | 207 | # If Doxygen is not available, just display a warning and skip the documentation target 208 | if(${RASTR_DOCS}) 209 | find_package(Doxygen) 210 | if(NOT DOXYGEN_FOUND) 211 | message(WARNING "Doxygen has not been found, the documentation will not be created.") 212 | set(RASTR_DOCS OFF) 213 | endif() 214 | endif() 215 | 216 | 217 | # Arduino/Teensy specific ------------------------------------------------------------------------ # 218 | 219 | if(${IS_RASTR} AND UNIX) 220 | add_custom_target( CreateArduinoLibrary 221 | command ${CMAKE_SOURCE_DIR}/arduinify.sh ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} 222 | ) 223 | configure_file ( 224 | "${PROJECT_SOURCE_DIR}/support/arduino/library.properties.in" 225 | "${PROJECT_BINARY_DIR}/library.properties" 226 | ) 227 | endif() 228 | 229 | 230 | # Documentation (doxygen) ------------------------------------------------------------------------ # 231 | 232 | if(${RASTR_DOCS}) 233 | 234 | if(NOT DOXYGEN_FOUND) 235 | 236 | message(FATAL_ERROR "Doxygen is needed to build the documentation.") 237 | 238 | else() 239 | 240 | set( doxyfile_in ${RASTR_ROOT_DIR}/support/doxygen/Doxyfile.in ) 241 | set( doxyfile "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" ) 242 | 243 | set( doxy_project_name ${PROJECT_NAME} ) 244 | set( doxy_input_folder ${PROJECT_SOURCE_DIR}/inc ) 245 | set( doxy_output_root ${PROJECT_SOURCE_DIR}/docs ) 246 | set( doxy_readme_md ${PROJECT_SOURCE_DIR}/README.md ) 247 | 248 | set( doxy_html_root ${PROJECT_SOURCE_DIR}/support/doxygen ) 249 | 250 | set( doxy_project_version "v. ${RASTR_VERSION_MAJOR}.${RASTR_VERSION_MINOR}.${RASTR_VERSION_MICRO}") 251 | 252 | configure_file( ${doxyfile_in} ${doxyfile} @ONLY ) 253 | 254 | add_custom_target( 255 | doc 256 | COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} 257 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 258 | COMMENT "Generating API documentation with Doxygen" 259 | VERBATIM 260 | ) 261 | 262 | endif() 263 | endif() 264 | -------------------------------------------------------------------------------- /tools/rastr-png.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2018 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include 9 | 10 | #define PNG_DEBUG 3 11 | #include 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | //-------------------------------------------------------------------------------------------------- 33 | 34 | std::string variableName(std::string str) 35 | { 36 | str.erase( 37 | std::remove_if( 38 | str.begin(), str.end(), [](unsigned char const& c) -> bool { return !std::isalnum(c); }), 39 | str.end()); 40 | 41 | return str; 42 | } 43 | 44 | //-------------------------------------------------------------------------------------------------- 45 | 46 | class Picture 47 | { 48 | public: 49 | Picture(const std::string& filename) 50 | { 51 | unsigned char header[8]; // 8 is the maximum size that can be checked 52 | 53 | FILE* fp = fopen(filename.c_str(), "rb"); 54 | if (!fp) 55 | { 56 | throw std::runtime_error(filename + " could not be opened for reading"); 57 | } 58 | fread(header, 1, 8, fp); 59 | if (png_sig_cmp(static_cast(header), 0, 8)) 60 | { 61 | throw std::runtime_error(filename + " is not recognized as a PNG file"); 62 | } 63 | 64 | auto png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 65 | 66 | if (!png_ptr) 67 | { 68 | throw std::runtime_error("png_create_read_struct failed"); 69 | } 70 | auto info_ptr = png_create_info_struct(png_ptr); 71 | if (!info_ptr) 72 | { 73 | throw std::runtime_error("png_create_info_struct failed"); 74 | } 75 | if (setjmp(png_jmpbuf(png_ptr))) 76 | { 77 | throw std::runtime_error("Error during init_io"); 78 | } 79 | 80 | png_init_io(png_ptr, fp); 81 | png_set_sig_bytes(png_ptr, 8); 82 | 83 | png_read_info(png_ptr, info_ptr); 84 | 85 | m_width = png_get_image_width(png_ptr, info_ptr); 86 | m_height = png_get_image_height(png_ptr, info_ptr); 87 | m_colorType = png_get_color_type(png_ptr, info_ptr); 88 | m_bitDepth = png_get_bit_depth(png_ptr, info_ptr); 89 | 90 | m_numberOfPasses = png_set_interlace_handling(png_ptr); 91 | png_read_update_info(png_ptr, info_ptr); 92 | 93 | /* read file */ 94 | if (setjmp(png_jmpbuf(png_ptr))) 95 | { 96 | throw std::runtime_error("Error while reading image"); 97 | } 98 | 99 | m_rows = (png_bytep*)malloc(sizeof(png_bytep) * m_height); 100 | auto bytesPerRow = png_get_rowbytes(png_ptr, info_ptr); 101 | for (auto y = 0; y < m_height; y++) 102 | { 103 | m_rows[y] = (png_byte*)malloc(bytesPerRow); 104 | } 105 | 106 | png_read_image(png_ptr, &m_rows[0]); 107 | 108 | fclose(fp); 109 | } 110 | 111 | ~Picture() 112 | { 113 | if (!m_rows) 114 | { 115 | for (auto y = 0; y < m_height; y++) 116 | { 117 | free(m_rows[y]); 118 | } 119 | free(m_rows); 120 | } 121 | } 122 | 123 | unsigned width() const 124 | { 125 | return m_width; 126 | } 127 | unsigned height() const 128 | { 129 | return m_height; 130 | } 131 | 132 | bool at(unsigned x, unsigned y) const 133 | { 134 | if (!m_rows) 135 | { 136 | throw std::runtime_error("Invalid image data"); 137 | } 138 | if (x >= m_width || y >= m_height) 139 | { 140 | throw std::runtime_error("The requested pixel is out of the image boundaries"); 141 | } 142 | auto* row = m_rows[y]; 143 | auto* pixel = &(row[x * 4]); 144 | 145 | return pixel[3] > 0; 146 | } 147 | 148 | private: 149 | png_uint_32 m_width; 150 | png_uint_32 m_height; 151 | png_byte m_colorType; 152 | png_byte m_bitDepth; 153 | int m_numberOfPasses; 154 | 155 | png_bytep* m_rows; 156 | }; 157 | 158 | //-------------------------------------------------------------------------------------------------- 159 | 160 | int main(int argc_, char* argv_[]) 161 | { 162 | using namespace clara; 163 | 164 | std::string version(std::to_string(RASTR_VERSION_MAJOR) + "." 165 | + std::to_string(RASTR_VERSION_MINOR) + "." 166 | + std::to_string(RASTR_VERSION_MICRO)); 167 | 168 | std::cout << std::endl; 169 | std::cout << ",-. ,-. ,-. |- ,-. " << std::endl; 170 | std::cout << "| ,-| `-. | | " << std::endl; 171 | std::cout << "' `-^ `-' `' ' " << std::endl; 172 | 173 | std::cout << " v. " << version << std::endl << std::endl; 174 | 175 | std::cout << "Png converter utility" << std::endl << std::endl; 176 | 177 | bool showHelp{false}; 178 | bool grayscale{false}; 179 | boost::filesystem::path pngPath; 180 | boost::filesystem::path outputPath; 181 | 182 | auto cli = Help(showHelp) | Opt(pngPath, "PNG file")["-p"]["--png"]("input png file") 183 | | Opt(outputPath, "Output file")["-o"]["--output"]("output file name") 184 | | Opt(grayscale)["-g"]["--grayscale"]( 185 | "render the bitmap using 8 bits per pixel (default: 1 bit per pixel)"); 186 | 187 | auto result = cli.parse(Args(argc_, argv_)); 188 | if (!result) 189 | { 190 | std::cerr << " * Error: " << result.errorMessage() << std::endl << std::endl; 191 | exit(1); 192 | } 193 | 194 | if (showHelp) 195 | { 196 | std::cout << cli << std::endl << std::endl; 197 | return 0; 198 | } 199 | 200 | if (pngPath.empty()) 201 | { 202 | std::cerr << " * Error: : you must specify a path to a png file" << std::endl << std::endl; 203 | exit(2); 204 | } 205 | 206 | try 207 | { 208 | if (outputPath.empty()) 209 | { 210 | outputPath = pngPath.stem().string() + ".h"; 211 | } 212 | else if (!outputPath.parent_path().empty() 213 | && !boost::filesystem::exists(outputPath.parent_path())) 214 | { 215 | std::cerr << " * Error: The output path " << outputPath.parent_path() << " does not exist" 216 | << std::endl 217 | << std::endl; 218 | exit(3); 219 | } 220 | std::cout << "Output file: " << outputPath.string() << std::endl; 221 | 222 | std::vector rows; 223 | 224 | Picture picture(pngPath.string()); 225 | rows.emplace_back("//" 226 | "--------------------------------------------------------" 227 | "--------------------" 228 | "----------------------"); 229 | rows.emplace_back("// Original file name: " + pngPath.filename().string()); 230 | rows.emplace_back( 231 | "// Size: " + std::to_string(picture.width()) + "x" + std::to_string(picture.height())); 232 | rows.emplace_back("// Bits per pixel: " + std::to_string(grayscale ? 8 : 1)); 233 | 234 | rows.emplace_back("//" 235 | "--------------------------------------------------------" 236 | "--------------------" 237 | "----------------------"); 238 | rows.emplace_back(""); 239 | 240 | rows.emplace_back("#ifdef ARDUINO"); 241 | rows.emplace_back("#include "); 242 | rows.emplace_back("#else"); 243 | rows.emplace_back("#define PROGMEM"); 244 | rows.emplace_back("#endif"); 245 | rows.emplace_back(""); 246 | 247 | auto bitmapVariableName = "k_bitmap_" + variableName(pngPath.stem().string()); 248 | auto bitmapDataVariableName = bitmapVariableName + "_data"; 249 | 250 | rows.emplace_back("// clang-format off "); 251 | rows.emplace_back(""); 252 | 253 | std::vector pixels; 254 | for (auto y = 0; y < picture.height(); ++y) 255 | { 256 | for (auto x = 0; x < picture.width(); ++x) 257 | { 258 | pixels.push_back(picture.at(x, y)); 259 | } 260 | } 261 | 262 | unsigned nBytes = static_cast(std::ceil(pixels.size() / 8.f)); 263 | std::vector bytes(nBytes); 264 | 265 | if (nBytes > 0) 266 | { 267 | rows.emplace_back("// bitmap data"); 268 | std::ostringstream ss; 269 | ss << "const PROGMEM uint8_t " << bitmapDataVariableName << "[] = { "; 270 | std::string separator; 271 | ss << "\n "; 272 | for (auto i = 0; i < nBytes; ++i) 273 | { 274 | for (auto b = 0; b < 8; ++b) 275 | { 276 | if (pixels[i * 8 + b]) 277 | { 278 | bytes[i] |= (1 << (7 - b)); 279 | } 280 | else 281 | { 282 | } 283 | } 284 | ss << separator << ((i % 16 == 0 && i != 0) ? "\n " : "") << "0x" << std::uppercase 285 | << std::setfill('0') << std::setw(2) << std::hex << (int)bytes[i]; 286 | separator = ", "; 287 | } 288 | ss << "\n};\n"; 289 | rows.emplace_back(ss.str()); 290 | } 291 | 292 | rows.emplace_back("const PROGMEM sl::rastr::Bitmap " + bitmapVariableName + " = {"); 293 | 294 | { 295 | std::ostringstream ss; 296 | ss << " /* width: */ " << (int)picture.width() << ",\n"; 297 | ss << " /* height: */ " << (int)picture.height() << ",\n"; 298 | ss << " /* bits per pixel: */ " << (int)(grayscale ? 8 : 1) << ",\n"; 299 | ss << " /* data: */ &" << bitmapDataVariableName << "[0]"; 300 | rows.emplace_back(ss.str()); 301 | } 302 | 303 | rows.emplace_back("};"); 304 | rows.emplace_back(""); 305 | rows.emplace_back("// clang-format on "); 306 | 307 | rows.emplace_back(""); 308 | 309 | rows.emplace_back("//" 310 | "--------------------------------------------------------" 311 | "--------------------" 312 | "----------------------"); 313 | 314 | boost::filesystem::ofstream ofs{outputPath}; 315 | for (const auto& row : rows) 316 | { 317 | ofs << row << std::endl; 318 | } 319 | } 320 | catch (const std::exception& ex) 321 | { 322 | std::cerr << " * Error: " << ex.what() << "\n"; 323 | return -10; 324 | } 325 | 326 | return 0; 327 | } 328 | 329 | //-------------------------------------------------------------------------------------------------- 330 | -------------------------------------------------------------------------------- /tools/rastr-ttf.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ########## Copyright (C) 2017 Vincenzo Pacella 3 | ## ## Distributed under MIT license, see file LICENSE 4 | ## ## or 5 | ## ## 6 | ########## ############################################################# shaduzlabs.com #####*/ 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | #include FT_FREETYPE_H 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | //-------------------------------------------------------------------------------------------------- 30 | 31 | std::string variableName(std::string str) 32 | { 33 | str.erase( 34 | std::remove_if( 35 | str.begin(), str.end(), [](unsigned char const& c) -> bool { return !std::isalnum(c); }), 36 | str.end()); 37 | 38 | return str; 39 | } 40 | 41 | //-------------------------------------------------------------------------------------------------- 42 | 43 | struct Character 44 | { 45 | uint8_t width; 46 | uint8_t height; 47 | int8_t xOffset; 48 | int8_t yOffset; 49 | uint8_t xAdvance; 50 | std::vector data; 51 | }; 52 | 53 | //-------------------------------------------------------------------------------------------------- 54 | 55 | using Characters = std::map; 56 | 57 | //-------------------------------------------------------------------------------------------------- 58 | 59 | class Font 60 | { 61 | public: 62 | enum class RenderMode 63 | { 64 | monochrome, 65 | grayscale, 66 | }; 67 | 68 | Font(const std::string& path_, 69 | unsigned height_, 70 | unsigned firstCharacter_, 71 | unsigned lastCharacter_, 72 | RenderMode mode_) 73 | : m_size(height_) 74 | , m_lineHeight(height_) 75 | , m_firstCharacter(firstCharacter_) 76 | , m_lastCharacter(lastCharacter_) 77 | , m_renderMode(mode_) 78 | { 79 | auto error = FT_Init_FreeType(&m_library); 80 | if (error) 81 | { 82 | throw std::runtime_error("Could not initialize FreeType"); 83 | } 84 | error = FT_New_Face(m_library, path_.c_str(), 0, &m_face); 85 | if (error == FT_Err_Unknown_File_Format) 86 | { 87 | throw std::runtime_error("FreeType: Unknown file format"); 88 | } 89 | else if (error) 90 | { 91 | const std::string errorString = "FreeType: error #" + std::to_string(error); 92 | throw std::runtime_error(errorString); 93 | } 94 | 95 | FT_Set_Pixel_Sizes(m_face, 0, height_); 96 | 97 | m_name = m_face->family_name; 98 | m_style = m_face->style_name; 99 | 100 | for (unsigned i = m_firstCharacter; i <= m_lastCharacter; ++i) 101 | { 102 | character(i); 103 | } 104 | } 105 | 106 | const std::string& name() const 107 | { 108 | return m_name; 109 | } 110 | const std::string& style() const 111 | { 112 | return m_style; 113 | } 114 | 115 | unsigned size() const 116 | { 117 | return m_size; 118 | } 119 | unsigned lineHeight() const 120 | { 121 | return m_lineHeight; 122 | } 123 | unsigned firstCharacter() const 124 | { 125 | return m_firstCharacter; 126 | } 127 | unsigned lastCharacter() const 128 | { 129 | return m_lastCharacter; 130 | } 131 | RenderMode renderMode() const 132 | { 133 | return m_renderMode; 134 | } 135 | 136 | const Characters& characters() const 137 | { 138 | return m_characters; 139 | } 140 | 141 | private: 142 | void character(unsigned c_) 143 | { 144 | if (!m_face) 145 | { 146 | throw std::runtime_error("FreeType: the font hasn't been initialized"); 147 | } 148 | 149 | FT_Int32 loadFlags 150 | = FT_LOAD_RENDER 151 | | (m_renderMode == RenderMode::monochrome ? FT_LOAD_MONOCHROME | FT_LOAD_TARGET_MONO 152 | : FT_LOAD_TARGET_NORMAL); 153 | if (FT_Load_Char(m_face, c_, loadFlags)) 154 | { 155 | throw std::runtime_error("FreeType: FT_Load_Char error "); 156 | } 157 | 158 | if (FT_Render_Glyph(m_face->glyph, 159 | (m_renderMode == RenderMode::monochrome ? FT_RENDER_MODE_MONO : FT_RENDER_MODE_NORMAL))) 160 | { 161 | throw std::runtime_error("FreeType: FT_Render_Glyph error "); 162 | } 163 | 164 | auto& bitmap = m_face->glyph->bitmap; 165 | const auto bitmap_left = m_face->glyph->bitmap_left; 166 | const auto bitmap_top = m_face->glyph->bitmap_top; 167 | const auto nBytes = static_cast(std::ceil( 168 | (bitmap.width * bitmap.rows) / (m_renderMode == RenderMode::monochrome ? 8.f : 1.f))); 169 | 170 | Character character; 171 | character.data.resize(nBytes, 0); 172 | character.width = bitmap.width; 173 | character.height = bitmap.rows; 174 | character.xOffset = bitmap_left; 175 | character.yOffset = bitmap_top; 176 | character.xAdvance = m_face->glyph->linearHoriAdvance / 65536; 177 | 178 | if (character.height > m_lineHeight) 179 | { 180 | m_lineHeight = character.height; 181 | } 182 | 183 | unsigned bitIndex = 0; 184 | for (unsigned y = 0; y < bitmap.rows; ++y) 185 | { 186 | for (unsigned x = 0; x < bitmap.width; ++x) 187 | { 188 | if (m_renderMode == RenderMode::monochrome) 189 | { 190 | const auto p = x >> 3; 191 | const auto offset = (p * 8) + (7 - x); 192 | const auto index = (y * bitmap.pitch) + p; 193 | if ((bitmap.buffer[index] >> offset) & 0x01) 194 | { 195 | character.data[bitIndex / 8] |= 0x80 >> (bitIndex % 8); 196 | } 197 | ++bitIndex; 198 | } 199 | else 200 | { 201 | const auto index = (y * bitmap.pitch) + x; 202 | character.data[index] |= bitmap.buffer[index]; 203 | } 204 | } 205 | } 206 | 207 | m_characters.emplace(c_, character); 208 | } 209 | 210 | FT_Library m_library{nullptr}; 211 | FT_Face m_face{nullptr}; 212 | 213 | std::string m_name; 214 | std::string m_style; 215 | unsigned m_size; 216 | unsigned m_lineHeight; 217 | unsigned m_firstCharacter; 218 | unsigned m_lastCharacter; 219 | RenderMode m_renderMode; 220 | 221 | Characters m_characters; 222 | }; 223 | 224 | //-------------------------------------------------------------------------------------------------- 225 | 226 | std::string to_string(const Font& font_) 227 | { 228 | std::ostringstream ss; 229 | std::map charactersMap; 230 | 231 | const std::string separator 232 | = "//" 233 | "------------------------------------------------------------------------------------------" 234 | "--------"; 235 | ss << separator << std::endl; 236 | ss << "// Font: " << font_.name() << std::endl; 237 | ss << "// Style: " << font_.style() << std::endl; 238 | ss << "// Size: " + std::to_string(font_.size()) << std::endl; 239 | ss << "// Line height: " + std::to_string(font_.lineHeight()) << std::endl; 240 | ss << "// Number of chars: " + std::to_string(font_.characters().size()) << std::endl; 241 | ss << "// Bits per pixel: " << (font_.renderMode() == Font::RenderMode::monochrome ? 1 : 8) 242 | << std::endl; 243 | ss << "//" 244 | "------------------------------------------------------------------------------------------" 245 | "--------" 246 | << std::endl; 247 | ss << std::endl; 248 | 249 | ss << "#ifdef ARDUINO" << std::endl; 250 | ss << "#include " << std::endl; 251 | ss << "#else" << std::endl; 252 | ss << "#define PROGMEM" << std::endl; 253 | ss << "#endif" << std::endl; 254 | ss << std::endl; 255 | 256 | auto resolution = font_.renderMode() == Font::RenderMode::grayscale ? "8bpp" : "1bpp"; 257 | auto fontVariableName = "k_font_" + variableName(font_.name()) + "_" + font_.style() + "_" 258 | + std::to_string(font_.size()) + "_" + resolution; 259 | auto fontCharsVariableName = fontVariableName + "_chars"; 260 | 261 | ss << "// clang-format off " << std::endl; 262 | ss << std::endl; 263 | 264 | ss << "// bitmap data" << std::endl; 265 | 266 | for (auto& character : font_.characters()) 267 | { 268 | unsigned nBytes = character.second.data.size(); 269 | 270 | auto characterVariableName = fontVariableName + "_c" + std::to_string((int)character.first); 271 | 272 | if (nBytes > 0) 273 | { 274 | std::string separator; 275 | ss << "const PROGMEM uint8_t " << characterVariableName << "[] = { "; 276 | for (auto i = 0; i < nBytes; ++i) 277 | { 278 | ss << separator << "0x" << std::uppercase << std::setfill('0') << std::setw(2) << std::hex 279 | << (int)character.second.data[i]; 280 | separator = ", "; 281 | } 282 | ss << " }; " << std::endl; 283 | 284 | charactersMap.emplace(character.first, "&" + characterVariableName + "[0]"); 285 | } 286 | } 287 | 288 | ss << std::endl; 289 | 290 | ss << "// character data" << std::endl; 291 | ss << "const PROGMEM sl::rastr::Character " + fontCharsVariableName + "[] = { " << std::endl; 292 | ss << "// W H XOff YOff XAdv Data" << std::endl; 293 | 294 | for (const auto& c : font_.characters()) 295 | { 296 | 297 | ss << " /* '" << (char)c.first << "' (0x" << std::uppercase << std::setfill('0') 298 | << std::setw(2) << std::hex << (int)c.first << ") */ {" << std::dec; 299 | 300 | ss << std::setfill(' ') << std::setw(5) << (int)c.second.width << ", "; 301 | ss << std::setfill(' ') << std::setw(5) << (int)c.second.height << ", "; 302 | ss << std::setfill(' ') << std::setw(5) << (int)c.second.xOffset << ", "; 303 | ss << std::setfill(' ') << std::setw(5) << (int)c.second.yOffset << ", "; 304 | ss << std::setfill(' ') << std::setw(5) << (int)c.second.xAdvance << ", "; 305 | 306 | const auto& cVariableName = charactersMap.find(c.first); 307 | if (cVariableName != charactersMap.end()) 308 | { 309 | ss << cVariableName->second; 310 | } 311 | else 312 | { 313 | ss << "nullptr"; 314 | } 315 | ss << " }, " << std::endl; 316 | } 317 | 318 | ss << "};" << std::endl; 319 | ss << "" << std::endl; 320 | 321 | ss << "// font" << std::endl; 322 | ss << "const PROGMEM sl::rastr::Font " + fontVariableName + " = {" << std::endl; 323 | { 324 | ss << " /* name and size: */ { \"" << font_.name() << "\", " << (int)font_.size() << " }," 325 | << std::endl; 326 | ss << " /* bits/pixel: */ " 327 | << (font_.renderMode() == Font::RenderMode::monochrome ? 1 : 8) << "," << std::endl; 328 | ss << " /* line height: */ " << (int)font_.lineHeight() << "," << std::endl; 329 | ss << " /* first character: */ " << (int)font_.firstCharacter() << "," << std::endl; 330 | ss << " /* last character: */ " << (int)font_.lastCharacter() << ", " << std::endl; 331 | ss << " &" << fontCharsVariableName << "[0]" << std::endl; 332 | ss << "};" << std::endl; 333 | } 334 | ss << "" << std::endl; 335 | ss << "// clang-format on " << std::endl; 336 | 337 | ss << std::endl; 338 | 339 | return ss.str(); 340 | } 341 | 342 | //-------------------------------------------------------------------------------------------------- 343 | 344 | int main(int argc_, char* argv_[]) 345 | { 346 | using namespace clara; 347 | 348 | std::string version(std::to_string(RASTR_VERSION_MAJOR) + "." 349 | + std::to_string(RASTR_VERSION_MINOR) + "." 350 | + std::to_string(RASTR_VERSION_MICRO)); 351 | 352 | std::cout << std::endl; 353 | std::cout << ",-. ,-. ,-. |- ,-. " << std::endl; 354 | std::cout << "| ,-| `-. | | " << std::endl; 355 | std::cout << "' `-^ `-' `' ' " << std::endl; 356 | 357 | std::cout << " v. " << version << std::endl << std::endl; 358 | 359 | std::cout << "TrueType font converter utility" << std::endl << std::endl; 360 | 361 | bool showHelp{false}; 362 | boost::filesystem::path fontPath; 363 | boost::filesystem::path outputPath; 364 | unsigned fontSize = 0; 365 | unsigned firstChar = 32; 366 | unsigned lastChar = 126; 367 | bool grayscale{false}; 368 | 369 | auto cli = Help(showHelp) | Opt(fontPath, "TrueType Font")["-t"]["--ttf"]("the font file") 370 | | Opt(fontSize, "Font size")["-s"]["--size"]("font size") 371 | | Opt(firstChar, "First character")["-f"]["--first"]("first character (default: 32)") 372 | | Opt(lastChar, "Last character")["-l"]["--last"]("last character (default: 126)") 373 | | Opt(grayscale)["-g"]["--grayscale"]( 374 | "render characters using 8 bits per pixel (default: 1 bit per pixel)") 375 | | Opt(outputPath, "Output file")["-o"]["--output"]("output file name"); 376 | 377 | auto result = cli.parse(Args(argc_, argv_)); 378 | if (!result) 379 | { 380 | std::cerr << " * Error: " << result.errorMessage() << std::endl << std::endl; 381 | return -1; 382 | } 383 | 384 | if (showHelp) 385 | { 386 | std::cout << cli << std::endl << std::endl; 387 | return 0; 388 | } 389 | if (fontPath.empty() || fontSize == 0) 390 | { 391 | std::cerr << " * Error: : you must specify at least a path to a font and the size" 392 | << std::endl 393 | << std::endl; 394 | return -2; 395 | } 396 | 397 | const auto renderMode = grayscale ? Font::RenderMode::grayscale : Font::RenderMode::monochrome; 398 | try 399 | { 400 | Font font(fontPath.string(), fontSize, firstChar, lastChar, renderMode); 401 | auto resolution = font.renderMode() == Font::RenderMode::grayscale ? "8bpp" : "1bpp"; 402 | 403 | if (outputPath.empty()) 404 | { 405 | outputPath = fontPath.stem().string() + "_" + variableName(font.style()) + "_" 406 | + std::to_string(font.size()) + "_" + resolution + ".h"; 407 | } 408 | else if (!outputPath.parent_path().empty() 409 | && !boost::filesystem::exists(outputPath.parent_path())) 410 | { 411 | std::cerr << " * Error: The output path " << outputPath.parent_path() << " does not exist" << std::endl 412 | << std::endl; 413 | return -3; 414 | } 415 | std::cout << "Output file: " << outputPath.string() << std::endl; 416 | 417 | boost::filesystem::ofstream ofs{outputPath}; 418 | ofs << to_string(font); 419 | } 420 | catch (const std::exception& ex) 421 | { 422 | std::cerr << " * Error: " << ex.what() << "\n"; 423 | return -4; 424 | } 425 | 426 | return 0; 427 | } 428 | 429 | //-------------------------------------------------------------------------------------------------- 430 | -------------------------------------------------------------------------------- /test/src/fonts/default_monospace_5.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------------------- 2 | // Font: Default Monospace 3 | // Size: 5 4 | // Line height: 7 5 | // Number of chars: 94 6 | //-------------------------------------------------------------------------------------------------- 7 | 8 | #ifdef ARDUINO 9 | #include 10 | #else 11 | #define PROGMEM 12 | #endif 13 | 14 | // clang-format off 15 | 16 | // bitmap data 17 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c32[] = {0x00, 0x00}; 18 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c33[] = {0x92, 0x08}; 19 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c34[] = {0xB4, 0x00}; 20 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c35[] = {0xFD, 0x7E}; 21 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c36[] = {0xFB, 0xBE}; 22 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c37[] = {0xA9, 0x2A}; 23 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c38[] = {0xF8, 0xDE}; 24 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c39[] = {0x90, 0x00}; 25 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c40[] = {0x52, 0x44}; 26 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c41[] = {0x89, 0x28}; 27 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c42[] = {0x5D, 0x00}; 28 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c43[] = {0x0B, 0xA0}; 29 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c44[] = {0x00, 0x48}; 30 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c45[] = {0x03, 0x80}; 31 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c46[] = {0x00, 0x08}; 32 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c47[] = {0x25, 0x48}; 33 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c48[] = {0xF6, 0xDE}; 34 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c49[] = {0x49, 0x24}; 35 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c50[] = {0xE7, 0xCE}; 36 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c51[] = {0xE7, 0x9E}; 37 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c52[] = {0xB7, 0x92}; 38 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c53[] = {0xF3, 0x9E}; 39 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c54[] = {0xF3, 0xDE}; 40 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c55[] = {0xE4, 0x92}; 41 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c56[] = {0xF7, 0xDE}; 42 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c57[] = {0xF7, 0x9E}; 43 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c58[] = {0x08, 0x20}; 44 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c59[] = {0x08, 0x28}; 45 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c60[] = {0x2A, 0x22}; 46 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c61[] = {0x1C, 0x70}; 47 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c62[] = {0x88, 0xA8}; 48 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c63[] = {0xC5, 0x04}; 49 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c64[] = {0xFA, 0xF0}; 50 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c65[] = {0xF7, 0xDA}; 51 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c66[] = {0xD7, 0xDC}; 52 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c67[] = {0xF2, 0x4E}; 53 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c68[] = {0xD6, 0xDC}; 54 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c69[] = {0xF3, 0xCE}; 55 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c70[] = {0xF3, 0xC8}; 56 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c71[] = {0xF2, 0x5E}; 57 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c72[] = {0xB7, 0xDA}; 58 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c73[] = {0xE9, 0x2E}; 59 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c74[] = {0x24, 0xDE}; 60 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c75[] = {0x97, 0x6A}; 61 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c76[] = {0x92, 0x4E}; 62 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c77[] = {0xBF, 0xDA}; 63 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c78[] = {0x1A, 0xDA}; 64 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c79[] = {0xF6, 0xDE}; 65 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c80[] = {0xF7, 0xC8}; 66 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c81[] = {0x56, 0xF6}; 67 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c82[] = {0xF7, 0x7A}; 68 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c83[] = {0xF3, 0x9E}; 69 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c84[] = {0xE9, 0x24}; 70 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c85[] = {0xB6, 0xDE}; 71 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c86[] = {0xB6, 0xD4}; 72 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c87[] = {0xB7, 0xFA}; 73 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c88[] = {0x15, 0x2A}; 74 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c89[] = {0xB5, 0x24}; 75 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c90[] = {0xE5, 0x4E}; 76 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c91[] = {0xD2, 0x4C}; 77 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c92[] = {0x91, 0x12}; 78 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c93[] = {0xC9, 0x2C}; 79 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c94[] = {0x54, 0x00}; 80 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c95[] = {0x00, 0x0E}; 81 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c96[] = {0x88, 0x00}; 82 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c97[] = {0xF7, 0xDA}; 83 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c98[] = {0xD7, 0xDC}; 84 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c99[] = {0xF2, 0x4E}; 85 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c100[] = {0xD6, 0xDC}; 86 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c101[] = {0xF3, 0xCE}; 87 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c102[] = {0xF3, 0xC8}; 88 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c103[] = {0xF2, 0x5E}; 89 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c104[] = {0xB7, 0xDA}; 90 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c105[] = {0xE9, 0x2E}; 91 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c106[] = {0x24, 0xDE}; 92 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c107[] = {0x97, 0x6A}; 93 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c108[] = {0x92, 0x4E}; 94 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c109[] = {0xBF, 0xDA}; 95 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c110[] = {0x1A, 0xDA}; 96 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c111[] = {0xF6, 0xDE}; 97 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c112[] = {0xF7, 0xC8}; 98 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c113[] = {0x56, 0xF6}; 99 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c114[] = {0xF7, 0x7A}; 100 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c115[] = {0xF3, 0x9E}; 101 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c116[] = {0xE9, 0x24}; 102 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c117[] = {0xB6, 0xDE}; 103 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c118[] = {0xB6, 0xD4}; 104 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c119[] = {0xB7, 0xFA}; 105 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c120[] = {0x15, 0x2A}; 106 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c121[] = {0xB5, 0x24}; 107 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c122[] = {0xE5, 0x4E}; 108 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c123[] = {0x2B, 0x22}; 109 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c124[] = {0x48, 0x24}; 110 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c125[] = {0x89, 0xA8}; 111 | const PROGMEM uint8_t k_font_DefaultMonospace_5_c126[] = {0x15, 0x00}; 112 | 113 | 114 | // character data 115 | const PROGMEM sl::rastr::Character k_font_DefaultMonospace_5_chars[] = { 116 | // W H XOff YOff XAdv Data 117 | /* ' ' (0x20) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c32[0]}, 118 | /* '!' (0x21) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c33[0]}, 119 | /* '"' (0x22) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c34[0]}, 120 | /* '#' (0x23) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c35[0]}, 121 | /* '$' (0x24) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c36[0]}, 122 | /* '%' (0x25) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c37[0]}, 123 | /* '&' (0x26) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c38[0]}, 124 | /* ''' (0x27) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c39[0]}, 125 | /* '(' (0x28) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c40[0]}, 126 | /* ')' (0x29) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c41[0]}, 127 | /* '*' (0x2A) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c42[0]}, 128 | /* '+' (0x2B) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c43[0]}, 129 | /* ',' (0x2C) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c44[0]}, 130 | /* '-' (0x2D) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c45[0]}, 131 | /* '.' (0x2E) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c46[0]}, 132 | /* '/' (0x2F) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c47[0]}, 133 | /* '0' (0x30) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c48[0]}, 134 | /* '1' (0x31) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c49[0]}, 135 | /* '2' (0x32) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c50[0]}, 136 | /* '3' (0x33) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c51[0]}, 137 | /* '4' (0x34) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c52[0]}, 138 | /* '5' (0x35) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c53[0]}, 139 | /* '6' (0x36) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c54[0]}, 140 | /* '7' (0x37) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c55[0]}, 141 | /* '8' (0x38) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c56[0]}, 142 | /* '9' (0x39) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c57[0]}, 143 | /* ':' (0x3A) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c58[0]}, 144 | /* ';' (0x3B) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c59[0]}, 145 | /* '<' (0x3C) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c60[0]}, 146 | /* '=' (0x3D) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c61[0]}, 147 | /* '>' (0x3E) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c62[0]}, 148 | /* '?' (0x3F) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c63[0]}, 149 | /* '@' (0x40) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c64[0]}, 150 | /* 'A' (0x41) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c65[0]}, 151 | /* 'B' (0x42) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c66[0]}, 152 | /* 'C' (0x43) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c67[0]}, 153 | /* 'D' (0x44) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c68[0]}, 154 | /* 'E' (0x45) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c69[0]}, 155 | /* 'F' (0x46) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c70[0]}, 156 | /* 'G' (0x47) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c71[0]}, 157 | /* 'H' (0x48) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c72[0]}, 158 | /* 'I' (0x49) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c73[0]}, 159 | /* 'J' (0x4A) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c74[0]}, 160 | /* 'K' (0x4B) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c75[0]}, 161 | /* 'L' (0x4C) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c76[0]}, 162 | /* 'M' (0x4D) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c77[0]}, 163 | /* 'N' (0x4E) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c78[0]}, 164 | /* 'O' (0x4F) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c79[0]}, 165 | /* 'P' (0x50) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c80[0]}, 166 | /* 'Q' (0x51) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c81[0]}, 167 | /* 'R' (0x52) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c82[0]}, 168 | /* 'S' (0x53) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c83[0]}, 169 | /* 'T' (0x54) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c84[0]}, 170 | /* 'U' (0x55) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c85[0]}, 171 | /* 'V' (0x56) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c86[0]}, 172 | /* 'W' (0x57) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c87[0]}, 173 | /* 'X' (0x58) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c88[0]}, 174 | /* 'Y' (0x59) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c89[0]}, 175 | /* 'Z' (0x5A) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c90[0]}, 176 | /* '[' (0x5B) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c91[0]}, 177 | /* '\' (0x5C) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c92[0]}, 178 | /* ']' (0x5D) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c93[0]}, 179 | /* '^' (0x5E) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c94[0]}, 180 | /* '_' (0x5F) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c95[0]}, 181 | /* '`' (0x60) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c96[0]}, 182 | /* 'a' (0x61) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c97[0]}, 183 | /* 'b' (0x62) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c98[0]}, 184 | /* 'c' (0x63) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c99[0]}, 185 | /* 'd' (0x64) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c100[0]}, 186 | /* 'e' (0x65) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c101[0]}, 187 | /* 'f' (0x66) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c102[0]}, 188 | /* 'g' (0x67) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c103[0]}, 189 | /* 'h' (0x68) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c104[0]}, 190 | /* 'i' (0x69) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c105[0]}, 191 | /* 'j' (0x6A) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c106[0]}, 192 | /* 'k' (0x6B) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c107[0]}, 193 | /* 'l' (0x6C) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c108[0]}, 194 | /* 'm' (0x6D) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c109[0]}, 195 | /* 'n' (0x6E) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c110[0]}, 196 | /* 'o' (0x6F) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c111[0]}, 197 | /* 'p' (0x70) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c112[0]}, 198 | /* 'q' (0x71) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c113[0]}, 199 | /* 'r' (0x72) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c114[0]}, 200 | /* 's' (0x73) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c115[0]}, 201 | /* 't' (0x74) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c116[0]}, 202 | /* 'u' (0x75) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c117[0]}, 203 | /* 'v' (0x76) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c118[0]}, 204 | /* 'w' (0x77) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c119[0]}, 205 | /* 'x' (0x78) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c120[0]}, 206 | /* 'y' (0x79) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c121[0]}, 207 | /* 'z' (0x7A) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c122[0]}, 208 | /* '{' (0x7B) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c123[0]}, 209 | /* '|' (0x7C) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c124[0]}, 210 | /* '}' (0x7D) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c125[0]}, 211 | /* '~' (0x7E) */ { 3, 5, 0, 5, 4, &k_font_DefaultMonospace_5_c126[0]}, 212 | }; 213 | 214 | // font 215 | const PROGMEM sl::rastr::Font k_font_DefaultMonospace_5 = { 216 | /* name and size: */ {"Default Monospace", 5}, 217 | /* bits/pixel: */ 1, 218 | /* line height: */ 7, 219 | /* first character: */ 32, 220 | /* last character: */ 126, 221 | &k_font_DefaultMonospace_5_chars[0] 222 | }; 223 | 224 | // clang-format on 225 | -------------------------------------------------------------------------------- /test/src/fonts/default_monospace_7.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------------------- 2 | // Font: Default Monospace 3 | // Size: 7 4 | // Line height: 9 5 | // Number of chars: 94 6 | //-------------------------------------------------------------------------------------------------- 7 | 8 | // clang-format off 9 | 10 | // bitmap data 11 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c32[] = {0x00, 0x00, 0x00, 0x00, 0x00}; 12 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c33[] = {0x42, 0x10, 0x84, 0x01, 0x00}; 13 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c34[] = {0x52, 0x94, 0x00, 0x00, 0x00}; 14 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c35[] = {0x00, 0x15, 0xF5, 0x7D, 0x40}; 15 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c36[] = {0x23, 0xA8, 0xE2, 0xB8, 0x80}; 16 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c37[] = {0x45, 0x54, 0x45, 0x54, 0x40}; 17 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c38[] = {0x22, 0xA8, 0x8A, 0xC9, 0xA0}; 18 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c39[] = {0x42, 0x10, 0x00, 0x00, 0x00}; 19 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c40[] = {0x11, 0x10, 0x84, 0x10, 0x40}; 20 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c41[] = {0x41, 0x04, 0x21, 0x11, 0x00}; 21 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c42[] = {0x11, 0xC4, 0x00, 0x00, 0x00}; 22 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c43[] = {0x01, 0x09, 0xF2, 0x10, 0x00}; 23 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c44[] = {0x00, 0x00, 0x00, 0x08, 0x40}; 24 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c45[] = {0x00, 0x00, 0x0F, 0x80, 0x00}; 25 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c46[] = {0x00, 0x00, 0x00, 0x00, 0x40}; 26 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c47[] = {0x00, 0x44, 0x44, 0x40, 0x00}; 27 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c48[] = {0x74, 0x6B, 0x58, 0xB8, 0x00}; 28 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c49[] = {0x23, 0x08, 0x42, 0x38, 0x00}; 29 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c50[] = {0x74, 0x44, 0x44, 0x7C, 0x00}; 30 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c51[] = {0xF8, 0x88, 0x28, 0xB8, 0x00}; 31 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c52[] = {0x94, 0xA5, 0xF1, 0x08, 0x00}; 32 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c53[] = {0xFC, 0x3C, 0x18, 0xB8, 0x00}; 33 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c54[] = {0x74, 0x3D, 0x18, 0xB8, 0x00}; 34 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c55[] = {0xF8, 0x44, 0x44, 0x40, 0x00}; 35 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c56[] = {0x74, 0x5D, 0x18, 0xB8, 0x00}; 36 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c57[] = {0x74, 0x62, 0xF0, 0xB8, 0x00}; 37 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c58[] = {0x00, 0x08, 0x00, 0x00, 0x80}; 38 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c59[] = {0x00, 0x08, 0x02, 0x11, 0x00}; 39 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c60[] = {0x00, 0xD9, 0x06, 0x0C, 0x00}; 40 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c61[] = {0x00, 0x1E, 0x07, 0x80, 0x00}; 41 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c62[] = {0x06, 0x0C, 0x13, 0x60, 0x00}; 42 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c63[] = {0x64, 0x88, 0x40, 0x10, 0x00}; 43 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c64[] = {0x74, 0x67, 0x59, 0x45, 0xC0}; 44 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c65[] = {0x22, 0xA3, 0xF8, 0xC4, 0x00}; 45 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c66[] = {0xF4, 0x7D, 0x18, 0xF8, 0x00}; 46 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c67[] = {0x74, 0x61, 0x08, 0xB8, 0x00}; 47 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c68[] = {0xF4, 0x63, 0x18, 0xF8, 0x00}; 48 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c69[] = {0xFC, 0x3F, 0x08, 0x7C, 0x00}; 49 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c70[] = {0xFC, 0x3D, 0x08, 0x40, 0x00}; 50 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c71[] = {0x74, 0x61, 0x38, 0xB8, 0x00}; 51 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c72[] = {0x8C, 0x7F, 0x18, 0xC4, 0x00}; 52 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c73[] = {0x71, 0x08, 0x42, 0x38, 0x00}; 53 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c74[] = {0x38, 0x84, 0x29, 0x30, 0x00}; 54 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c75[] = {0x8C, 0xB9, 0x49, 0x44, 0x00}; 55 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c76[] = {0x84, 0x21, 0x08, 0x7C, 0x00}; 56 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c77[] = {0x8E, 0xEB, 0x58, 0xC4, 0x00}; 57 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c78[] = {0x8C, 0x73, 0x59, 0xC4, 0x00}; 58 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c79[] = {0x74, 0x63, 0x18, 0xB8, 0x00}; 59 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c80[] = {0xF4, 0x7D, 0x08, 0x40, 0x00}; 60 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c81[] = {0x74, 0x63, 0x59, 0x34, 0x00}; 61 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c82[] = {0xF4, 0x7D, 0x49, 0x44, 0x00}; 62 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c83[] = {0x7C, 0x1C, 0x10, 0xF8, 0x00}; 63 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c84[] = {0xF9, 0x08, 0x42, 0x10, 0x00}; 64 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c85[] = {0x8C, 0x63, 0x18, 0xB8, 0x00}; 65 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c86[] = {0x8C, 0x63, 0x15, 0x10, 0x00}; 66 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c87[] = {0x8C, 0x6B, 0x5A, 0xA8, 0x00}; 67 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c88[] = {0x8A, 0x88, 0xA8, 0xC4, 0x00}; 68 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c89[] = {0x8C, 0x54, 0x42, 0x10, 0x00}; 69 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c90[] = {0xF8, 0x44, 0x44, 0x7C, 0x00}; 70 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c91[] = {0xE4, 0x21, 0x08, 0x70, 0x00}; 71 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c92[] = {0x04, 0x10, 0x41, 0x04, 0x00}; 72 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c93[] = {0x38, 0x42, 0x10, 0x9C, 0x00}; 73 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c94[] = {0x22, 0x80, 0x00, 0x00, 0x00}; 74 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c95[] = {0x00, 0x00, 0x00, 0x03, 0xE0}; 75 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c96[] = {0x82, 0x00, 0x00, 0x00, 0x00}; 76 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c97[] = {0x03, 0x04, 0xE9, 0x30, 0x00}; 77 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c98[] = {0x84, 0x39, 0x29, 0x70, 0x00}; 78 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c99[] = {0x00, 0x1D, 0x08, 0x38, 0x00}; 79 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c100[] = {0x10, 0x9D, 0x29, 0x38, 0x00}; 80 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c101[] = {0x03, 0x25, 0xE8, 0x38, 0x00}; 81 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c102[] = {0x32, 0x38, 0x84, 0x20, 0x00}; 82 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c103[] = {0x03, 0x24, 0xE1, 0x09, 0x80}; 83 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c104[] = {0x84, 0x39, 0x29, 0x48, 0x00}; 84 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c105[] = {0x20, 0x08, 0x42, 0x38, 0x00}; 85 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c106[] = {0x10, 0x0C, 0x21, 0x09, 0x80}; 86 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c107[] = {0x84, 0xA9, 0x8A, 0x48, 0x00}; 87 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c108[] = {0x61, 0x08, 0x42, 0x38, 0x00}; 88 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c109[] = {0x00, 0x15, 0x5A, 0xD4, 0x00}; 89 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c110[] = {0x00, 0x3D, 0x18, 0xC4, 0x00}; 90 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c111[] = {0x00, 0x19, 0x29, 0x30, 0x00}; 91 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c112[] = {0x00, 0x19, 0x2F, 0x42, 0x00}; 92 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c113[] = {0x00, 0x19, 0x2F, 0x08, 0x40}; 93 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c114[] = {0x00, 0x2C, 0x94, 0x20, 0x00}; 94 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c115[] = {0x01, 0x90, 0x41, 0x30, 0x00}; 95 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c116[] = {0x42, 0x38, 0x84, 0x20, 0x00}; 96 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c117[] = {0x00, 0x25, 0x29, 0x30, 0x00}; 97 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c118[] = {0x00, 0x23, 0x15, 0x10, 0x00}; 98 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c119[] = {0x00, 0x01, 0x5A, 0xA8, 0x00}; 99 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c120[] = {0x04, 0x54, 0x45, 0x44, 0x00}; 100 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c121[] = {0x00, 0x25, 0x26, 0x22, 0x00}; 101 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c122[] = {0x00, 0x3C, 0x44, 0x78, 0x00}; 102 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c123[] = {0x22, 0x11, 0x04, 0x20, 0x80}; 103 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c124[] = {0x21, 0x08, 0x42, 0x10, 0x80}; 104 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c125[] = {0x20, 0x84, 0x11, 0x08, 0x80}; 105 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c126[] = {0x00, 0x11, 0x51, 0x00, 0x00}; 106 | 107 | 108 | // character data 109 | const PROGMEM sl::rastr::Character k_font_DefaultMonospace_7_chars[] = { 110 | // W H XOff YOff XAdv Data 111 | /* ' ' (0x20) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c32[0]}, 112 | /* '!' (0x21) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c33[0]}, 113 | /* '"' (0x22) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c34[0]}, 114 | /* '#' (0x23) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c35[0]}, 115 | /* '$' (0x24) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c36[0]}, 116 | /* '%' (0x25) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c37[0]}, 117 | /* '&' (0x26) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c38[0]}, 118 | /* ''' (0x27) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c39[0]}, 119 | /* '(' (0x28) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c40[0]}, 120 | /* ')' (0x29) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c41[0]}, 121 | /* '*' (0x2A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c42[0]}, 122 | /* '+' (0x2B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c43[0]}, 123 | /* ',' (0x2C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c44[0]}, 124 | /* '-' (0x2D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c45[0]}, 125 | /* '.' (0x2E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c46[0]}, 126 | /* '/' (0x2F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c47[0]}, 127 | /* '0' (0x30) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c48[0]}, 128 | /* '1' (0x31) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c49[0]}, 129 | /* '2' (0x32) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c50[0]}, 130 | /* '3' (0x33) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c51[0]}, 131 | /* '4' (0x34) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c52[0]}, 132 | /* '5' (0x35) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c53[0]}, 133 | /* '6' (0x36) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c54[0]}, 134 | /* '7' (0x37) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c55[0]}, 135 | /* '8' (0x38) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c56[0]}, 136 | /* '9' (0x39) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c57[0]}, 137 | /* ':' (0x3A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c58[0]}, 138 | /* ';' (0x3B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c59[0]}, 139 | /* '<' (0x3C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c60[0]}, 140 | /* '=' (0x3D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c61[0]}, 141 | /* '>' (0x3E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c62[0]}, 142 | /* '?' (0x3F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c63[0]}, 143 | /* '@' (0x40) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c64[0]}, 144 | /* 'A' (0x41) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c65[0]}, 145 | /* 'B' (0x42) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c66[0]}, 146 | /* 'C' (0x43) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c67[0]}, 147 | /* 'D' (0x44) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c68[0]}, 148 | /* 'E' (0x45) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c69[0]}, 149 | /* 'F' (0x46) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c70[0]}, 150 | /* 'G' (0x47) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c71[0]}, 151 | /* 'H' (0x48) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c72[0]}, 152 | /* 'I' (0x49) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c73[0]}, 153 | /* 'J' (0x4A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c74[0]}, 154 | /* 'K' (0x4B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c75[0]}, 155 | /* 'L' (0x4C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c76[0]}, 156 | /* 'M' (0x4D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c77[0]}, 157 | /* 'N' (0x4E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c78[0]}, 158 | /* 'O' (0x4F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c79[0]}, 159 | /* 'P' (0x50) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c80[0]}, 160 | /* 'Q' (0x51) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c81[0]}, 161 | /* 'R' (0x52) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c82[0]}, 162 | /* 'S' (0x53) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c83[0]}, 163 | /* 'T' (0x54) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c84[0]}, 164 | /* 'U' (0x55) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c85[0]}, 165 | /* 'V' (0x56) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c86[0]}, 166 | /* 'W' (0x57) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c87[0]}, 167 | /* 'X' (0x58) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c88[0]}, 168 | /* 'Y' (0x59) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c89[0]}, 169 | /* 'Z' (0x5A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c90[0]}, 170 | /* '[' (0x5B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c91[0]}, 171 | /* '\' (0x5C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c92[0]}, 172 | /* ']' (0x5D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c93[0]}, 173 | /* '^' (0x5E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c94[0]}, 174 | /* '_' (0x5F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c95[0]}, 175 | /* '`' (0x60) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c96[0]}, 176 | /* 'a' (0x61) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c97[0]}, 177 | /* 'b' (0x62) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c98[0]}, 178 | /* 'c' (0x63) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c99[0]}, 179 | /* 'd' (0x64) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c100[0]}, 180 | /* 'e' (0x65) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c101[0]}, 181 | /* 'f' (0x66) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c102[0]}, 182 | /* 'g' (0x67) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c103[0]}, 183 | /* 'h' (0x68) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c104[0]}, 184 | /* 'i' (0x69) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c105[0]}, 185 | /* 'j' (0x6A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c106[0]}, 186 | /* 'k' (0x6B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c107[0]}, 187 | /* 'l' (0x6C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c108[0]}, 188 | /* 'm' (0x6D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c109[0]}, 189 | /* 'n' (0x6E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c110[0]}, 190 | /* 'o' (0x6F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c111[0]}, 191 | /* 'p' (0x70) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c112[0]}, 192 | /* 'q' (0x71) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c113[0]}, 193 | /* 'r' (0x72) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c114[0]}, 194 | /* 's' (0x73) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c115[0]}, 195 | /* 't' (0x74) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c116[0]}, 196 | /* 'u' (0x75) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c117[0]}, 197 | /* 'v' (0x76) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c118[0]}, 198 | /* 'w' (0x77) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c119[0]}, 199 | /* 'x' (0x78) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c120[0]}, 200 | /* 'y' (0x79) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c121[0]}, 201 | /* 'z' (0x7A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c122[0]}, 202 | /* '{' (0x7B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c123[0]}, 203 | /* '|' (0x7C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c124[0]}, 204 | /* '}' (0x7D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c125[0]}, 205 | /* '~' (0x7E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c126[0]}, 206 | }; 207 | 208 | // font 209 | const PROGMEM sl::rastr::Font k_font_DefaultMonospace_7 = { 210 | /* name and size: */ {"Default Monospace", 7}, 211 | /* bits/pixel: */ 1, 212 | /* line height: */ 9, 213 | /* first character: */ 32, 214 | /* last character: */ 126, 215 | &k_font_DefaultMonospace_7_chars[0] 216 | }; 217 | 218 | // clang-format on 219 | -------------------------------------------------------------------------------- /support/arduino/Examples/SimpleTest/default_monospace_7.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------------------- 2 | // Font: Default Monospace 3 | // Size: 7 4 | // Line height: 9 5 | // Number of chars: 94 6 | //-------------------------------------------------------------------------------------------------- 7 | 8 | // clang-format off 9 | 10 | // bitmap data 11 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c32[] = {0x00, 0x00, 0x00, 0x00, 0x00}; 12 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c33[] = {0x42, 0x10, 0x84, 0x01, 0x00}; 13 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c34[] = {0x52, 0x94, 0x00, 0x00, 0x00}; 14 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c35[] = {0x00, 0x15, 0xF5, 0x7D, 0x40}; 15 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c36[] = {0x23, 0xA8, 0xE2, 0xB8, 0x80}; 16 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c37[] = {0x45, 0x54, 0x45, 0x54, 0x40}; 17 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c38[] = {0x22, 0xA8, 0x8A, 0xC9, 0xA0}; 18 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c39[] = {0x42, 0x10, 0x00, 0x00, 0x00}; 19 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c40[] = {0x11, 0x10, 0x84, 0x10, 0x40}; 20 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c41[] = {0x41, 0x04, 0x21, 0x11, 0x00}; 21 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c42[] = {0x11, 0xC4, 0x00, 0x00, 0x00}; 22 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c43[] = {0x01, 0x09, 0xF2, 0x10, 0x00}; 23 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c44[] = {0x00, 0x00, 0x00, 0x08, 0x40}; 24 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c45[] = {0x00, 0x00, 0x0F, 0x80, 0x00}; 25 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c46[] = {0x00, 0x00, 0x00, 0x00, 0x40}; 26 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c47[] = {0x00, 0x44, 0x44, 0x40, 0x00}; 27 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c48[] = {0x74, 0x6B, 0x58, 0xB8, 0x00}; 28 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c49[] = {0x23, 0x08, 0x42, 0x38, 0x00}; 29 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c50[] = {0x74, 0x44, 0x44, 0x7C, 0x00}; 30 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c51[] = {0xF8, 0x88, 0x28, 0xB8, 0x00}; 31 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c52[] = {0x94, 0xA5, 0xF1, 0x08, 0x00}; 32 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c53[] = {0xFC, 0x3C, 0x18, 0xB8, 0x00}; 33 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c54[] = {0x74, 0x3D, 0x18, 0xB8, 0x00}; 34 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c55[] = {0xF8, 0x44, 0x44, 0x40, 0x00}; 35 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c56[] = {0x74, 0x5D, 0x18, 0xB8, 0x00}; 36 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c57[] = {0x74, 0x62, 0xF0, 0xB8, 0x00}; 37 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c58[] = {0x00, 0x08, 0x00, 0x00, 0x80}; 38 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c59[] = {0x00, 0x08, 0x02, 0x11, 0x00}; 39 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c60[] = {0x00, 0xD9, 0x06, 0x0C, 0x00}; 40 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c61[] = {0x00, 0x1E, 0x07, 0x80, 0x00}; 41 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c62[] = {0x06, 0x0C, 0x13, 0x60, 0x00}; 42 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c63[] = {0x64, 0x88, 0x40, 0x10, 0x00}; 43 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c64[] = {0x74, 0x67, 0x59, 0x45, 0xC0}; 44 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c65[] = {0x22, 0xA3, 0xF8, 0xC4, 0x00}; 45 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c66[] = {0xF4, 0x7D, 0x18, 0xF8, 0x00}; 46 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c67[] = {0x74, 0x61, 0x08, 0xB8, 0x00}; 47 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c68[] = {0xF4, 0x63, 0x18, 0xF8, 0x00}; 48 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c69[] = {0xFC, 0x3F, 0x08, 0x7C, 0x00}; 49 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c70[] = {0xFC, 0x3D, 0x08, 0x40, 0x00}; 50 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c71[] = {0x74, 0x61, 0x38, 0xB8, 0x00}; 51 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c72[] = {0x8C, 0x7F, 0x18, 0xC4, 0x00}; 52 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c73[] = {0x71, 0x08, 0x42, 0x38, 0x00}; 53 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c74[] = {0x38, 0x84, 0x29, 0x30, 0x00}; 54 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c75[] = {0x8C, 0xB9, 0x49, 0x44, 0x00}; 55 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c76[] = {0x84, 0x21, 0x08, 0x7C, 0x00}; 56 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c77[] = {0x8E, 0xEB, 0x58, 0xC4, 0x00}; 57 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c78[] = {0x8C, 0x73, 0x59, 0xC4, 0x00}; 58 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c79[] = {0x74, 0x63, 0x18, 0xB8, 0x00}; 59 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c80[] = {0xF4, 0x7D, 0x08, 0x40, 0x00}; 60 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c81[] = {0x74, 0x63, 0x59, 0x34, 0x00}; 61 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c82[] = {0xF4, 0x7D, 0x49, 0x44, 0x00}; 62 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c83[] = {0x7C, 0x1C, 0x10, 0xF8, 0x00}; 63 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c84[] = {0xF9, 0x08, 0x42, 0x10, 0x00}; 64 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c85[] = {0x8C, 0x63, 0x18, 0xB8, 0x00}; 65 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c86[] = {0x8C, 0x63, 0x15, 0x10, 0x00}; 66 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c87[] = {0x8C, 0x6B, 0x5A, 0xA8, 0x00}; 67 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c88[] = {0x8A, 0x88, 0xA8, 0xC4, 0x00}; 68 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c89[] = {0x8C, 0x54, 0x42, 0x10, 0x00}; 69 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c90[] = {0xF8, 0x44, 0x44, 0x7C, 0x00}; 70 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c91[] = {0xE4, 0x21, 0x08, 0x70, 0x00}; 71 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c92[] = {0x04, 0x10, 0x41, 0x04, 0x00}; 72 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c93[] = {0x38, 0x42, 0x10, 0x9C, 0x00}; 73 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c94[] = {0x22, 0x80, 0x00, 0x00, 0x00}; 74 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c95[] = {0x00, 0x00, 0x00, 0x03, 0xE0}; 75 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c96[] = {0x82, 0x00, 0x00, 0x00, 0x00}; 76 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c97[] = {0x03, 0x04, 0xE9, 0x30, 0x00}; 77 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c98[] = {0x84, 0x39, 0x29, 0x70, 0x00}; 78 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c99[] = {0x00, 0x1D, 0x08, 0x38, 0x00}; 79 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c100[] = {0x10, 0x9D, 0x29, 0x38, 0x00}; 80 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c101[] = {0x03, 0x25, 0xE8, 0x38, 0x00}; 81 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c102[] = {0x32, 0x38, 0x84, 0x20, 0x00}; 82 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c103[] = {0x03, 0x24, 0xE1, 0x09, 0x80}; 83 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c104[] = {0x84, 0x39, 0x29, 0x48, 0x00}; 84 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c105[] = {0x20, 0x08, 0x42, 0x38, 0x00}; 85 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c106[] = {0x10, 0x0C, 0x21, 0x09, 0x80}; 86 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c107[] = {0x84, 0xA9, 0x8A, 0x48, 0x00}; 87 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c108[] = {0x61, 0x08, 0x42, 0x38, 0x00}; 88 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c109[] = {0x00, 0x15, 0x5A, 0xD4, 0x00}; 89 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c110[] = {0x00, 0x3D, 0x18, 0xC4, 0x00}; 90 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c111[] = {0x00, 0x19, 0x29, 0x30, 0x00}; 91 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c112[] = {0x00, 0x19, 0x2F, 0x42, 0x00}; 92 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c113[] = {0x00, 0x19, 0x2F, 0x08, 0x40}; 93 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c114[] = {0x00, 0x2C, 0x94, 0x20, 0x00}; 94 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c115[] = {0x01, 0x90, 0x41, 0x30, 0x00}; 95 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c116[] = {0x42, 0x38, 0x84, 0x20, 0x00}; 96 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c117[] = {0x00, 0x25, 0x29, 0x30, 0x00}; 97 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c118[] = {0x00, 0x23, 0x15, 0x10, 0x00}; 98 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c119[] = {0x00, 0x01, 0x5A, 0xA8, 0x00}; 99 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c120[] = {0x04, 0x54, 0x45, 0x44, 0x00}; 100 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c121[] = {0x00, 0x25, 0x26, 0x22, 0x00}; 101 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c122[] = {0x00, 0x3C, 0x44, 0x78, 0x00}; 102 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c123[] = {0x22, 0x11, 0x04, 0x20, 0x80}; 103 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c124[] = {0x21, 0x08, 0x42, 0x10, 0x80}; 104 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c125[] = {0x20, 0x84, 0x11, 0x08, 0x80}; 105 | const PROGMEM uint8_t k_font_DefaultMonospace_7_c126[] = {0x00, 0x11, 0x51, 0x00, 0x00}; 106 | 107 | 108 | // character data 109 | const PROGMEM sl::rastr::Character k_font_DefaultMonospace_7_chars[] = { 110 | // W H XOff YOff XAdv Data 111 | /* ' ' (0x20) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c32[0]}, 112 | /* '!' (0x21) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c33[0]}, 113 | /* '"' (0x22) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c34[0]}, 114 | /* '#' (0x23) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c35[0]}, 115 | /* '$' (0x24) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c36[0]}, 116 | /* '%' (0x25) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c37[0]}, 117 | /* '&' (0x26) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c38[0]}, 118 | /* ''' (0x27) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c39[0]}, 119 | /* '(' (0x28) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c40[0]}, 120 | /* ')' (0x29) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c41[0]}, 121 | /* '*' (0x2A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c42[0]}, 122 | /* '+' (0x2B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c43[0]}, 123 | /* ',' (0x2C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c44[0]}, 124 | /* '-' (0x2D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c45[0]}, 125 | /* '.' (0x2E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c46[0]}, 126 | /* '/' (0x2F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c47[0]}, 127 | /* '0' (0x30) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c48[0]}, 128 | /* '1' (0x31) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c49[0]}, 129 | /* '2' (0x32) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c50[0]}, 130 | /* '3' (0x33) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c51[0]}, 131 | /* '4' (0x34) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c52[0]}, 132 | /* '5' (0x35) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c53[0]}, 133 | /* '6' (0x36) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c54[0]}, 134 | /* '7' (0x37) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c55[0]}, 135 | /* '8' (0x38) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c56[0]}, 136 | /* '9' (0x39) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c57[0]}, 137 | /* ':' (0x3A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c58[0]}, 138 | /* ';' (0x3B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c59[0]}, 139 | /* '<' (0x3C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c60[0]}, 140 | /* '=' (0x3D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c61[0]}, 141 | /* '>' (0x3E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c62[0]}, 142 | /* '?' (0x3F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c63[0]}, 143 | /* '@' (0x40) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c64[0]}, 144 | /* 'A' (0x41) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c65[0]}, 145 | /* 'B' (0x42) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c66[0]}, 146 | /* 'C' (0x43) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c67[0]}, 147 | /* 'D' (0x44) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c68[0]}, 148 | /* 'E' (0x45) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c69[0]}, 149 | /* 'F' (0x46) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c70[0]}, 150 | /* 'G' (0x47) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c71[0]}, 151 | /* 'H' (0x48) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c72[0]}, 152 | /* 'I' (0x49) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c73[0]}, 153 | /* 'J' (0x4A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c74[0]}, 154 | /* 'K' (0x4B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c75[0]}, 155 | /* 'L' (0x4C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c76[0]}, 156 | /* 'M' (0x4D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c77[0]}, 157 | /* 'N' (0x4E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c78[0]}, 158 | /* 'O' (0x4F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c79[0]}, 159 | /* 'P' (0x50) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c80[0]}, 160 | /* 'Q' (0x51) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c81[0]}, 161 | /* 'R' (0x52) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c82[0]}, 162 | /* 'S' (0x53) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c83[0]}, 163 | /* 'T' (0x54) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c84[0]}, 164 | /* 'U' (0x55) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c85[0]}, 165 | /* 'V' (0x56) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c86[0]}, 166 | /* 'W' (0x57) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c87[0]}, 167 | /* 'X' (0x58) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c88[0]}, 168 | /* 'Y' (0x59) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c89[0]}, 169 | /* 'Z' (0x5A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c90[0]}, 170 | /* '[' (0x5B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c91[0]}, 171 | /* '\' (0x5C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c92[0]}, 172 | /* ']' (0x5D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c93[0]}, 173 | /* '^' (0x5E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c94[0]}, 174 | /* '_' (0x5F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c95[0]}, 175 | /* '`' (0x60) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c96[0]}, 176 | /* 'a' (0x61) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c97[0]}, 177 | /* 'b' (0x62) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c98[0]}, 178 | /* 'c' (0x63) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c99[0]}, 179 | /* 'd' (0x64) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c100[0]}, 180 | /* 'e' (0x65) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c101[0]}, 181 | /* 'f' (0x66) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c102[0]}, 182 | /* 'g' (0x67) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c103[0]}, 183 | /* 'h' (0x68) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c104[0]}, 184 | /* 'i' (0x69) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c105[0]}, 185 | /* 'j' (0x6A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c106[0]}, 186 | /* 'k' (0x6B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c107[0]}, 187 | /* 'l' (0x6C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c108[0]}, 188 | /* 'm' (0x6D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c109[0]}, 189 | /* 'n' (0x6E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c110[0]}, 190 | /* 'o' (0x6F) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c111[0]}, 191 | /* 'p' (0x70) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c112[0]}, 192 | /* 'q' (0x71) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c113[0]}, 193 | /* 'r' (0x72) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c114[0]}, 194 | /* 's' (0x73) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c115[0]}, 195 | /* 't' (0x74) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c116[0]}, 196 | /* 'u' (0x75) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c117[0]}, 197 | /* 'v' (0x76) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c118[0]}, 198 | /* 'w' (0x77) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c119[0]}, 199 | /* 'x' (0x78) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c120[0]}, 200 | /* 'y' (0x79) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c121[0]}, 201 | /* 'z' (0x7A) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c122[0]}, 202 | /* '{' (0x7B) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c123[0]}, 203 | /* '|' (0x7C) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c124[0]}, 204 | /* '}' (0x7D) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c125[0]}, 205 | /* '~' (0x7E) */ {5, 7, 0, 7, 6, &k_font_DefaultMonospace_7_c126[0]}, 206 | }; 207 | 208 | // font 209 | const PROGMEM sl::rastr::Font k_font_DefaultMonospace_7 = { 210 | /* name and size: */ {"Default Monospace", 7}, 211 | /* bits/pixel: */ 1, 212 | /* line height: */ 9, 213 | /* first character: */ 32, 214 | /* last character: */ 126, 215 | &k_font_DefaultMonospace_7_chars[0] 216 | }; 217 | 218 | // clang-format on 219 | -------------------------------------------------------------------------------- /test/src/Roboto_Bold_10_1bpp.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------------------- 2 | // Font: Roboto 3 | // Style: Bold 4 | // Size: 10 5 | // Line height: 10 6 | // Number of chars: 95 7 | // Bits per pixel: 1 8 | //-------------------------------------------------------------------------------------------------- 9 | 10 | #ifdef ARDUINO 11 | #include 12 | #else 13 | #define PROGMEM 14 | #endif 15 | 16 | // clang-format off 17 | 18 | // bitmap data 19 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c33[] = { 0xFA }; 20 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c34[] = { 0xB6, 0x80 }; 21 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c35[] = { 0x28, 0xA7, 0xCC, 0xF9, 0x45, 0x00 }; 22 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c36[] = { 0x2F, 0x98, 0x61, 0x9F, 0x40 }; 23 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c37[] = { 0xE1, 0x5B, 0xA0, 0x82, 0xC9, 0x43, 0x00 }; 24 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c38[] = { 0x62, 0x4F, 0x18, 0xAA, 0x6F, 0xC0 }; 25 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c39[] = { 0xE0 }; 26 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c40[] = { 0x4E, 0x49, 0x24, 0x4C }; 27 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c41[] = { 0x88, 0x92, 0x49, 0x50 }; 28 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c42[] = { 0x2B, 0x65 }; 29 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c43[] = { 0x21, 0x3E, 0x42, 0x00 }; 30 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c44[] = { 0xF8 }; 31 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c45[] = { 0xC0 }; 32 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c46[] = { 0x80 }; 33 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c47[] = { 0x32, 0x24, 0x44, 0x88 }; 34 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c48[] = { 0xF9, 0x99, 0x99, 0xF0 }; 35 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c49[] = { 0x7D, 0xB6, 0xD8 }; 36 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c50[] = { 0x7A, 0x62, 0x33, 0x31, 0xE0 }; 37 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c51[] = { 0x7A, 0x42, 0x60, 0xE5, 0xE0 }; 38 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c52[] = { 0x19, 0xDE, 0xBF, 0x8C, 0x60 }; 39 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c53[] = { 0xF8, 0xF1, 0x19, 0xF0 }; 40 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c54[] = { 0x66, 0x3D, 0x29, 0xC9, 0xC0 }; 41 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c55[] = { 0xF8, 0x46, 0x23, 0x11, 0x80 }; 42 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c56[] = { 0xF9, 0x96, 0x99, 0xF0 }; 43 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c57[] = { 0xE9, 0x9F, 0x13, 0x60 }; 44 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c58[] = { 0x88 }; 45 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c59[] = { 0x40, 0xF8 }; 46 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c60[] = { 0x17, 0xC7, 0x10 }; 47 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c61[] = { 0xF0, 0xF0 }; 48 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c62[] = { 0x8E, 0x3E, 0x80 }; 49 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c63[] = { 0x76, 0xC6, 0x62, 0x00, 0x80 }; 50 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c64[] = { 0x1E, 0x10, 0x93, 0x4A, 0x99, 0x4C, 0xA9, 0x7C, 0xC0, 0x3C, 0x00 }; 51 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c65[] = { 0x30, 0x70, 0xA3, 0x47, 0xC8, 0xB1, 0x80 }; 52 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c66[] = { 0xFB, 0x3C, 0xBE, 0xCF, 0x3F, 0x80 }; 53 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c67[] = { 0x39, 0x3C, 0x70, 0xC1, 0x33, 0x80 }; 54 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c68[] = { 0xF4, 0xE3, 0x18, 0xCF, 0xC0 }; 55 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c69[] = { 0xF8, 0x8F, 0x88, 0xF0 }; 56 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c70[] = { 0xF8, 0x8F, 0x88, 0x80 }; 57 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c71[] = { 0x74, 0x61, 0x38, 0xE5, 0xE0 }; 58 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c72[] = { 0x8C, 0x63, 0xF8, 0xC6, 0x20 }; 59 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c73[] = { 0xFE }; 60 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c74[] = { 0x08, 0x42, 0x10, 0xE5, 0xC0 }; 61 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c75[] = { 0xCF, 0x6F, 0x3C, 0xDB, 0x2C, 0xC0 }; 62 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c76[] = { 0x88, 0x88, 0x88, 0xF0 }; 63 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c77[] = { 0xC7, 0x8F, 0x3D, 0x5A, 0xB6, 0x64, 0x80 }; 64 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c78[] = { 0x8E, 0x7B, 0x5B, 0xCE, 0x20 }; 65 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c79[] = { 0x38, 0x89, 0x16, 0x34, 0x48, 0x8E, 0x00 }; 66 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c80[] = { 0xFB, 0x3C, 0xFE, 0xC3, 0x0C, 0x00 }; 67 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c81[] = { 0x38, 0x89, 0x16, 0x34, 0x48, 0x8E, 0x02 }; 68 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c82[] = { 0xFB, 0x3C, 0xFE, 0xDB, 0x2C, 0xC0 }; 69 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c83[] = { 0x79, 0x3C, 0x0E, 0x0F, 0x37, 0x80 }; 70 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c84[] = { 0xFC, 0xC3, 0x0C, 0x30, 0xC3, 0x00 }; 71 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c85[] = { 0x8C, 0x63, 0x18, 0xC5, 0xC0 }; 72 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c86[] = { 0xC6, 0x89, 0xB3, 0x42, 0x87, 0x04, 0x00 }; 73 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c87[] = { 0xC9, 0xA4, 0x95, 0x4A, 0xA7, 0x71, 0xB0, 0x88 }; 74 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c88[] = { 0xCD, 0xA3, 0x8C, 0x39, 0xAC, 0xC0 }; 75 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c89[] = { 0xCD, 0x27, 0x8C, 0x30, 0xC3, 0x00 }; 76 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c90[] = { 0xFC, 0x21, 0x8C, 0x21, 0x8F, 0xC0 }; 77 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c91[] = { 0xEA, 0xAA, 0xB0 }; 78 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c92[] = { 0xC4, 0x46, 0x22, 0x31 }; 79 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c93[] = { 0xD5, 0x55, 0x70 }; 80 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c94[] = { 0x66, 0x90 }; 81 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c95[] = { 0xF0 }; 82 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c96[] = { 0xCC }; 83 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c97[] = { 0x74, 0xDF, 0xB7, 0x80 }; 84 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c98[] = { 0x88, 0x8F, 0x99, 0x9F }; 85 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c99[] = { 0x76, 0xF1, 0xB7, 0x00 }; 86 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c100[] = { 0x11, 0x1F, 0x99, 0x9F }; 87 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c101[] = { 0x76, 0xFF, 0xA7, 0x80 }; 88 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c102[] = { 0x36, 0x6F, 0x66, 0x66 }; 89 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c103[] = { 0xF9, 0x99, 0xF9, 0xF0 }; 90 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c104[] = { 0x88, 0x8F, 0x99, 0x99 }; 91 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c105[] = { 0xBE }; 92 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c106[] = { 0x45, 0x55, 0xC0 }; 93 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c107[] = { 0x88, 0x8B, 0xEE, 0xAB }; 94 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c108[] = { 0xFF }; 95 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c109[] = { 0xFF, 0x26, 0x4C, 0x99, 0x20 }; 96 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c110[] = { 0xF9, 0x99, 0x90 }; 97 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c111[] = { 0xF4, 0xA5, 0x3F, 0x00 }; 98 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c112[] = { 0xF9, 0x99, 0xF8, 0x80 }; 99 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c113[] = { 0xF9, 0x99, 0xF1, 0x10 }; 100 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c114[] = { 0xF2, 0x48 }; 101 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c115[] = { 0x76, 0xDD, 0xB7, 0x00 }; 102 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c116[] = { 0x5D, 0x24, 0xC0 }; 103 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c117[] = { 0x99, 0x99, 0xF0 }; 104 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c118[] = { 0xDA, 0x94, 0xE2, 0x00 }; 105 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c119[] = { 0x93, 0xAD, 0xB3, 0x66, 0xC0 }; 106 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c120[] = { 0xDB, 0x88, 0xED, 0x80 }; 107 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c121[] = { 0xDA, 0x94, 0xE2, 0x11, 0x00 }; 108 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c122[] = { 0xF9, 0x88, 0xCF, 0x80 }; 109 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c123[] = { 0x29, 0x28, 0x92, 0x44 }; 110 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c124[] = { 0xFF }; 111 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c125[] = { 0x89, 0x22, 0x92, 0x50 }; 112 | const PROGMEM uint8_t k_font_Roboto_Bold_10_1bpp_c126[] = { 0xCD, 0xC0 }; 113 | 114 | // character data 115 | const PROGMEM sl::rastr::Character k_font_Roboto_Bold_10_1bpp_chars[] = { 116 | // W H XOff YOff XAdv Data 117 | /* ' ' (0x20) */ { 0, 0, 0, 0, 2, nullptr }, 118 | /* '!' (0x21) */ { 1, 7, 1, 7, 2, &k_font_Roboto_Bold_10_1bpp_c33[0] }, 119 | /* '"' (0x22) */ { 3, 3, 0, 8, 3, &k_font_Roboto_Bold_10_1bpp_c34[0] }, 120 | /* '#' (0x23) */ { 6, 7, 0, 7, 5, &k_font_Roboto_Bold_10_1bpp_c35[0] }, 121 | /* '$' (0x24) */ { 4, 9, 1, 8, 5, &k_font_Roboto_Bold_10_1bpp_c36[0] }, 122 | /* '%' (0x25) */ { 7, 7, 0, 7, 7, &k_font_Roboto_Bold_10_1bpp_c37[0] }, 123 | /* '&' (0x26) */ { 6, 7, 1, 7, 6, &k_font_Roboto_Bold_10_1bpp_c38[0] }, 124 | /* ''' (0x27) */ { 1, 3, 1, 8, 1, &k_font_Roboto_Bold_10_1bpp_c39[0] }, 125 | /* '(' (0x28) */ { 3, 10, 1, 8, 3, &k_font_Roboto_Bold_10_1bpp_c40[0] }, 126 | /* ')' (0x29) */ { 3, 10, 0, 8, 3, &k_font_Roboto_Bold_10_1bpp_c41[0] }, 127 | /* '*' (0x2A) */ { 4, 4, 0, 7, 4, &k_font_Roboto_Bold_10_1bpp_c42[0] }, 128 | /* '+' (0x2B) */ { 5, 5, 0, 6, 5, &k_font_Roboto_Bold_10_1bpp_c43[0] }, 129 | /* ',' (0x2C) */ { 2, 3, 0, 1, 2, &k_font_Roboto_Bold_10_1bpp_c44[0] }, 130 | /* '-' (0x2D) */ { 2, 1, 1, 4, 3, &k_font_Roboto_Bold_10_1bpp_c45[0] }, 131 | /* '.' (0x2E) */ { 1, 1, 1, 1, 2, &k_font_Roboto_Bold_10_1bpp_c46[0] }, 132 | /* '/' (0x2F) */ { 4, 8, 0, 7, 3, &k_font_Roboto_Bold_10_1bpp_c47[0] }, 133 | /* '0' (0x30) */ { 4, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c48[0] }, 134 | /* '1' (0x31) */ { 3, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c49[0] }, 135 | /* '2' (0x32) */ { 5, 7, 0, 7, 5, &k_font_Roboto_Bold_10_1bpp_c50[0] }, 136 | /* '3' (0x33) */ { 5, 7, 0, 7, 5, &k_font_Roboto_Bold_10_1bpp_c51[0] }, 137 | /* '4' (0x34) */ { 5, 7, 0, 7, 5, &k_font_Roboto_Bold_10_1bpp_c52[0] }, 138 | /* '5' (0x35) */ { 4, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c53[0] }, 139 | /* '6' (0x36) */ { 5, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c54[0] }, 140 | /* '7' (0x37) */ { 5, 7, 0, 7, 5, &k_font_Roboto_Bold_10_1bpp_c55[0] }, 141 | /* '8' (0x38) */ { 4, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c56[0] }, 142 | /* '9' (0x39) */ { 4, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c57[0] }, 143 | /* ':' (0x3A) */ { 1, 5, 1, 5, 2, &k_font_Roboto_Bold_10_1bpp_c58[0] }, 144 | /* ';' (0x3B) */ { 2, 7, 0, 5, 2, &k_font_Roboto_Bold_10_1bpp_c59[0] }, 145 | /* '<' (0x3C) */ { 4, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c60[0] }, 146 | /* '=' (0x3D) */ { 4, 3, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c61[0] }, 147 | /* '>' (0x3E) */ { 4, 5, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c62[0] }, 148 | /* '?' (0x3F) */ { 5, 7, 0, 7, 4, &k_font_Roboto_Bold_10_1bpp_c63[0] }, 149 | /* '@' (0x40) */ { 9, 9, 0, 7, 8, &k_font_Roboto_Bold_10_1bpp_c64[0] }, 150 | /* 'A' (0x41) */ { 7, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c65[0] }, 151 | /* 'B' (0x42) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c66[0] }, 152 | /* 'C' (0x43) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c67[0] }, 153 | /* 'D' (0x44) */ { 5, 7, 1, 7, 6, &k_font_Roboto_Bold_10_1bpp_c68[0] }, 154 | /* 'E' (0x45) */ { 4, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c69[0] }, 155 | /* 'F' (0x46) */ { 4, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c70[0] }, 156 | /* 'G' (0x47) */ { 5, 7, 1, 7, 6, &k_font_Roboto_Bold_10_1bpp_c71[0] }, 157 | /* 'H' (0x48) */ { 5, 7, 1, 7, 7, &k_font_Roboto_Bold_10_1bpp_c72[0] }, 158 | /* 'I' (0x49) */ { 1, 7, 1, 7, 2, &k_font_Roboto_Bold_10_1bpp_c73[0] }, 159 | /* 'J' (0x4A) */ { 5, 7, 0, 7, 5, &k_font_Roboto_Bold_10_1bpp_c74[0] }, 160 | /* 'K' (0x4B) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c75[0] }, 161 | /* 'L' (0x4C) */ { 4, 7, 1, 7, 5, &k_font_Roboto_Bold_10_1bpp_c76[0] }, 162 | /* 'M' (0x4D) */ { 7, 7, 1, 7, 8, &k_font_Roboto_Bold_10_1bpp_c77[0] }, 163 | /* 'N' (0x4E) */ { 5, 7, 1, 7, 7, &k_font_Roboto_Bold_10_1bpp_c78[0] }, 164 | /* 'O' (0x4F) */ { 7, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c79[0] }, 165 | /* 'P' (0x50) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c80[0] }, 166 | /* 'Q' (0x51) */ { 7, 8, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c81[0] }, 167 | /* 'R' (0x52) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c82[0] }, 168 | /* 'S' (0x53) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c83[0] }, 169 | /* 'T' (0x54) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c84[0] }, 170 | /* 'U' (0x55) */ { 5, 7, 1, 7, 6, &k_font_Roboto_Bold_10_1bpp_c85[0] }, 171 | /* 'V' (0x56) */ { 7, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c86[0] }, 172 | /* 'W' (0x57) */ { 9, 7, 0, 7, 8, &k_font_Roboto_Bold_10_1bpp_c87[0] }, 173 | /* 'X' (0x58) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c88[0] }, 174 | /* 'Y' (0x59) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c89[0] }, 175 | /* 'Z' (0x5A) */ { 6, 7, 0, 7, 6, &k_font_Roboto_Bold_10_1bpp_c90[0] }, 176 | /* '[' (0x5B) */ { 2, 10, 1, 8, 2, &k_font_Roboto_Bold_10_1bpp_c91[0] }, 177 | /* '\' (0x5C) */ { 4, 8, 0, 7, 4, &k_font_Roboto_Bold_10_1bpp_c92[0] }, 178 | /* ']' (0x5D) */ { 2, 10, 0, 8, 2, &k_font_Roboto_Bold_10_1bpp_c93[0] }, 179 | /* '^' (0x5E) */ { 4, 3, 0, 7, 4, &k_font_Roboto_Bold_10_1bpp_c94[0] }, 180 | /* '_' (0x5F) */ { 4, 1, 0, 0, 4, &k_font_Roboto_Bold_10_1bpp_c95[0] }, 181 | /* '`' (0x60) */ { 3, 2, 0, 8, 3, &k_font_Roboto_Bold_10_1bpp_c96[0] }, 182 | /* 'a' (0x61) */ { 5, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c97[0] }, 183 | /* 'b' (0x62) */ { 4, 8, 1, 8, 5, &k_font_Roboto_Bold_10_1bpp_c98[0] }, 184 | /* 'c' (0x63) */ { 5, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c99[0] }, 185 | /* 'd' (0x64) */ { 4, 8, 1, 8, 5, &k_font_Roboto_Bold_10_1bpp_c100[0] }, 186 | /* 'e' (0x65) */ { 5, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c101[0] }, 187 | /* 'f' (0x66) */ { 4, 8, 0, 8, 3, &k_font_Roboto_Bold_10_1bpp_c102[0] }, 188 | /* 'g' (0x67) */ { 4, 7, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c103[0] }, 189 | /* 'h' (0x68) */ { 4, 8, 1, 8, 5, &k_font_Roboto_Bold_10_1bpp_c104[0] }, 190 | /* 'i' (0x69) */ { 1, 7, 1, 7, 2, &k_font_Roboto_Bold_10_1bpp_c105[0] }, 191 | /* 'j' (0x6A) */ { 2, 9, 0, 7, 2, &k_font_Roboto_Bold_10_1bpp_c106[0] }, 192 | /* 'k' (0x6B) */ { 4, 8, 1, 8, 5, &k_font_Roboto_Bold_10_1bpp_c107[0] }, 193 | /* 'l' (0x6C) */ { 1, 8, 1, 8, 2, &k_font_Roboto_Bold_10_1bpp_c108[0] }, 194 | /* 'm' (0x6D) */ { 7, 5, 1, 5, 8, &k_font_Roboto_Bold_10_1bpp_c109[0] }, 195 | /* 'n' (0x6E) */ { 4, 5, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c110[0] }, 196 | /* 'o' (0x6F) */ { 5, 5, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c111[0] }, 197 | /* 'p' (0x70) */ { 4, 7, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c112[0] }, 198 | /* 'q' (0x71) */ { 4, 7, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c113[0] }, 199 | /* 'r' (0x72) */ { 3, 5, 1, 5, 3, &k_font_Roboto_Bold_10_1bpp_c114[0] }, 200 | /* 's' (0x73) */ { 5, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c115[0] }, 201 | /* 't' (0x74) */ { 3, 6, 0, 6, 3, &k_font_Roboto_Bold_10_1bpp_c116[0] }, 202 | /* 'u' (0x75) */ { 4, 5, 1, 5, 5, &k_font_Roboto_Bold_10_1bpp_c117[0] }, 203 | /* 'v' (0x76) */ { 5, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c118[0] }, 204 | /* 'w' (0x77) */ { 7, 5, 0, 5, 7, &k_font_Roboto_Bold_10_1bpp_c119[0] }, 205 | /* 'x' (0x78) */ { 5, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c120[0] }, 206 | /* 'y' (0x79) */ { 5, 7, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c121[0] }, 207 | /* 'z' (0x7A) */ { 5, 5, 0, 5, 5, &k_font_Roboto_Bold_10_1bpp_c122[0] }, 208 | /* '{' (0x7B) */ { 3, 10, 0, 8, 3, &k_font_Roboto_Bold_10_1bpp_c123[0] }, 209 | /* '|' (0x7C) */ { 1, 8, 1, 7, 2, &k_font_Roboto_Bold_10_1bpp_c124[0] }, 210 | /* '}' (0x7D) */ { 3, 10, 0, 8, 3, &k_font_Roboto_Bold_10_1bpp_c125[0] }, 211 | /* '~' (0x7E) */ { 5, 2, 1, 4, 6, &k_font_Roboto_Bold_10_1bpp_c126[0] }, 212 | }; 213 | 214 | // font 215 | const PROGMEM sl::rastr::Font k_font_Roboto_Bold_10_1bpp = { 216 | /* name and size: */ { "Roboto", 10 }, 217 | /* bits/pixel: */ 1, 218 | /* line height: */ 10, 219 | /* first character: */ 32, 220 | /* last character: */ 126, 221 | &k_font_Roboto_Bold_10_1bpp_chars[0] 222 | }; 223 | 224 | // clang-format on 225 | 226 | -------------------------------------------------------------------------------- /test/src/fonts/default_monospace_8.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------------------- 2 | // Font: Default Monospace 3 | // Size: 8 4 | // Line height: 10 5 | // Number of chars: 94 6 | //-------------------------------------------------------------------------------------------------- 7 | 8 | #ifdef ARDUINO 9 | #include 10 | #else 11 | #define PROGMEM 12 | #endif 13 | 14 | // clang-format off 15 | 16 | // bitmap data 17 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c0[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 18 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c1[] = {0x00, 0x3E, 0x41, 0x55, 0x41, 0x55, 0x49, 0x3E}; 19 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c2[] = {0x00, 0x3E, 0x7F, 0x6B, 0x7F, 0x6B, 0x77, 0x3E}; 20 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c3[] = {0x00, 0x22, 0x77, 0x7F, 0x7F, 0x3E, 0x1C, 0x08}; 21 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c4[] = {0x00, 0x08, 0x1C, 0x3E, 0x7F, 0x3E, 0x1C, 0x08}; 22 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c5[] = {0x00, 0x08, 0x1C, 0x2A, 0x7F, 0x2A, 0x08, 0x1C}; 23 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c6[] = {0x00, 0x08, 0x1C, 0x3E, 0x7F, 0x3E, 0x08, 0x1C}; 24 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c7[] = {0x00, 0x00, 0x1C, 0x3E, 0x3E, 0x3E, 0x1C, 0x00}; 25 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c8[] = {0xFF, 0xFF, 0xE3, 0xC1, 0xC1, 0xC1, 0xE3, 0xFF}; 26 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c9[] = {0x00, 0x00, 0x1C, 0x22, 0x22, 0x22, 0x1C, 0x00}; 27 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c10[] = {0xFF, 0xFF, 0xE3, 0xDD, 0xDD, 0xDD, 0xE3, 0xFF}; 28 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c11[] = {0x00, 0x0F, 0x03, 0x05, 0x39, 0x48, 0x48, 0x30}; 29 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c12[] = {0x1C, 0x22, 0x22, 0x1C, 0x08, 0x3E, 0x08, 0x00}; 30 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c13[] = {0x00, 0x18, 0x14, 0x10, 0x10, 0x30, 0x70, 0x60}; 31 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c14[] = {0x00, 0x0F, 0x19, 0x11, 0x13, 0x37, 0x76, 0x60}; 32 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c15[] = {0x00, 0x08, 0x2A, 0x1C, 0x77, 0x1C, 0x2A, 0x08}; 33 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c16[] = {0x00, 0x60, 0x78, 0x7E, 0x7F, 0x7E, 0x78, 0x60}; 34 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c17[] = {0x00, 0x03, 0x0F, 0x3F, 0x7F, 0x3F, 0x0F, 0x03}; 35 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c18[] = {0x00, 0x08, 0x1C, 0x2A, 0x08, 0x2A, 0x1C, 0x08}; 36 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c19[] = {0x00, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66}; 37 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c20[] = {0x00, 0x3F, 0x65, 0x65, 0x3D, 0x05, 0x05, 0x05}; 38 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c21[] = {0x00, 0x0C, 0x32, 0x48, 0x24, 0x12, 0x4C, 0x30}; 39 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c22[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x7F}; 40 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c23[] = {0x00, 0x08, 0x1C, 0x2A, 0x08, 0x2A, 0x1C, 0x3E}; 41 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c24[] = {0x00, 0x08, 0x1C, 0x3E, 0x7F, 0x1C, 0x1C, 0x1C}; 42 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c25[] = {0x00, 0x1C, 0x1C, 0x1C, 0x7F, 0x3E, 0x1C, 0x08}; 43 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c26[] = {0x00, 0x08, 0x0C, 0x7E, 0x7F, 0x7E, 0x0C, 0x08}; 44 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c27[] = {0x00, 0x08, 0x18, 0x3F, 0x7F, 0x3F, 0x18, 0x08}; 45 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c28[] = {0x00, 0x00, 0x00, 0x70, 0x70, 0x70, 0x7F, 0x7F}; 46 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c29[] = {0x00, 0x00, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00}; 47 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c30[] = {0x00, 0x08, 0x1C, 0x1C, 0x3E, 0x3E, 0x7F, 0x7F}; 48 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c31[] = {0x00, 0x7F, 0x7F, 0x3E, 0x3E, 0x1C, 0x1C, 0x08}; 49 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c32[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 50 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c33[] = {0x00, 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18}; 51 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c34[] = {0x00, 0x36, 0x36, 0x14, 0x00, 0x00, 0x00, 0x00}; 52 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c35[] = {0x00, 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36}; 53 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c36[] = {0x00, 0x08, 0x1E, 0x20, 0x1C, 0x02, 0x3C, 0x08}; 54 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c37[] = {0x00, 0x60, 0x66, 0x0C, 0x18, 0x30, 0x66, 0x06}; 55 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c38[] = {0x00, 0x3C, 0x66, 0x3C, 0x28, 0x65, 0x66, 0x3F}; 56 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c39[] = {0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00}; 57 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c40[] = {0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60}; 58 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c41[] = {0x00, 0x06, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x06}; 59 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c42[] = {0x00, 0x00, 0x36, 0x1C, 0x7F, 0x1C, 0x36, 0x00}; 60 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c43[] = {0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00}; 61 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c44[] = {0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x60}; 62 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c45[] = {0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00}; 63 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c46[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60}; 64 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c47[] = {0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00}; 65 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c48[] = {0x00, 0x3C, 0x66, 0x6E, 0x76, 0x66, 0x66, 0x3C}; 66 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c49[] = {0x00, 0x18, 0x18, 0x38, 0x18, 0x18, 0x18, 0x7E}; 67 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c50[] = {0x00, 0x3C, 0x66, 0x06, 0x0C, 0x30, 0x60, 0x7E}; 68 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c51[] = {0x00, 0x3C, 0x66, 0x06, 0x1C, 0x06, 0x66, 0x3C}; 69 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c52[] = {0x00, 0x0C, 0x1C, 0x2C, 0x4C, 0x7E, 0x0C, 0x0C}; 70 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c53[] = {0x00, 0x7E, 0x60, 0x7C, 0x06, 0x06, 0x66, 0x3C}; 71 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c54[] = {0x00, 0x3C, 0x66, 0x60, 0x7C, 0x66, 0x66, 0x3C}; 72 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c55[] = {0x00, 0x7E, 0x66, 0x0C, 0x0C, 0x18, 0x18, 0x18}; 73 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c56[] = {0x00, 0x3C, 0x66, 0x66, 0x3C, 0x66, 0x66, 0x3C}; 74 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c57[] = {0x00, 0x3C, 0x66, 0x66, 0x3E, 0x06, 0x66, 0x3C}; 75 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c58[] = {0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00}; 76 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c59[] = {0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x30}; 77 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c60[] = {0x00, 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06}; 78 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c61[] = {0x00, 0x00, 0x00, 0x3C, 0x00, 0x3C, 0x00, 0x00}; 79 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c62[] = {0x00, 0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60}; 80 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c63[] = {0x00, 0x3C, 0x66, 0x06, 0x1C, 0x18, 0x00, 0x18}; 81 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c64[] = {0x00, 0x38, 0x44, 0x5C, 0x58, 0x42, 0x3C, 0x00}; 82 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c65[] = {0x00, 0x3C, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66}; 83 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c66[] = {0x00, 0x7C, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x7C}; 84 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c67[] = {0x00, 0x3C, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3C}; 85 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c68[] = {0x00, 0x7C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7C}; 86 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c69[] = {0x00, 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x7E}; 87 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c70[] = {0x00, 0x7E, 0x60, 0x60, 0x7C, 0x60, 0x60, 0x60}; 88 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c71[] = {0x00, 0x3C, 0x66, 0x60, 0x60, 0x6E, 0x66, 0x3C}; 89 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c72[] = {0x00, 0x66, 0x66, 0x66, 0x7E, 0x66, 0x66, 0x66}; 90 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c73[] = {0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C}; 91 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c74[] = {0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0x6C, 0x6C, 0x38}; 92 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c75[] = {0x00, 0x66, 0x6C, 0x78, 0x70, 0x78, 0x6C, 0x66}; 93 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c76[] = {0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7E}; 94 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c77[] = {0x00, 0x63, 0x77, 0x7F, 0x6B, 0x63, 0x63, 0x63}; 95 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c78[] = {0x00, 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x63, 0x63}; 96 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c79[] = {0x00, 0x3C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C}; 97 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c80[] = {0x00, 0x7C, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60}; 98 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c81[] = {0x00, 0x3C, 0x66, 0x66, 0x66, 0x6E, 0x3C, 0x06}; 99 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c82[] = {0x00, 0x7C, 0x66, 0x66, 0x7C, 0x78, 0x6C, 0x66}; 100 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c83[] = {0x00, 0x3C, 0x66, 0x60, 0x3C, 0x06, 0x66, 0x3C}; 101 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c84[] = {0x00, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x18, 0x18}; 102 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c85[] = {0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3E}; 103 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c86[] = {0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18}; 104 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c87[] = {0x00, 0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63}; 105 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c88[] = {0x00, 0x63, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x63}; 106 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c89[] = {0x00, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18}; 107 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c90[] = {0x00, 0x7E, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x7E}; 108 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c91[] = {0x00, 0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E}; 109 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c92[] = {0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00}; 110 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c93[] = {0x00, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78}; 111 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c94[] = {0x00, 0x08, 0x14, 0x22, 0x41, 0x00, 0x00, 0x00}; 112 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c95[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F}; 113 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c96[] = {0x00, 0x0C, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x00}; 114 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c97[] = {0x00, 0x00, 0x00, 0x3C, 0x06, 0x3E, 0x66, 0x3E}; 115 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c98[] = {0x00, 0x60, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x7C}; 116 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c99[] = {0x00, 0x00, 0x00, 0x3C, 0x66, 0x60, 0x66, 0x3C}; 117 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c100[] = {0x00, 0x06, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3E}; 118 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c101[] = {0x00, 0x00, 0x00, 0x3C, 0x66, 0x7E, 0x60, 0x3C}; 119 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c102[] = {0x00, 0x1C, 0x36, 0x30, 0x30, 0x7C, 0x30, 0x30}; 120 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c103[] = {0x00, 0x00, 0x3E, 0x66, 0x66, 0x3E, 0x06, 0x3C}; 121 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c104[] = {0x00, 0x60, 0x60, 0x60, 0x7C, 0x66, 0x66, 0x66}; 122 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c105[] = {0x00, 0x00, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3C}; 123 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c106[] = {0x00, 0x0C, 0x00, 0x0C, 0x0C, 0x6C, 0x6C, 0x38}; 124 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c107[] = {0x00, 0x60, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0x66}; 125 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c108[] = {0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}; 126 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c109[] = {0x00, 0x00, 0x00, 0x63, 0x77, 0x7F, 0x6B, 0x6B}; 127 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c110[] = {0x00, 0x00, 0x00, 0x7C, 0x7E, 0x66, 0x66, 0x66}; 128 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c111[] = {0x00, 0x00, 0x00, 0x3C, 0x66, 0x66, 0x66, 0x3C}; 129 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c112[] = {0x00, 0x00, 0x7C, 0x66, 0x66, 0x7C, 0x60, 0x60}; 130 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c113[] = {0x00, 0x00, 0x3C, 0x6C, 0x6C, 0x3C, 0x0D, 0x0F}; 131 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c114[] = {0x00, 0x00, 0x00, 0x7C, 0x66, 0x66, 0x60, 0x60}; 132 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c115[] = {0x00, 0x00, 0x00, 0x3E, 0x40, 0x3C, 0x02, 0x7C}; 133 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c116[] = {0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x18}; 134 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c117[] = {0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3E}; 135 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c118[] = {0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x3C, 0x18}; 136 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c119[] = {0x00, 0x00, 0x00, 0x63, 0x6B, 0x6B, 0x6B, 0x3E}; 137 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c120[] = {0x00, 0x00, 0x00, 0x66, 0x3C, 0x18, 0x3C, 0x66}; 138 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c121[] = {0x00, 0x00, 0x00, 0x66, 0x66, 0x3E, 0x06, 0x3C}; 139 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c122[] = {0x00, 0x00, 0x00, 0x3C, 0x0C, 0x18, 0x30, 0x3C}; 140 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c123[] = {0x00, 0x0E, 0x18, 0x18, 0x30, 0x18, 0x18, 0x0E}; 141 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c124[] = {0x00, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18}; 142 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c125[] = {0x00, 0x70, 0x18, 0x18, 0x0C, 0x18, 0x18, 0x70}; 143 | const PROGMEM uint8_t k_font_DefaultMonospace_8_c126[] = {0x00, 0x00, 0x00, 0x3A, 0x6C, 0x00, 0x00, 0x00}; 144 | 145 | 146 | // character data 147 | const PROGMEM sl::rastr::Character k_font_DefaultMonospace_8_chars[] = { 148 | // W H XOff YOff XAdv Data 149 | /* ' ' (0x20) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c32[0]}, 150 | /* '!' (0x21) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c33[0]}, 151 | /* '"' (0x22) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c34[0]}, 152 | /* '#' (0x23) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c35[0]}, 153 | /* '$' (0x24) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c36[0]}, 154 | /* '%' (0x25) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c37[0]}, 155 | /* '&' (0x26) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c38[0]}, 156 | /* ''' (0x27) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c39[0]}, 157 | /* '(' (0x28) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c40[0]}, 158 | /* ')' (0x29) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c41[0]}, 159 | /* '*' (0x2A) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c42[0]}, 160 | /* '+' (0x2B) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c43[0]}, 161 | /* ',' (0x2C) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c44[0]}, 162 | /* '-' (0x2D) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c45[0]}, 163 | /* '.' (0x2E) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c46[0]}, 164 | /* '/' (0x2F) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c47[0]}, 165 | /* '0' (0x30) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c48[0]}, 166 | /* '1' (0x31) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c49[0]}, 167 | /* '2' (0x32) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c50[0]}, 168 | /* '3' (0x33) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c51[0]}, 169 | /* '4' (0x34) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c52[0]}, 170 | /* '5' (0x35) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c53[0]}, 171 | /* '6' (0x36) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c54[0]}, 172 | /* '7' (0x37) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c55[0]}, 173 | /* '8' (0x38) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c56[0]}, 174 | /* '9' (0x39) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c57[0]}, 175 | /* ':' (0x3A) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c58[0]}, 176 | /* ';' (0x3B) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c59[0]}, 177 | /* '<' (0x3C) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c60[0]}, 178 | /* '=' (0x3D) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c61[0]}, 179 | /* '>' (0x3E) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c62[0]}, 180 | /* '?' (0x3F) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c63[0]}, 181 | /* '@' (0x40) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c64[0]}, 182 | /* 'A' (0x41) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c65[0]}, 183 | /* 'B' (0x42) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c66[0]}, 184 | /* 'C' (0x43) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c67[0]}, 185 | /* 'D' (0x44) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c68[0]}, 186 | /* 'E' (0x45) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c69[0]}, 187 | /* 'F' (0x46) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c70[0]}, 188 | /* 'G' (0x47) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c71[0]}, 189 | /* 'H' (0x48) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c72[0]}, 190 | /* 'I' (0x49) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c73[0]}, 191 | /* 'J' (0x4A) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c74[0]}, 192 | /* 'K' (0x4B) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c75[0]}, 193 | /* 'L' (0x4C) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c76[0]}, 194 | /* 'M' (0x4D) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c77[0]}, 195 | /* 'N' (0x4E) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c78[0]}, 196 | /* 'O' (0x4F) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c79[0]}, 197 | /* 'P' (0x50) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c80[0]}, 198 | /* 'Q' (0x51) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c81[0]}, 199 | /* 'R' (0x52) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c82[0]}, 200 | /* 'S' (0x53) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c83[0]}, 201 | /* 'T' (0x54) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c84[0]}, 202 | /* 'U' (0x55) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c85[0]}, 203 | /* 'V' (0x56) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c86[0]}, 204 | /* 'W' (0x57) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c87[0]}, 205 | /* 'X' (0x58) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c88[0]}, 206 | /* 'Y' (0x59) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c89[0]}, 207 | /* 'Z' (0x5A) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c90[0]}, 208 | /* '[' (0x5B) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c91[0]}, 209 | /* '\' (0x5C) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c92[0]}, 210 | /* ']' (0x5D) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c93[0]}, 211 | /* '^' (0x5E) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c94[0]}, 212 | /* '_' (0x5F) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c95[0]}, 213 | /* '`' (0x60) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c96[0]}, 214 | /* 'a' (0x61) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c97[0]}, 215 | /* 'b' (0x62) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c98[0]}, 216 | /* 'c' (0x63) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c99[0]}, 217 | /* 'd' (0x64) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c100[0]}, 218 | /* 'e' (0x65) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c101[0]}, 219 | /* 'f' (0x66) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c102[0]}, 220 | /* 'g' (0x67) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c103[0]}, 221 | /* 'h' (0x68) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c104[0]}, 222 | /* 'i' (0x69) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c105[0]}, 223 | /* 'j' (0x6A) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c106[0]}, 224 | /* 'k' (0x6B) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c107[0]}, 225 | /* 'l' (0x6C) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c108[0]}, 226 | /* 'm' (0x6D) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c109[0]}, 227 | /* 'n' (0x6E) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c110[0]}, 228 | /* 'o' (0x6F) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c111[0]}, 229 | /* 'p' (0x70) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c112[0]}, 230 | /* 'q' (0x71) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c113[0]}, 231 | /* 'r' (0x72) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c114[0]}, 232 | /* 's' (0x73) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c115[0]}, 233 | /* 't' (0x74) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c116[0]}, 234 | /* 'u' (0x75) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c117[0]}, 235 | /* 'v' (0x76) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c118[0]}, 236 | /* 'w' (0x77) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c119[0]}, 237 | /* 'x' (0x78) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c120[0]}, 238 | /* 'y' (0x79) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c121[0]}, 239 | /* 'z' (0x7A) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c122[0]}, 240 | /* '{' (0x7B) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c123[0]}, 241 | /* '|' (0x7C) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c124[0]}, 242 | /* '}' (0x7D) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c125[0]}, 243 | /* '~' (0x7E) */ {8, 8, 0, 8, 9, &k_font_DefaultMonospace_8_c126[0]}, 244 | }; 245 | 246 | // font 247 | const PROGMEM sl::rastr::Font k_font_DefaultMonospace_8 = { 248 | /* name and size: */ {"Default Monospace", 8}, 249 | /* bits/pixel: */ 1, 250 | /* line height: */ 9, 251 | /* first character: */ 32, 252 | /* last character: */ 126, 253 | &k_font_DefaultMonospace_8_chars[0] 254 | }; 255 | 256 | // clang-format on 257 | --------------------------------------------------------------------------------