mirror of
https://github.com/stasenso/rp_pico_test.git
synced 2026-06-26 21:42:44 +03:00
The garbled text appeared
This commit is contained in:
+3
-3
@@ -2,7 +2,7 @@ from PIL import Image
|
||||
|
||||
def convert_bmp_to_linear_image(bmp_path, img_width, img_height, char_width, char_height, output_c_path, header_path):
|
||||
# Открываем BMP файл и конвертируем его в монохромное изображение
|
||||
image = Image.open(bmp_path).convert("1")
|
||||
image = Image.open(bmp_path)
|
||||
width, height = image.size
|
||||
|
||||
if width != img_width or height != img_height:
|
||||
@@ -57,8 +57,8 @@ def convert_bmp_to_linear_image(bmp_path, img_width, img_height, char_width, cha
|
||||
|
||||
# Пример вызова функции
|
||||
bmp_path = "Font/font_grid_with_cyrillic.bmp" # Замените на ваш путь
|
||||
img_width = 704 # Укажите ширину изображения
|
||||
img_height = 242 # Укажите высоту изображения
|
||||
img_width = 7744 # Укажите ширину изображения
|
||||
img_height = 22 # Укажите высоту изображения
|
||||
char_width = 22 # Укажите ширину символа
|
||||
char_height = 22 # Укажите высоту символа
|
||||
output_c_path = "font_data_dirt.c"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
+1
-1
@@ -2,7 +2,7 @@ from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
# Настройки
|
||||
font_size = 20 # Размер шрифта
|
||||
chars_per_row = 32 # Количество символов в строке
|
||||
chars_per_row = 352 # Количество символов в строке
|
||||
grid_size = font_size + 2 # Размер ячейки (с отступами)
|
||||
font_path = "/usr/share/fonts/truetype/dejavu/DejaVuSerifCondensed.ttf" # Путь к шрифту
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void st7789_init() {
|
||||
sleep_ms(150);
|
||||
|
||||
st7789_send_command(0x36); // Memory data access control 215
|
||||
st7789_send_data(0b00110000); // RGB
|
||||
st7789_send_data(0b10100000); // RGB
|
||||
//st7789_send_data(0b00101000); // BGR
|
||||
|
||||
st7789_send_command(0x3A); // Interface pixel format
|
||||
|
||||
+47
-260
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
||||
// Изображение, сгенерированное из Font/font_grid_with_cyrillic.bmp
|
||||
#include <stdint.h>
|
||||
|
||||
const uint16_t image_linear_width = 7744;
|
||||
const uint8_t char_width = 22;
|
||||
const uint8_t char_height = 22;
|
||||
const uint16_t total_chars = 352;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#ifndef IMAGE_DATA_H
|
||||
#define IMAGE_DATA_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern const uint16_t image_linear_width;
|
||||
extern const uint8_t char_width;
|
||||
extern const uint8_t char_height;
|
||||
extern const uint16_t total_chars;
|
||||
extern const uint8_t image_data[];
|
||||
|
||||
#endif // IMAGE_DATA_H
|
||||
Reference in New Issue
Block a user