Files reorganization, bitmap fonts convertor tool, style fixes, terminus fonts
Three new fonts
This commit is contained in:
parent
861fe94bd3
commit
02da6d83a7
27 changed files with 8235 additions and 15576 deletions
|
|
@ -53,10 +53,15 @@ static const ssd1306_t dev = {
|
|||
/* Local frame buffer */
|
||||
static uint8_t buffer[DISPLAY_WIDTH * DISPLAY_HEIGHT / 8];
|
||||
|
||||
TimerHandle_t timerHandle = 0; // Timer handler
|
||||
TimerHandle_t fps_timer_handle = NULL; // Timer handler
|
||||
TimerHandle_t font_timer_handle = NULL;
|
||||
|
||||
uint8_t frame_done = 0; // number of frame send.
|
||||
uint8_t fps = 0; // image per second.
|
||||
|
||||
const font_info_t *font = NULL; // current font
|
||||
font_face_t font_face = 0;
|
||||
|
||||
#define SECOND (1000 / portTICK_PERIOD_MS)
|
||||
|
||||
static void ssd1306_task(void *pvParameters)
|
||||
|
|
@ -72,23 +77,15 @@ static void ssd1306_task(void *pvParameters)
|
|||
uint8_t x1 = LOAD_ICON_X + LOAD_ICON_SIZE;
|
||||
uint8_t y1 = LOAD_ICON_Y + LOAD_ICON_SIZE;
|
||||
uint16_t count = 0;
|
||||
uint8_t font = 0;
|
||||
//ssd1306_select_font(FONT_FACE_TERMINUS_BOLD_8X14_KOI8_R);
|
||||
|
||||
while (1) {
|
||||
|
||||
if (!(count % 200))
|
||||
while (true)
|
||||
{
|
||||
if (font++ >= FONT_FACE_MAX) font = 0;
|
||||
if (!ssd1306_select_font(font)) break;
|
||||
}
|
||||
ssd1306_draw_string(&dev, buffer, font, 0, 0, "Hello, esp-open-rtos!", OLED_COLOR_WHITE, OLED_COLOR_BLACK);
|
||||
sprintf(text, "FPS: %u ", fps);
|
||||
ssd1306_draw_string(&dev, buffer, font_builtin_fonts[FONT_FACE_TERMINUS_6X12_KOI8_R],
|
||||
0, 40, text, OLED_COLOR_WHITE, OLED_COLOR_BLACK);
|
||||
|
||||
ssd1306_draw_string(&dev, buffer, 10, 10,"Hello, esp-open-rtos !", OLED_COLOR_WHITE, OLED_COLOR_BLACK);
|
||||
sprintf(text,"FPS: %u",fps);
|
||||
ssd1306_draw_string(&dev, buffer, 10, 40, text, OLED_COLOR_WHITE, OLED_COLOR_BLACK);
|
||||
|
||||
//generate loading icon
|
||||
// generate loading icon
|
||||
ssd1306_draw_line(&dev, buffer, x0, y0, x1, y1, OLED_COLOR_BLACK);
|
||||
if (x0 < (LOAD_ICON_X + LOAD_ICON_SIZE)) {
|
||||
x0++;
|
||||
|
|
@ -108,7 +105,7 @@ static void ssd1306_task(void *pvParameters)
|
|||
ssd1306_draw_rectangle(&dev, buffer, LOAD_ICON_X, LOAD_ICON_Y,
|
||||
LOAD_ICON_SIZE + 1, LOAD_ICON_SIZE + 1, OLED_COLOR_WHITE);
|
||||
|
||||
//generate circle counting
|
||||
// generate circle counting
|
||||
for (uint8_t i = 0; i < 10; i++) {
|
||||
if ((count >> i) & 0x01)
|
||||
ssd1306_draw_circle(&dev, buffer, CIRCLE_COUNT_ICON_X, CIRCLE_COUNT_ICON_Y, i, OLED_COLOR_BLACK);
|
||||
|
|
@ -135,12 +132,23 @@ error_loop:
|
|||
}
|
||||
}
|
||||
|
||||
void SoftTimer(TimerHandle_t xTimer)
|
||||
void fps_timer(TimerHandle_t h)
|
||||
{
|
||||
fps = frame_done; // Save number of frame already send to screen
|
||||
frame_done = 0;
|
||||
}
|
||||
|
||||
void font_timer(TimerHandle_t h)
|
||||
{
|
||||
do {
|
||||
if (++font_face >= font_builtin_fonts_count)
|
||||
font_face = 0;
|
||||
font = font_builtin_fonts[font_face];
|
||||
} while (!font);
|
||||
|
||||
printf("Selected builtin font %d\n", font_face);
|
||||
}
|
||||
|
||||
void user_init(void)
|
||||
{
|
||||
//uncomment to test with CPU overclocked
|
||||
|
|
@ -162,9 +170,14 @@ void user_init(void)
|
|||
ssd1306_set_whole_display_lighting(&dev, true);
|
||||
vTaskDelay(SECOND);
|
||||
|
||||
font = font_builtin_fonts[font_face];
|
||||
|
||||
// Create user interface task
|
||||
xTaskCreate(ssd1306_task, "ssd1306_task", 256, NULL, 2, NULL);
|
||||
|
||||
timerHandle = xTimerCreate("Timer", SECOND, pdTRUE, NULL, SoftTimer);
|
||||
xTimerStart(timerHandle, 0);
|
||||
fps_timer_handle = xTimerCreate("fps_timer", SECOND, pdTRUE, NULL, fps_timer);
|
||||
xTimerStart(fps_timer_handle, 0);
|
||||
|
||||
font_timer_handle = xTimerCreate("font_timer", 5 * SECOND, pdTRUE, NULL, font_timer);
|
||||
xTimerStart(font_timer_handle, 0);
|
||||
}
|
||||
|
|
|
|||
97
extras/fonts/OFL.txt
Normal file
97
extras/fonts/OFL.txt
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
Copyright (c) <dates>, <Copyright Holder> (<URL|email>),
|
||||
with Reserved Font Name <Reserved Font Name>.
|
||||
Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>),
|
||||
with Reserved Font Name <additional Reserved Font Name>.
|
||||
Copyright (c) <dates>, <additional Copyright Holder> (<URL|email>).
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
|
@ -1,19 +1,29 @@
|
|||
# Component makefile for extras/fonts
|
||||
|
||||
# expected anyone using bmp driver includes it as 'fonts/fonts.h'
|
||||
# expected anyone using this component includes it as 'fonts/fonts.h'
|
||||
INC_DIRS += $(fonts_ROOT)..
|
||||
|
||||
# args for passing into compile rule generation
|
||||
fonts_SRC_DIR = $(fonts_ROOT)
|
||||
fonts_SRC_DIR = $(fonts_ROOT)
|
||||
|
||||
FONTS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
|
||||
# fonts by default
|
||||
# default builtin fonts
|
||||
include $(FONTS_DIR)defaults.mk
|
||||
|
||||
fonts_CFLAGS = $(CFLAGS) \
|
||||
-DFONTS_GLCD_5X7=$(FONTS_GLCD_5X7)
|
||||
-DFONTS_ROBOTO_8PT=$(FONTS_ROBOTO_8PT)
|
||||
-DFONTS_ROBOTO_10PT=$(FONTS_ROBOTO_10PT)
|
||||
-DFONTS_GLCD_5X7=$(FONTS_GLCD_5X7) \
|
||||
-DFONTS_ROBOTO_8PT=$(FONTS_ROBOTO_8PT) \
|
||||
-DFONTS_ROBOTO_10PT=$(FONTS_ROBOTO_10PT) \
|
||||
-DFONTS_BITOCRA_4X7=$(FONTS_BITOCRA_4X7) \
|
||||
-DFONTS_BITOCRA_6X11=$(FONTS_BITOCRA_6X11) \
|
||||
-DFONTS_BITOCRA_7X13=$(FONTS_BITOCRA_7X13) \
|
||||
-DFONTS_TERMINUS_6X12_KOI8_R=$(FONTS_TERMINUS_6X12_KOI8_R) \
|
||||
-DFONTS_TERMINUS_8X14_KOI8_R=$(FONTS_TERMINUS_8X14_KOI8_R) \
|
||||
-DFONTS_TERMINUS_BOLD_8X14_KOI8_R=$(FONTS_TERMINUS_BOLD_8X14_KOI8_R) \
|
||||
-DFONTS_TERMINUS_14X28_KOI8_R=$(FONTS_TERMINUS_14X28_KOI8_R) \
|
||||
-DFONTS_TERMINUS_BOLD_14X28_KOI8_R=$(FONTS_TERMINUS_BOLD_14X28_KOI8_R) \
|
||||
-DFONTS_TERMINUS_16X32_KOI8_R=$(FONTS_TERMINUS_16X32_KOI8_R) \
|
||||
-DFONTS_TERMINUS_BOLD_16X32_KOI8_R=$(FONTS_TERMINUS_BOLD_16X32_KOI8_R)
|
||||
|
||||
$(eval $(call component_compile_rules,fonts))
|
||||
|
|
|
|||
|
|
@ -14,6 +14,18 @@
|
|||
#define FONTS_ROBOTO_10PT 0
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_BITOCRA_4X7
|
||||
#define FONTS_BITOCRA_4X7 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_BITOCRA_6X11
|
||||
#define FONTS_BITOCRA_6X11 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_BITOCRA_7X13
|
||||
#define FONTS_BITOCRA_7X13 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_6X12_KOI8_R
|
||||
#define FONTS_TERMINUS_6X12_KOI8_R 1
|
||||
#endif
|
||||
|
|
@ -26,14 +38,6 @@
|
|||
#define FONTS_TERMINUS_BOLD_8X14_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_8X16_KOI8_R
|
||||
#define FONTS_TERMINUS_8X16_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_BOLD_8X16_KOI8_R
|
||||
#define FONTS_TERMINUS_BOLD_8X16_KOI8_R 1
|
||||
#endif
|
||||
|
||||
#ifndef FONTS_TERMINUS_14X28_KOI8_R
|
||||
#define FONTS_TERMINUS_14X28_KOI8_R 1
|
||||
#endif
|
||||
|
|
|
|||
993
extras/fonts/data/font_bitocra_4x7_ascii.h
Normal file
993
extras/fonts/data/font_bitocra_4x7_ascii.h
Normal file
|
|
@ -0,0 +1,993 @@
|
|||
/**
|
||||
* This file contains generated binary font data.
|
||||
*
|
||||
* Font: BitOCRA
|
||||
* Size: 4x7
|
||||
* Charset: ASCII
|
||||
* 96 characters (32..127)
|
||||
*
|
||||
* Copyright (c) 2011, Aaron Christianson <ninjaaron@gmail.com> (https://github.com/ninjaaron)
|
||||
* Licensed under the OFL v1.1
|
||||
*
|
||||
* Generated: Mon Dec 12 00:46:53 2016
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_BITOCRA_4X7_ASCII_H_
|
||||
#define _EXTRAS_FONTS_FONT_BITOCRA_4X7_ASCII_H_
|
||||
|
||||
static const uint8_t _fonts_bitocra_4x7_ascii_bitmaps[] = {
|
||||
|
||||
/* Index: 0x00, char: \x20, offset: 0x0000 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x01, char: \x21, offset: 0x0007 */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x02, char: \x22, offset: 0x000e */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x03, char: \x23, offset: 0x0015 */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x04, char: \x24, offset: 0x001c */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0xe0, /* ###..... */
|
||||
0xc0, /* ##...... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x40, /* .#...... */
|
||||
|
||||
/* Index: 0x05, char: \x25, offset: 0x0023 */
|
||||
0x00, /* ........ */
|
||||
0x80, /* #....... */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x80, /* #....... */
|
||||
0x20, /* ..#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x06, char: \x26, offset: 0x002a */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x80, /* #....... */
|
||||
0x50, /* .#.#.... */
|
||||
0xa0, /* #.#..... */
|
||||
0x50, /* .#.#.... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x07, char: \x27, offset: 0x0031 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x08, char: \x28, offset: 0x0038 */
|
||||
0x00, /* ........ */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x20, /* ..#..... */
|
||||
|
||||
/* Index: 0x09, char: \x29, offset: 0x003f */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
|
||||
/* Index: 0x0a, char: \x2a, offset: 0x0046 */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0xe0, /* ###..... */
|
||||
0x40, /* .#...... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x0b, char: \x2b, offset: 0x004d */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0xe0, /* ###..... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x0c, char: \x2c, offset: 0x0054 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x20, /* ..#..... */
|
||||
|
||||
/* Index: 0x0d, char: \x2d, offset: 0x005b */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x0e, char: \x2e, offset: 0x0062 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x0f, char: \x2f, offset: 0x0069 */
|
||||
0x00, /* ........ */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
|
||||
/* Index: 0x10, char: \x30, offset: 0x0070 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x11, char: \x31, offset: 0x0077 */
|
||||
0x00, /* ........ */
|
||||
0xc0, /* ##...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x12, char: \x32, offset: 0x007e */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x13, char: \x33, offset: 0x0085 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0x60, /* .##..... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x14, char: \x34, offset: 0x008c */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x15, char: \x35, offset: 0x0093 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x16, char: \x36, offset: 0x009a */
|
||||
0x00, /* ........ */
|
||||
0xc0, /* ##...... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x17, char: \x37, offset: 0x00a1 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x18, char: \x38, offset: 0x00a8 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x60, /* .##..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x19, char: \x39, offset: 0x00af */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0x60, /* .##..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x1a, char: \x3a, offset: 0x00b6 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x1b, char: \x3b, offset: 0x00bd */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x20, /* ..#..... */
|
||||
|
||||
/* Index: 0x1c, char: \x3c, offset: 0x00c4 */
|
||||
0x00, /* ........ */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x80, /* #....... */
|
||||
0x40, /* .#...... */
|
||||
0x20, /* ..#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x1d, char: \x3d, offset: 0x00cb */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x1e, char: \x3e, offset: 0x00d2 */
|
||||
0x00, /* ........ */
|
||||
0x80, /* #....... */
|
||||
0x40, /* .#...... */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x80, /* #....... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x1f, char: \x3f, offset: 0x00d9 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
|
||||
/* Index: 0x20, char: \x40, offset: 0x00e0 */
|
||||
0x00, /* ........ */
|
||||
0xf0, /* ####.... */
|
||||
0x90, /* #..#.... */
|
||||
0x50, /* .#.#.... */
|
||||
0xd0, /* ##.#.... */
|
||||
0xf0, /* ####.... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x21, char: \x41, offset: 0x00e7 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x22, char: \x42, offset: 0x00ee */
|
||||
0x00, /* ........ */
|
||||
0xc0, /* ##...... */
|
||||
0xc0, /* ##...... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x23, char: \x43, offset: 0x00f5 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x24, char: \x44, offset: 0x00fc */
|
||||
0x00, /* ........ */
|
||||
0xc0, /* ##...... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xc0, /* ##...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x25, char: \x45, offset: 0x0103 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0xc0, /* ##...... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x26, char: \x46, offset: 0x010a */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0xc0, /* ##...... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x27, char: \x47, offset: 0x0111 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x80, /* #....... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x28, char: \x48, offset: 0x0118 */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x29, char: \x49, offset: 0x011f */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x2a, char: \x4a, offset: 0x0126 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x2b, char: \x4b, offset: 0x012d */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xc0, /* ##...... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x2c, char: \x4c, offset: 0x0134 */
|
||||
0x00, /* ........ */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x2d, char: \x4d, offset: 0x013b */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x2e, char: \x4e, offset: 0x0142 */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x2f, char: \x4f, offset: 0x0149 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x30, char: \x50, offset: 0x0150 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x31, char: \x51, offset: 0x0157 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xc0, /* ##...... */
|
||||
0x60, /* .##..... */
|
||||
|
||||
/* Index: 0x32, char: \x52, offset: 0x015e */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xc0, /* ##...... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x33, char: \x53, offset: 0x0165 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x34, char: \x54, offset: 0x016c */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x35, char: \x55, offset: 0x0173 */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x36, char: \x56, offset: 0x017a */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xc0, /* ##...... */
|
||||
0x80, /* #....... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x37, char: \x57, offset: 0x0181 */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x38, char: \x58, offset: 0x0188 */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x40, /* .#...... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x39, char: \x59, offset: 0x018f */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x3a, char: \x5a, offset: 0x0196 */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0x40, /* .#...... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x3b, char: \x5b, offset: 0x019d */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xc0, /* ##...... */
|
||||
0xc0, /* ##...... */
|
||||
0xc0, /* ##...... */
|
||||
0xc0, /* ##...... */
|
||||
0xe0, /* ###..... */
|
||||
|
||||
/* Index: 0x3c, char: \x5c, offset: 0x01a4 */
|
||||
0x00, /* ........ */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
|
||||
/* Index: 0x3d, char: \x5d, offset: 0x01ab */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x60, /* .##..... */
|
||||
0x60, /* .##..... */
|
||||
0x60, /* .##..... */
|
||||
0x60, /* .##..... */
|
||||
0xe0, /* ###..... */
|
||||
|
||||
/* Index: 0x3e, char: \x5e, offset: 0x01b2 */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x3f, char: \x5f, offset: 0x01b9 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xf0, /* ####.... */
|
||||
|
||||
/* Index: 0x40, char: \x60, offset: 0x01c0 */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x20, /* ..#..... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x41, char: \x61, offset: 0x01c7 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x42, char: \x62, offset: 0x01ce */
|
||||
0x00, /* ........ */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x43, char: \x63, offset: 0x01d5 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x44, char: \x64, offset: 0x01dc */
|
||||
0x00, /* ........ */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x45, char: \x65, offset: 0x01e3 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x46, char: \x66, offset: 0x01ea */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x47, char: \x67, offset: 0x01f1 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
|
||||
/* Index: 0x48, char: \x68, offset: 0x01f8 */
|
||||
0x00, /* ........ */
|
||||
0x80, /* #....... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x49, char: \x69, offset: 0x01ff */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
0xc0, /* ##...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x4a, char: \x6a, offset: 0x0206 */
|
||||
0x20, /* ..#..... */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
|
||||
/* Index: 0x4b, char: \x6b, offset: 0x020d */
|
||||
0x00, /* ........ */
|
||||
0x80, /* #....... */
|
||||
0xa0, /* #.#..... */
|
||||
0xc0, /* ##...... */
|
||||
0xc0, /* ##...... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x4c, char: \x6c, offset: 0x0214 */
|
||||
0x00, /* ........ */
|
||||
0xc0, /* ##...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x60, /* .##..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x4d, char: \x6d, offset: 0x021b */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x4e, char: \x6e, offset: 0x0222 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x4f, char: \x6f, offset: 0x0229 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x50, char: \x70, offset: 0x0230 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
|
||||
/* Index: 0x51, char: \x71, offset: 0x0237 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0x20, /* ..#..... */
|
||||
|
||||
/* Index: 0x52, char: \x72, offset: 0x023e */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x80, /* #....... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x53, char: \x73, offset: 0x0245 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0x60, /* .##..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x54, char: \x74, offset: 0x024c */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x60, /* .##..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x60, /* .##..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x55, char: \x75, offset: 0x0253 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x56, char: \x76, offset: 0x025a */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x57, char: \x77, offset: 0x0261 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x58, char: \x78, offset: 0x0268 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0x40, /* .#...... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x59, char: \x79, offset: 0x026f */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
|
||||
/* Index: 0x5a, char: \x7a, offset: 0x0276 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0xe0, /* ###..... */
|
||||
0x60, /* .##..... */
|
||||
0xc0, /* ##...... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x5b, char: \x7b, offset: 0x027d */
|
||||
0x00, /* ........ */
|
||||
0x60, /* .##..... */
|
||||
0x40, /* .#...... */
|
||||
0xc0, /* ##...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x60, /* .##..... */
|
||||
|
||||
/* Index: 0x5c, char: \x7c, offset: 0x0284 */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x5d, char: \x7d, offset: 0x028b */
|
||||
0x00, /* ........ */
|
||||
0xc0, /* ##...... */
|
||||
0x40, /* .#...... */
|
||||
0x60, /* .##..... */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0xc0, /* ##...... */
|
||||
|
||||
/* Index: 0x5e, char: \x7e, offset: 0x0292 */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
0x20, /* ..#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x80, /* #....... */
|
||||
0x00, /* ........ */
|
||||
0x00, /* ........ */
|
||||
|
||||
/* Index: 0x5f, char: \x7f, offset: 0x0299 */
|
||||
0x00, /* ........ */
|
||||
0x40, /* .#...... */
|
||||
0x40, /* .#...... */
|
||||
0xa0, /* #.#..... */
|
||||
0xa0, /* #.#..... */
|
||||
0xe0, /* ###..... */
|
||||
0x00, /* ........ */
|
||||
};
|
||||
|
||||
const font_char_desc_t _fonts_bitocra_4x7_ascii_descriptors[] = {
|
||||
{ 0x04, 0x0000 }, /* Index: 0x00, char: \x20 */
|
||||
{ 0x04, 0x0007 }, /* Index: 0x01, char: \x21 */
|
||||
{ 0x04, 0x000e }, /* Index: 0x02, char: \x22 */
|
||||
{ 0x04, 0x0015 }, /* Index: 0x03, char: \x23 */
|
||||
{ 0x04, 0x001c }, /* Index: 0x04, char: \x24 */
|
||||
{ 0x04, 0x0023 }, /* Index: 0x05, char: \x25 */
|
||||
{ 0x04, 0x002a }, /* Index: 0x06, char: \x26 */
|
||||
{ 0x04, 0x0031 }, /* Index: 0x07, char: \x27 */
|
||||
{ 0x04, 0x0038 }, /* Index: 0x08, char: \x28 */
|
||||
{ 0x04, 0x003f }, /* Index: 0x09, char: \x29 */
|
||||
{ 0x04, 0x0046 }, /* Index: 0x0a, char: \x2a */
|
||||
{ 0x04, 0x004d }, /* Index: 0x0b, char: \x2b */
|
||||
{ 0x04, 0x0054 }, /* Index: 0x0c, char: \x2c */
|
||||
{ 0x04, 0x005b }, /* Index: 0x0d, char: \x2d */
|
||||
{ 0x04, 0x0062 }, /* Index: 0x0e, char: \x2e */
|
||||
{ 0x04, 0x0069 }, /* Index: 0x0f, char: \x2f */
|
||||
{ 0x04, 0x0070 }, /* Index: 0x10, char: \x30 */
|
||||
{ 0x04, 0x0077 }, /* Index: 0x11, char: \x31 */
|
||||
{ 0x04, 0x007e }, /* Index: 0x12, char: \x32 */
|
||||
{ 0x04, 0x0085 }, /* Index: 0x13, char: \x33 */
|
||||
{ 0x04, 0x008c }, /* Index: 0x14, char: \x34 */
|
||||
{ 0x04, 0x0093 }, /* Index: 0x15, char: \x35 */
|
||||
{ 0x04, 0x009a }, /* Index: 0x16, char: \x36 */
|
||||
{ 0x04, 0x00a1 }, /* Index: 0x17, char: \x37 */
|
||||
{ 0x04, 0x00a8 }, /* Index: 0x18, char: \x38 */
|
||||
{ 0x04, 0x00af }, /* Index: 0x19, char: \x39 */
|
||||
{ 0x04, 0x00b6 }, /* Index: 0x1a, char: \x3a */
|
||||
{ 0x04, 0x00bd }, /* Index: 0x1b, char: \x3b */
|
||||
{ 0x04, 0x00c4 }, /* Index: 0x1c, char: \x3c */
|
||||
{ 0x04, 0x00cb }, /* Index: 0x1d, char: \x3d */
|
||||
{ 0x04, 0x00d2 }, /* Index: 0x1e, char: \x3e */
|
||||
{ 0x04, 0x00d9 }, /* Index: 0x1f, char: \x3f */
|
||||
{ 0x04, 0x00e0 }, /* Index: 0x20, char: \x40 */
|
||||
{ 0x04, 0x00e7 }, /* Index: 0x21, char: \x41 */
|
||||
{ 0x04, 0x00ee }, /* Index: 0x22, char: \x42 */
|
||||
{ 0x04, 0x00f5 }, /* Index: 0x23, char: \x43 */
|
||||
{ 0x04, 0x00fc }, /* Index: 0x24, char: \x44 */
|
||||
{ 0x04, 0x0103 }, /* Index: 0x25, char: \x45 */
|
||||
{ 0x04, 0x010a }, /* Index: 0x26, char: \x46 */
|
||||
{ 0x04, 0x0111 }, /* Index: 0x27, char: \x47 */
|
||||
{ 0x04, 0x0118 }, /* Index: 0x28, char: \x48 */
|
||||
{ 0x04, 0x011f }, /* Index: 0x29, char: \x49 */
|
||||
{ 0x04, 0x0126 }, /* Index: 0x2a, char: \x4a */
|
||||
{ 0x04, 0x012d }, /* Index: 0x2b, char: \x4b */
|
||||
{ 0x04, 0x0134 }, /* Index: 0x2c, char: \x4c */
|
||||
{ 0x04, 0x013b }, /* Index: 0x2d, char: \x4d */
|
||||
{ 0x04, 0x0142 }, /* Index: 0x2e, char: \x4e */
|
||||
{ 0x04, 0x0149 }, /* Index: 0x2f, char: \x4f */
|
||||
{ 0x04, 0x0150 }, /* Index: 0x30, char: \x50 */
|
||||
{ 0x04, 0x0157 }, /* Index: 0x31, char: \x51 */
|
||||
{ 0x04, 0x015e }, /* Index: 0x32, char: \x52 */
|
||||
{ 0x04, 0x0165 }, /* Index: 0x33, char: \x53 */
|
||||
{ 0x04, 0x016c }, /* Index: 0x34, char: \x54 */
|
||||
{ 0x04, 0x0173 }, /* Index: 0x35, char: \x55 */
|
||||
{ 0x04, 0x017a }, /* Index: 0x36, char: \x56 */
|
||||
{ 0x04, 0x0181 }, /* Index: 0x37, char: \x57 */
|
||||
{ 0x04, 0x0188 }, /* Index: 0x38, char: \x58 */
|
||||
{ 0x04, 0x018f }, /* Index: 0x39, char: \x59 */
|
||||
{ 0x04, 0x0196 }, /* Index: 0x3a, char: \x5a */
|
||||
{ 0x04, 0x019d }, /* Index: 0x3b, char: \x5b */
|
||||
{ 0x04, 0x01a4 }, /* Index: 0x3c, char: \x5c */
|
||||
{ 0x04, 0x01ab }, /* Index: 0x3d, char: \x5d */
|
||||
{ 0x04, 0x01b2 }, /* Index: 0x3e, char: \x5e */
|
||||
{ 0x04, 0x01b9 }, /* Index: 0x3f, char: \x5f */
|
||||
{ 0x04, 0x01c0 }, /* Index: 0x40, char: \x60 */
|
||||
{ 0x04, 0x01c7 }, /* Index: 0x41, char: \x61 */
|
||||
{ 0x04, 0x01ce }, /* Index: 0x42, char: \x62 */
|
||||
{ 0x04, 0x01d5 }, /* Index: 0x43, char: \x63 */
|
||||
{ 0x04, 0x01dc }, /* Index: 0x44, char: \x64 */
|
||||
{ 0x04, 0x01e3 }, /* Index: 0x45, char: \x65 */
|
||||
{ 0x04, 0x01ea }, /* Index: 0x46, char: \x66 */
|
||||
{ 0x04, 0x01f1 }, /* Index: 0x47, char: \x67 */
|
||||
{ 0x04, 0x01f8 }, /* Index: 0x48, char: \x68 */
|
||||
{ 0x04, 0x01ff }, /* Index: 0x49, char: \x69 */
|
||||
{ 0x04, 0x0206 }, /* Index: 0x4a, char: \x6a */
|
||||
{ 0x04, 0x020d }, /* Index: 0x4b, char: \x6b */
|
||||
{ 0x04, 0x0214 }, /* Index: 0x4c, char: \x6c */
|
||||
{ 0x04, 0x021b }, /* Index: 0x4d, char: \x6d */
|
||||
{ 0x04, 0x0222 }, /* Index: 0x4e, char: \x6e */
|
||||
{ 0x04, 0x0229 }, /* Index: 0x4f, char: \x6f */
|
||||
{ 0x04, 0x0230 }, /* Index: 0x50, char: \x70 */
|
||||
{ 0x04, 0x0237 }, /* Index: 0x51, char: \x71 */
|
||||
{ 0x04, 0x023e }, /* Index: 0x52, char: \x72 */
|
||||
{ 0x04, 0x0245 }, /* Index: 0x53, char: \x73 */
|
||||
{ 0x04, 0x024c }, /* Index: 0x54, char: \x74 */
|
||||
{ 0x04, 0x0253 }, /* Index: 0x55, char: \x75 */
|
||||
{ 0x04, 0x025a }, /* Index: 0x56, char: \x76 */
|
||||
{ 0x04, 0x0261 }, /* Index: 0x57, char: \x77 */
|
||||
{ 0x04, 0x0268 }, /* Index: 0x58, char: \x78 */
|
||||
{ 0x04, 0x026f }, /* Index: 0x59, char: \x79 */
|
||||
{ 0x04, 0x0276 }, /* Index: 0x5a, char: \x7a */
|
||||
{ 0x04, 0x027d }, /* Index: 0x5b, char: \x7b */
|
||||
{ 0x04, 0x0284 }, /* Index: 0x5c, char: \x7c */
|
||||
{ 0x04, 0x028b }, /* Index: 0x5d, char: \x7d */
|
||||
{ 0x04, 0x0292 }, /* Index: 0x5e, char: \x7e */
|
||||
{ 0x04, 0x0299 }, /* Index: 0x5f, char: \x7f */
|
||||
};
|
||||
|
||||
const font_info_t _fonts_bitocra_4x7_ascii_info =
|
||||
{
|
||||
.height = 7, /* Character height */
|
||||
.c = 0, /* C */
|
||||
.char_start = 32, /* Start character */
|
||||
.char_end = 127, /* End character */
|
||||
.char_descriptors = _fonts_bitocra_4x7_ascii_descriptors, /* Character descriptor array */
|
||||
.bitmap = _fonts_bitocra_4x7_ascii_bitmaps, /* Character bitmap array */
|
||||
};
|
||||
|
||||
#endif /* _EXTRAS_FONTS_FONT_BITOCRA_4X7_ASCII_H_ */
|
||||
3169
extras/fonts/data/font_bitocra_6x11_iso8859_1.h
Normal file
3169
extras/fonts/data/font_bitocra_6x11_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
3617
extras/fonts/data/font_bitocra_7x13_iso8859_1.h
Normal file
3617
extras/fonts/data/font_bitocra_7x13_iso8859_1.h
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -8,6 +8,34 @@
|
|||
* Created on: 8 dec. 2016
|
||||
* Author: zaltora
|
||||
*/
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2012, Majenko Technologies
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those
|
||||
* of the authors and should not be interpreted as representing official policies,
|
||||
* either expressed or implied, of the FreeBSD Project.
|
||||
********************************************************************************/
|
||||
#ifndef _EXTRAS_FONTS_FONT_GLCD_5X7_H_
|
||||
#define _EXTRAS_FONTS_FONT_GLCD_5X7_H_
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
* Charset: koi8_r
|
||||
* 255 characters (1..255)
|
||||
*
|
||||
* Copyright (c) 2015 Dimitar Toshkov Zhekov
|
||||
* License: SIL Open Font License, Version 1.1. The license is included as OFL.TXT, and is
|
||||
* also available with a FAQ at http://scripts.sil.org/OFL
|
||||
*
|
||||
* Generated:
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_TERMINUS_14X28_KOI8_R_H_
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
* Charset: koi8_r
|
||||
* 255 characters (1..255)
|
||||
*
|
||||
* Copyright (c) 2015 Dimitar Toshkov Zhekov
|
||||
* License: SIL Open Font License, Version 1.1. The license is included as OFL.TXT, and is
|
||||
* also available with a FAQ at http://scripts.sil.org/OFL
|
||||
*
|
||||
* Generated:
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_TERMINUS_16X32_KOI8_R_H_
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
* Charset: koi8_r
|
||||
* 255 characters (1..255)
|
||||
*
|
||||
* Copyright (c) 2015 Dimitar Toshkov Zhekov
|
||||
* License: SIL Open Font License, Version 1.1. The license is included as OFL.txt, and is
|
||||
* also available with a FAQ at http://scripts.sil.org/OFL
|
||||
*
|
||||
* Generated:
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_TERMINUS_6X12_KOI8_R_H_
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
* Charset: koi8_r
|
||||
* 255 characters (1..255)
|
||||
*
|
||||
* Copyright (c) 2015 Dimitar Toshkov Zhekov
|
||||
* License: SIL Open Font License, Version 1.1. The license is included as OFL.TXT, and is
|
||||
* also available with a FAQ at http://scripts.sil.org/OFL
|
||||
*
|
||||
* Generated:
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_TERMINUS_8X14_KOI8_R_H_
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -6,6 +6,10 @@
|
|||
* Charset: koi8_r
|
||||
* 255 characters (1..255)
|
||||
*
|
||||
* Copyright (c) 2015 Dimitar Toshkov Zhekov
|
||||
* License: SIL Open Font License, Version 1.1. The license is included as OFL.TXT, and is
|
||||
* also available with a FAQ at http://scripts.sil.org/OFL
|
||||
*
|
||||
* Generated:
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_TERMINUS_BOLD_14X28_KOI8_R_H_
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
* Charset: koi8_r
|
||||
* 255 characters (1..255)
|
||||
*
|
||||
* Copyright (c) 2015 Dimitar Toshkov Zhekov
|
||||
* License: SIL Open Font License, Version 1.1. The license is included as OFL.TXT, and is
|
||||
* also available with a FAQ at http://scripts.sil.org/OFL
|
||||
*
|
||||
* Generated:
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_TERMINUS_BOLD_16X32_KOI8_R_H_
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@
|
|||
* Charset: koi8_r
|
||||
* 255 characters (1..255)
|
||||
*
|
||||
* Copyright (c) 2015 Dimitar Toshkov Zhekov
|
||||
* License: SIL Open Font License, Version 1.1. The license is included as OFL.TXT, and is
|
||||
* also available with a FAQ at http://scripts.sil.org/OFL
|
||||
*
|
||||
* Generated:
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_FONT_TERMINUS_BOLD_8X14_KOI8_R_H_
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2,6 +2,23 @@
|
|||
# Default built-in fonts
|
||||
#########################################
|
||||
|
||||
# FIXME
|
||||
|
||||
FONTS_GLCD_5X7 ?= 1
|
||||
|
||||
FONTS_ROBOTO_8PT ?= 0
|
||||
FONTS_ROBOTO_10PT ?= 0
|
||||
|
||||
# BitOCRA
|
||||
FONTS_BITOCRA_4X7 ?= 1
|
||||
FONTS_BITOCRA_6X11 ?= 1
|
||||
FONTS_BITOCRA_7X13 ?= 1
|
||||
|
||||
# Terminus, KOI8-R
|
||||
FONTS_TERMINUS_6X12_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_8X14_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_BOLD_8X14_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_14X28_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_BOLD_14X28_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_16X32_KOI8_R ?= 1
|
||||
FONTS_TERMINUS_BOLD_16X32_KOI8_R ?= 1
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,9 @@
|
|||
/*
|
||||
* fonts.c
|
||||
/**
|
||||
* LCD/OLED fonts library
|
||||
*
|
||||
* Created on: 8 dec. 2016
|
||||
* FIXME: License?
|
||||
*
|
||||
* @date: 8 dec. 2016
|
||||
* Author: zaltora
|
||||
*/
|
||||
#include "fonts.h"
|
||||
|
|
@ -17,24 +19,31 @@
|
|||
#include "data/font_roboto_10pt.h"
|
||||
#endif
|
||||
|
||||
#if FONTS_BITOCRA_4X7
|
||||
#include "data/font_bitocra_4x7_ascii.h"
|
||||
#endif
|
||||
#if FONTS_BITOCRA_6X11
|
||||
#include "data/font_bitocra_6x11_iso8859_1.h"
|
||||
#endif
|
||||
#if FONTS_BITOCRA_7X13
|
||||
#include "data/font_bitocra_7x13_iso8859_1.h"
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_6X12_KOI8_R
|
||||
#include "data/font_terminus_6x12_koi8_r.h"
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_8X14_KOI8_R
|
||||
#include "data/font_terminus_8x14_koi8_r.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_8X14_KOI8_R
|
||||
#include "data/font_terminus_bold_8x14_koi8_r.h"
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_14X28_KOI8_R
|
||||
#include "data/font_terminus_14x28_koi8_r.h"
|
||||
#endif
|
||||
#if FONTS_TERMINUS_BOLD_14X28_KOI8_R
|
||||
#include "data/font_terminus_bold_14x28_koi8_r.h"
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_16X32_KOI8_R
|
||||
#include "data/font_terminus_16x32_koi8_r.h"
|
||||
#endif
|
||||
|
|
@ -44,7 +53,9 @@
|
|||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
const font_info_t *fonts[] =
|
||||
// FIXME: this declaration is noisy
|
||||
|
||||
const font_info_t *font_builtin_fonts[] =
|
||||
{
|
||||
#if FONTS_GLCD_5X7
|
||||
[FONT_FACE_GLCD5x7] = &_fonts_glcd_5x7_info,
|
||||
|
|
@ -63,12 +74,27 @@ const font_info_t *fonts[] =
|
|||
[FONT_FACE_ROBOTO_10PT] = NULL,
|
||||
#endif
|
||||
|
||||
#if FONTS_BITOCRA_4X7
|
||||
[FONT_FACE_BITOCRA_4X7] = &_fonts_bitocra_4x7_ascii_info,
|
||||
#else
|
||||
[FONT_FACE_BITOCRA_4X7] = NULL,
|
||||
#endif
|
||||
#if FONTS_BITOCRA_6X11
|
||||
[FONT_FACE_BITOCRA_6X11] = &_fonts_bitocra_6x11_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_BITOCRA_6X11] = NULL,
|
||||
#endif
|
||||
#if FONTS_BITOCRA_7X13
|
||||
[FONT_FACE_BITOCRA_7X13] = &_fonts_bitocra_7x13_iso8859_1_info,
|
||||
#else
|
||||
[FONT_FACE_BITOCRA_7X13] = NULL,
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_6X12_KOI8_R
|
||||
[FONT_FACE_TERMINUS_6X12_KOI8_R] = &_fonts_terminus_6x12_koi8_r_info,
|
||||
#else
|
||||
[FONT_FACE_TERMINUS_6X12_KOI8_R] = NULL,
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_8X14_KOI8_R
|
||||
[FONT_FACE_TERMINUS_8X14_KOI8_R] = &_fonts_terminus_8x14_koi8_r_info,
|
||||
#else
|
||||
|
|
@ -79,7 +105,6 @@ const font_info_t *fonts[] =
|
|||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_8X14_KOI8_R] = NULL,
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_14X28_KOI8_R
|
||||
[FONT_FACE_TERMINUS_14X28_KOI8_R] = &_fonts_terminus_14x28_koi8_r_info,
|
||||
#else
|
||||
|
|
@ -90,7 +115,6 @@ const font_info_t *fonts[] =
|
|||
#else
|
||||
[FONT_FACE_TERMINUS_BOLD_14X28_KOI8_R] = NULL,
|
||||
#endif
|
||||
|
||||
#if FONTS_TERMINUS_16X32_KOI8_R
|
||||
[FONT_FACE_TERMINUS_16X32_KOI8_R] = &_fonts_terminus_16x32_koi8_r_info,
|
||||
#else
|
||||
|
|
@ -103,4 +127,23 @@ const font_info_t *fonts[] =
|
|||
#endif
|
||||
};
|
||||
|
||||
const size_t fonts_count = (sizeof(fonts) / sizeof(font_info_t *));
|
||||
const size_t font_builtin_fonts_count = (sizeof(font_builtin_fonts) / sizeof(font_info_t *));
|
||||
|
||||
/////////////////////////////////////////////
|
||||
|
||||
uint16_t font_measure_string(const font_info_t *fnt, const char *s)
|
||||
{
|
||||
if (!s || !fnt) return 0;
|
||||
|
||||
uint16_t res = 0;
|
||||
while (s)
|
||||
{
|
||||
const font_char_desc_t *d = font_get_char_desc(fnt, *s);
|
||||
if (d)
|
||||
res += d->width + fnt->c;
|
||||
s++;
|
||||
}
|
||||
|
||||
return res > 0 ? res - fnt->c : 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
/*
|
||||
* fonts.h
|
||||
/**
|
||||
* LCD/OLED fonts library
|
||||
*
|
||||
* Created on: 8 dec. 2016
|
||||
* FIXME: License?
|
||||
*
|
||||
* @date 8 dec. 2016
|
||||
* Author: zaltora
|
||||
*/
|
||||
#ifndef _EXTRAS_FONTS_H_
|
||||
|
|
@ -20,19 +22,18 @@ typedef enum
|
|||
FONT_FACE_GLCD5x7 = 0,
|
||||
FONT_FACE_ROBOTO_8PT,
|
||||
FONT_FACE_ROBOTO_10PT,
|
||||
FONT_FACE_BITOCRA_4X7,
|
||||
FONT_FACE_BITOCRA_6X11,
|
||||
FONT_FACE_BITOCRA_7X13,
|
||||
FONT_FACE_TERMINUS_6X12_KOI8_R,
|
||||
FONT_FACE_TERMINUS_8X14_KOI8_R,
|
||||
FONT_FACE_TERMINUS_BOLD_8X14_KOI8_R,
|
||||
FONT_FACE_TERMINUS_8X16_KOI8_R,
|
||||
FONT_FACE_TERMINUS_BOLD_8X16_KOI8_R,
|
||||
FONT_FACE_TERMINUS_14X28_KOI8_R,
|
||||
FONT_FACE_TERMINUS_BOLD_14X28_KOI8_R,
|
||||
FONT_FACE_TERMINUS_16X32_KOI8_R,
|
||||
FONT_FACE_TERMINUS_BOLD_16X32_KOI8_R,
|
||||
} font_face_t;
|
||||
|
||||
#define FONT_FACE_MAX FONT_FACE_TERMINUS_BOLD_16X32_KOI8_R
|
||||
|
||||
/**
|
||||
* Character descriptor
|
||||
*/
|
||||
|
|
@ -58,8 +59,29 @@ typedef struct _font_info
|
|||
/**
|
||||
* Built-in fonts
|
||||
*/
|
||||
extern const font_info_t *fonts[];
|
||||
extern const size_t fonts_count;
|
||||
extern const font_info_t *font_builtin_fonts[];
|
||||
extern const size_t font_builtin_fonts_count;
|
||||
|
||||
/**
|
||||
* Find character decriptor in font
|
||||
* @param fnt Poniter to font information struct
|
||||
* @param c Character
|
||||
* @return Character descriptor or NULL if no character found
|
||||
*/
|
||||
inline const font_char_desc_t *font_get_char_desc(const font_info_t *fnt, char c)
|
||||
{
|
||||
return c < fnt->char_start || c > fnt->char_end
|
||||
? NULL
|
||||
: fnt->char_descriptors + c - fnt->char_start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate width of string in pixels
|
||||
* @param fnt Poniter to font information struct
|
||||
* @param s String
|
||||
* @return String width
|
||||
*/
|
||||
uint16_t font_measure_string(const font_info_t *fnt, const char *s);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
#!/usr/bin/env python3
|
||||
# encoding: utf-8
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys, os
|
||||
from PIL import Image, ImageFont, ImageDraw
|
||||
import argparse
|
||||
import jinja2
|
||||
import re
|
||||
import time
|
||||
|
||||
def gen_char(index, c, im):
|
||||
bw = (im.size[0] + 7) // 8
|
||||
|
|
@ -59,7 +60,7 @@ def main(args):
|
|||
chars.append(gen_char(idx, idx + args.first, im.convert('1')))
|
||||
|
||||
env = jinja2.Environment(loader=jinja2.FileSystemLoader(os.path.dirname(os.path.abspath(__file__))), finalize=lambda x: '' if x is None else x)
|
||||
print(env.get_template('template.c').render({
|
||||
print(env.get_template(args.template).render({
|
||||
'font': {
|
||||
'name': args.name,
|
||||
'size': size,
|
||||
|
|
@ -67,7 +68,8 @@ def main(args):
|
|||
'first': args.first,
|
||||
'last': args.last,
|
||||
},
|
||||
'chars': chars
|
||||
'chars': chars,
|
||||
'created': time.ctime()
|
||||
}))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ _fonts_{{ font.name|lower }}_{{ font_size }}_{{ font.charset|lower }}
|
|||
* Charset: {{ font.charset }}
|
||||
* {{ chars|length }} characters ({{ font.first }}..{{ font.last }})
|
||||
*
|
||||
* License: FIXME
|
||||
*
|
||||
* Generated: {{ created }}
|
||||
*/
|
||||
#ifndef {{ header_id }}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,11 @@
|
|||
*
|
||||
* Copyright (c) 2016 urx (https://github.com/urx),
|
||||
* Ruslan V. Uss (https://github.com/UncleRus)
|
||||
* Zaltora (https://github.com/Zaltora)
|
||||
*
|
||||
* MIT Licensed as described in the file LICENSE
|
||||
*
|
||||
* @todo Scrolling, fonts
|
||||
* @todo HW scrolling, sprites
|
||||
*/
|
||||
#include "ssd1306.h"
|
||||
#include <stdio.h>
|
||||
|
|
@ -71,8 +72,6 @@
|
|||
#define abs(x) ((x)<0 ? -(x) : (x))
|
||||
#define swap(x, y) do { typeof(x) temp##x##y = x; x = y; y = temp##x##y; } while (0)
|
||||
|
||||
static const font_info_t *font; // save font selection
|
||||
|
||||
/* Issue a command to SSD1306 device
|
||||
* I2C proto format:
|
||||
* |S|Slave Address|W|ACK|0x00|Command|Ack|P|
|
||||
|
|
@ -430,7 +429,7 @@ int ssd1306_draw_pixel(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ss
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return 0 ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ssd1306_draw_hline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t w, ssd1306_color_t color)
|
||||
|
|
@ -476,7 +475,7 @@ int ssd1306_draw_hline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ui
|
|||
default:
|
||||
break;
|
||||
}
|
||||
return 0 ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ssd1306_draw_vline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, uint8_t h, ssd1306_color_t color)
|
||||
|
|
@ -529,11 +528,11 @@ int ssd1306_draw_vline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ui
|
|||
{
|
||||
case OLED_COLOR_WHITE:
|
||||
do
|
||||
{
|
||||
{
|
||||
fb[index] = 0xff;
|
||||
index += dev->width;
|
||||
t -= 8;
|
||||
} while (t >= 8);
|
||||
} while (t >= 8);
|
||||
break;
|
||||
case OLED_COLOR_BLACK:
|
||||
do
|
||||
|
|
@ -555,10 +554,10 @@ int ssd1306_draw_vline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ui
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (t) // // partial line at bottom
|
||||
if (t) // partial line at bottom
|
||||
{
|
||||
mod = t & 7;
|
||||
static const uint8_t postmask[8] = {0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F };
|
||||
static const uint8_t postmask[8] = { 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F };
|
||||
mask = postmask[mod];
|
||||
switch (color)
|
||||
{
|
||||
|
|
@ -574,8 +573,6 @@ int ssd1306_draw_vline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ui
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -590,7 +587,6 @@ int ssd1306_draw_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y
|
|||
if ((err = ssd1306_draw_vline(dev, fb, x, y, h, color)))
|
||||
return err;
|
||||
return ssd1306_draw_vline(dev, fb, x + w - 1, y, h, color);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -602,13 +598,12 @@ int ssd1306_fill_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y
|
|||
for (i = x; i < x + w; ++i)
|
||||
if ((err = ssd1306_draw_vline(dev, fb, i, y, h, color)))
|
||||
return err;
|
||||
return 0 ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ssd1306_draw_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0, uint8_t r, ssd1306_color_t color)
|
||||
{
|
||||
// Refer to http://en.wikipedia.org/wiki/Midpoint_circle_algorithm for the algorithm
|
||||
|
||||
int8_t x = r;
|
||||
int8_t y = 1;
|
||||
int16_t radius_err = 1 - x;
|
||||
|
|
@ -651,18 +646,16 @@ int ssd1306_draw_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0,
|
|||
return err;
|
||||
}
|
||||
++y;
|
||||
if (radius_err < 0)
|
||||
{
|
||||
if (radius_err < 0) {
|
||||
radius_err += 2 * y + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
--x;
|
||||
radius_err += 2 * (y - x + 1);
|
||||
}
|
||||
|
||||
}
|
||||
return 0 ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ssd1306_fill_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0, uint8_t r, ssd1306_color_t color)
|
||||
|
|
@ -692,12 +685,10 @@ int ssd1306_fill_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0,
|
|||
return err;
|
||||
}
|
||||
++x;
|
||||
if (radius_err < 0)
|
||||
{
|
||||
if (radius_err < 0) {
|
||||
radius_err += 2 * x + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
--y;
|
||||
radius_err += 2 * (x - y + 1);
|
||||
}
|
||||
|
|
@ -725,29 +716,28 @@ int ssd1306_fill_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0,
|
|||
if ((err = ssd1306_draw_hline(dev, fb, x0 - x, y0 + y, x - x1 + 1, color)))
|
||||
return err;
|
||||
++y;
|
||||
if (radius_err < 0)
|
||||
{
|
||||
if (radius_err < 0) {
|
||||
radius_err += 2 * y + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
--x;
|
||||
radius_err += 2 * (y - x + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0 ;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ssd1306_draw_line(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, ssd1306_color_t color) {
|
||||
|
||||
int ssd1306_draw_line(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0,
|
||||
int16_t x1, int16_t y1, ssd1306_color_t color)
|
||||
{
|
||||
if ((x0 >= dev->width) || (x0 < 0) || (y0 >= dev->height) || (y0 < 0))
|
||||
return -EINVAL;
|
||||
if ((x1 >= dev->width) || (x1 < 0) || (y1 >= dev->height) || (y1 < 0))
|
||||
return -EINVAL;
|
||||
|
||||
int err ;
|
||||
int16_t steep = abs(y1 - y0) > abs(x1 - x0);
|
||||
int err;
|
||||
bool steep = abs(y1 - y0) > abs(x1 - x0);
|
||||
if (steep) {
|
||||
swap(x0, y0);
|
||||
swap(x1, y1);
|
||||
|
|
@ -788,8 +778,11 @@ int ssd1306_draw_line(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0,
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ssd1306_draw_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, ssd1306_color_t color) {
|
||||
int err ;
|
||||
int ssd1306_draw_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0,
|
||||
int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2,
|
||||
ssd1306_color_t color)
|
||||
{
|
||||
int err;
|
||||
if ((err = ssd1306_draw_line(dev, fb, x0, y0, x1, y1, color)))
|
||||
return err;
|
||||
if ((err = ssd1306_draw_line(dev, fb, x1, y1, x2, y2, color)))
|
||||
|
|
@ -797,125 +790,113 @@ int ssd1306_draw_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t
|
|||
return ssd1306_draw_line(dev, fb, x2, y2, x0, y0, color);
|
||||
}
|
||||
|
||||
int ssd1306_fill_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0,int16_t x1, int16_t y1, int16_t x2, int16_t y2, ssd1306_color_t color) {
|
||||
int ssd1306_fill_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0,
|
||||
int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2,
|
||||
ssd1306_color_t color)
|
||||
{
|
||||
int16_t a, b, y, last;
|
||||
int err;
|
||||
|
||||
int16_t a, b, y, last;
|
||||
int err ;
|
||||
// Sort coordinates by Y order (y2 >= y1 >= y0)
|
||||
if (y0 > y1) {
|
||||
swap(y0, y1); swap(x0, x1);
|
||||
}
|
||||
if (y1 > y2) {
|
||||
swap(y2, y1); swap(x2, x1);
|
||||
}
|
||||
if (y0 > y1) {
|
||||
swap(y0, y1); swap(x0, x1);
|
||||
}
|
||||
|
||||
// Sort coordinates by Y order (y2 >= y1 >= y0)
|
||||
if (y0 > y1) {
|
||||
swap(y0, y1); swap(x0, x1);
|
||||
}
|
||||
if (y1 > y2) {
|
||||
swap(y2, y1); swap(x2, x1);
|
||||
}
|
||||
if (y0 > y1) {
|
||||
swap(y0, y1); swap(x0, x1);
|
||||
}
|
||||
if(y0 == y2) { // Handle awkward all-on-same-line case as its own thing
|
||||
a = b = x0;
|
||||
if (x1 < a) a = x1;
|
||||
else if (x1 > b) b = x1;
|
||||
if (x2 < a) a = x2;
|
||||
else if (x2 > b) b = x2;
|
||||
if ((err = ssd1306_draw_hline(dev, fb, a, y0, b - a + 1, color)))
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(y0 == y2) { // Handle awkward all-on-same-line case as its own thing
|
||||
a = b = x0;
|
||||
if(x1 < a) a = x1;
|
||||
else if(x1 > b) b = x1;
|
||||
if(x2 < a) a = x2;
|
||||
else if(x2 > b) b = x2;
|
||||
if ((err = ssd1306_draw_hline(dev, fb, a, y0, b-a+1, color)))
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
int16_t
|
||||
dx01 = x1 - x0,
|
||||
dy01 = y1 - y0,
|
||||
dx02 = x2 - x0,
|
||||
dy02 = y2 - y0,
|
||||
dx12 = x2 - x1,
|
||||
dy12 = y2 - y1,
|
||||
sa = 0,
|
||||
sb = 0;
|
||||
|
||||
int16_t
|
||||
dx01 = x1 - x0,
|
||||
dy01 = y1 - y0,
|
||||
dx02 = x2 - x0,
|
||||
dy02 = y2 - y0,
|
||||
dx12 = x2 - x1,
|
||||
dy12 = y2 - y1,
|
||||
sa = 0,
|
||||
sb = 0;
|
||||
|
||||
// For upper part of triangle, find scanline crossings for segments
|
||||
// 0-1 and 0-2. If y1=y2 (flat-bottomed triangle), the scanline y1
|
||||
// is included here (and second loop will be skipped, avoiding a /0
|
||||
// error there), otherwise scanline y1 is skipped here and handled
|
||||
// in the second loop...which also avoids a /0 error here if y0=y1
|
||||
// (flat-topped triangle).
|
||||
if(y1 == y2) last = y1; // Include y1 scanline
|
||||
else last = y1-1; // Skip it
|
||||
// For upper part of triangle, find scanline crossings for segments
|
||||
// 0-1 and 0-2. If y1=y2 (flat-bottomed triangle), the scanline y1
|
||||
// is included here (and second loop will be skipped, avoiding a /0
|
||||
// error there), otherwise scanline y1 is skipped here and handled
|
||||
// in the second loop...which also avoids a /0 error here if y0=y1
|
||||
// (flat-topped triangle).
|
||||
if (y1 == y2) last = y1; // Include y1 scanline
|
||||
else last = y1 - 1; // Skip it
|
||||
|
||||
for (y = y0; y <= last; y++) {
|
||||
a = x0 + sa / dy01;
|
||||
b = x0 + sb / dy02;
|
||||
sa += dx01;
|
||||
sb += dx02;
|
||||
/* longhand:
|
||||
a = x0 + (x1 - x0) * (y - y0) / (y1 - y0);
|
||||
b = x0 + (x2 - x0) * (y - y0) / (y2 - y0);
|
||||
a = x0 + sa / dy01;
|
||||
b = x0 + sb / dy02;
|
||||
sa += dx01;
|
||||
sb += dx02;
|
||||
/* longhand:
|
||||
a = x0 + (x1 - x0) * (y - y0) / (y1 - y0);
|
||||
b = x0 + (x2 - x0) * (y - y0) / (y2 - y0);
|
||||
*/
|
||||
if(a > b) swap(a,b);
|
||||
if ((err = ssd1306_draw_hline(dev, fb, a, y, b-a+1, color)))
|
||||
return err;
|
||||
}
|
||||
if (a > b) swap(a, b);
|
||||
if ((err = ssd1306_draw_hline(dev, fb, a, y, b - a + 1, color)))
|
||||
return err;
|
||||
}
|
||||
|
||||
// For lower part of triangle, find scanline crossings for segments
|
||||
// 0-2 and 1-2. This loop is skipped if y1=y2.
|
||||
sa = dx12 * (y - y1);
|
||||
sb = dx02 * (y - y0);
|
||||
// For lower part of triangle, find scanline crossings for segments
|
||||
// 0-2 and 1-2. This loop is skipped if y1=y2.
|
||||
sa = dx12 * (y - y1);
|
||||
sb = dx02 * (y - y0);
|
||||
for (; y <= y2; y++) {
|
||||
a = x1 + sa / dy12;
|
||||
b = x0 + sb / dy02;
|
||||
sa += dx12;
|
||||
sb += dx02;
|
||||
/* longhand:
|
||||
a = x1 + (x2 - x1) * (y - y1) / (y2 - y1);
|
||||
b = x0 + (x2 - x0) * (y - y0) / (y2 - y0);
|
||||
a = x1 + sa / dy12;
|
||||
b = x0 + sb / dy02;
|
||||
sa += dx12;
|
||||
sb += dx02;
|
||||
/* longhand:
|
||||
a = x1 + (x2 - x1) * (y - y1) / (y2 - y1);
|
||||
b = x0 + (x2 - x0) * (y - y0) / (y2 - y0);
|
||||
*/
|
||||
if(a > b) swap(a,b);
|
||||
if ((err = ssd1306_draw_hline(dev, fb, a, y, b-a+1, color)))
|
||||
if (a > b) swap(a, b);
|
||||
if ((err = ssd1306_draw_hline(dev, fb, a, y, b - a + 1, color)))
|
||||
return err;
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
int ssd1306_select_font(font_face_t font_face)
|
||||
{
|
||||
if (font_face < fonts_count)
|
||||
font = fonts[font_face];
|
||||
else
|
||||
return -EINVAL;
|
||||
if (!font)
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char c, ssd1306_color_t foreground, ssd1306_color_t background)
|
||||
uint8_t ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb,
|
||||
const font_info_t *font, uint8_t x, uint8_t y, char c,
|
||||
ssd1306_color_t foreground, ssd1306_color_t background)
|
||||
{
|
||||
uint8_t i, j;
|
||||
const uint8_t *bitmap;
|
||||
uint8_t line = 0 ;
|
||||
uint8_t line = 0;
|
||||
|
||||
if (font == NULL)
|
||||
return 0;
|
||||
|
||||
// we always have space in the font set
|
||||
if ((c < font->char_start) || (c > font->char_end))
|
||||
c = ' ';
|
||||
c = c - font->char_start; // c now become index to tables
|
||||
bitmap = font->bitmap + font->char_descriptors[(unsigned char)c].offset;
|
||||
for (j = 0; j < font->height; ++j)
|
||||
{
|
||||
for (i = 0; i < font->char_descriptors[(unsigned char)c].width; ++i)
|
||||
{
|
||||
if (i % 8 == 0)
|
||||
{
|
||||
line = bitmap[(font->char_descriptors[(unsigned char)c].width + 7) / 8 * j + i / 8]; // line data
|
||||
const font_char_desc_t *d = font_get_char_desc(font, c);
|
||||
if (d == NULL)
|
||||
return 0;
|
||||
|
||||
bitmap = font->bitmap + d->offset;
|
||||
for (j = 0; j < font->height; ++j) {
|
||||
for (i = 0; i < d->width; ++i) {
|
||||
if (i % 8 == 0) {
|
||||
line = bitmap[(d->width + 7) / 8 * j + i / 8]; // line data
|
||||
}
|
||||
if (line & 0x80)
|
||||
{
|
||||
if (line & 0x80) {
|
||||
ssd1306_draw_pixel(dev, fb, x + i, y + j, foreground);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
switch (background)
|
||||
{
|
||||
case OLED_COLOR_TRANSPARENT:
|
||||
|
|
@ -933,63 +914,24 @@ uint8_t ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t
|
|||
line = line << 1;
|
||||
}
|
||||
}
|
||||
return (font->char_descriptors[(unsigned char)c].width);
|
||||
return d->width;
|
||||
}
|
||||
|
||||
uint8_t ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char *str, ssd1306_color_t foreground, ssd1306_color_t background)
|
||||
uint8_t ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb,
|
||||
const font_info_t *font, uint8_t x, uint8_t y, char *str,
|
||||
ssd1306_color_t foreground, ssd1306_color_t background)
|
||||
{
|
||||
uint8_t t = x;
|
||||
|
||||
if (font == NULL)
|
||||
return 0;
|
||||
if (str == NULL)
|
||||
if (font == NULL || str == NULL)
|
||||
return 0;
|
||||
|
||||
while (*str)
|
||||
{
|
||||
x += ssd1306_draw_char(dev, fb, x, y, *str, foreground, background);
|
||||
x += ssd1306_draw_char(dev, fb, font, x, y, *str, foreground, background);
|
||||
++str;
|
||||
if (*str)
|
||||
x += font->c;
|
||||
|
||||
}
|
||||
return (x - t);
|
||||
}
|
||||
|
||||
uint8_t ssd1306_get_font_height()
|
||||
{
|
||||
if (font == NULL)
|
||||
return 0;
|
||||
return (font->height);
|
||||
}
|
||||
|
||||
|
||||
uint8_t ssd1306_get_font_c()
|
||||
{
|
||||
if (font == NULL)
|
||||
return 0;
|
||||
return (font->c);
|
||||
}
|
||||
|
||||
uint8_t ssd1306_measure_string(char *str)
|
||||
{
|
||||
uint8_t w = 0;
|
||||
char c;
|
||||
|
||||
if (font == NULL)
|
||||
return 0;
|
||||
|
||||
while (*str)
|
||||
{
|
||||
c = *str;
|
||||
// we always have space in the font set
|
||||
if ((c < font->char_start) || (c > font->char_end))
|
||||
c = ' ';
|
||||
c = c - font->char_start; // c now become index to tables
|
||||
w += font->char_descriptors[(unsigned char)c].width;
|
||||
++str;
|
||||
if (*str)
|
||||
w += font->c;
|
||||
}
|
||||
return w;
|
||||
return x - t;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
*
|
||||
* Copyright (c) 2016 urx (https://github.com/urx),
|
||||
* Ruslan V. Uss (https://github.com/UncleRus)
|
||||
* Zaltora (https://github.com/Zaltora)
|
||||
*
|
||||
* MIT Licensed as described in the file LICENSE
|
||||
*/
|
||||
|
|
@ -289,7 +290,7 @@ int ssd1306_set_whole_display_lighting(const ssd1306_t *dev, bool light);
|
|||
/**
|
||||
* Draw one pixel
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x X coordinate
|
||||
* @param y Y coordinate
|
||||
* @param color Color of the pixel
|
||||
|
|
@ -300,7 +301,7 @@ int ssd1306_draw_pixel(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ss
|
|||
/**
|
||||
* Draw a horizontal line
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x X coordinate or starting (left) point
|
||||
* @param y Y coordinate or starting (left) point
|
||||
* @param w Line width
|
||||
|
|
@ -312,7 +313,7 @@ int ssd1306_draw_hline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ui
|
|||
/**
|
||||
* Draw a vertical line
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x X coordinate or starting (top) point
|
||||
* @param y Y coordinate or starting (top) point
|
||||
* @param h Line height
|
||||
|
|
@ -324,7 +325,7 @@ int ssd1306_draw_vline(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y, ui
|
|||
/**
|
||||
* Draw a line
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x0 First x point coordinate
|
||||
* @param y0 First y point coordinate
|
||||
* @param x1 Second x point coordinate
|
||||
|
|
@ -337,7 +338,7 @@ int ssd1306_draw_line(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0,
|
|||
/**
|
||||
* Draw a rectangle
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x X coordinate or starting (top left) point
|
||||
* @param y Y coordinate or starting (top left) point
|
||||
* @param w Rectangle width
|
||||
|
|
@ -350,7 +351,7 @@ int ssd1306_draw_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y
|
|||
/**
|
||||
* Draw a filled rectangle
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x X coordinate or starting (top left) point
|
||||
* @param y Y coordinate or starting (top left) point
|
||||
* @param w Rectangle width
|
||||
|
|
@ -363,7 +364,7 @@ int ssd1306_fill_rectangle(const ssd1306_t *dev, uint8_t *fb, int8_t x, int8_t y
|
|||
/**
|
||||
* Draw a circle
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x0 X coordinate or center
|
||||
* @param y0 Y coordinate or center
|
||||
* @param r Radius
|
||||
|
|
@ -375,7 +376,7 @@ int ssd1306_draw_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0,
|
|||
/**
|
||||
* Draw a filled circle
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x0 X coordinate or center
|
||||
* @param y0 Y coordinate or center
|
||||
* @param r Radius
|
||||
|
|
@ -387,7 +388,7 @@ int ssd1306_fill_circle(const ssd1306_t *dev, uint8_t *fb, int8_t x0, int8_t y0,
|
|||
/**
|
||||
* Draw a triangle
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x0 First x point coordinate
|
||||
* @param y0 First y point coordinate
|
||||
* @param x1 Second x point coordinate
|
||||
|
|
@ -402,7 +403,7 @@ int ssd1306_draw_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t
|
|||
/**
|
||||
* Draw a filled triangle
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param x0 First x point coordinate
|
||||
* @param y0 First y point coordinate
|
||||
* @param x1 Second x point coordinate
|
||||
|
|
@ -414,29 +415,11 @@ int ssd1306_draw_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t
|
|||
*/
|
||||
int ssd1306_fill_triangle(const ssd1306_t *dev, uint8_t *fb, int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, ssd1306_color_t color);
|
||||
|
||||
/**
|
||||
* Select the font
|
||||
* @param idx id value of the font
|
||||
* @return Non-zero if error occured
|
||||
*/
|
||||
int ssd1306_select_font(font_face_t font_face);
|
||||
|
||||
/**
|
||||
* Get the height of current selected font
|
||||
* @return Height of the font (in pixels) or 0 if none font selected
|
||||
*/
|
||||
uint8_t ssd1306_get_font_height();
|
||||
|
||||
/**
|
||||
* Get the "C" value (space between adjacent characters) of current selected font
|
||||
* @return "C" value
|
||||
*/
|
||||
uint8_t ssd1306_get_font_c();
|
||||
|
||||
/**
|
||||
* Draw one character using currently selected font
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param font Pointer to font info structure
|
||||
* @param x X position of character (top-left corner)
|
||||
* @param y Y position of character (top-left corner)
|
||||
* @param c The character to draw
|
||||
|
|
@ -444,27 +427,21 @@ uint8_t ssd1306_get_font_c();
|
|||
* @param background Background color
|
||||
* @return Width of the character
|
||||
*/
|
||||
uint8_t ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char c, ssd1306_color_t foreground, ssd1306_color_t background);
|
||||
uint8_t ssd1306_draw_char(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font, uint8_t x, uint8_t y, char c, ssd1306_color_t foreground, ssd1306_color_t background);
|
||||
|
||||
/**
|
||||
* Draw one character using currently selected font
|
||||
* @param dev Pointer to device descriptor
|
||||
* @param buf Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param fb Pointer to framebuffer. Framebuffer size = width * height / 8
|
||||
* @param font Pointer to font info structure
|
||||
* @param x X position of character (top-left corner)
|
||||
* @param y Y position of character (top-left corner)
|
||||
* @param str The string to draw
|
||||
* @param str The string to draw
|
||||
* @param foreground Character color
|
||||
* @param background Background color
|
||||
* @return Width of the string (out-of-display pixels also included)
|
||||
*/
|
||||
uint8_t ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, uint8_t x, uint8_t y, char *str, ssd1306_color_t foreground, ssd1306_color_t background);
|
||||
|
||||
/**
|
||||
* Measure width of string with current selected font
|
||||
* @param str String to measure
|
||||
* @return Width of the string
|
||||
*/
|
||||
uint8_t ssd1306_measure_string(char *str);
|
||||
uint8_t ssd1306_draw_string(const ssd1306_t *dev, uint8_t *fb, const font_info_t *font, uint8_t x, uint8_t y, char *str, ssd1306_color_t foreground, ssd1306_color_t background);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue