mirror of
https://github.com/stasenso/rp_pico_display_engine.git
synced 2026-06-26 21:32:41 +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" # Путь к шрифту
|
||||
|
||||
|
||||
Reference in New Issue
Block a user