Вставь текст рыбу (Lorem ipsum) #include <android/native_activity.h>
#include <android/log.h>
#include <android_native_app_glue.h>
#include <cstring>

// Макрос для логирования
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "native-activity", __VA_ARGS__))

// Простой 8x8 растровый шрифт для печатных символов ASCII (32-126)
const uint8_t font8x8_basic[95][8] = {
        // Пробел (32)
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
        // ! (33)
        {0x18,0x3C,0x3C,0x18,0x18,0x00,0x18,0x00},
        // " (34)
        {0x6C,0x6C,0x48,0x00,0x00,0x00,0x00,0x00},
        // # (35)
        {0x6C,0x6C,0xFE,0x6C,0xFE,0x6C,0x6C,0x00},
        // $ (36)
        {0x18,0x3E,0x60,0x3C,0x06,0x7C,0x18,0x00},
        // % (37)
        {0x00,0xC6,0xCC,0x18,0x30,0x66,0xC6,0x00},
        // & (38)
        {0x38,0x6C,0x38,0x76,0xDC,0xCC,0x76,0x00},
        // ' (39)
        {0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00},
        // ( (40)
        {0x0C,0x18,0x30,0x30,0x30,0x18,0x0C,0x00},
        // ) (41)
        {0x30,0x18,0x0C,0x0C,0x0C,0x18,0x30,0x00},
        // * (42)
        {0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00},
        // + (43)
        {0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00},
        // , (44)
        {0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00},
        // - (45)
        {0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00},
        // . (46)
        {0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00},
        // / (47)
        {0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00},
        // 0 (48)
        {0x7C,0xC6,0xCE,0xD6,0xE6,0xC6,0x7C,0x00},
        // 1 (49)
        {0x18,0x38,0x18,0x18,0x18,0x18,0x7E,0x00},
        // 2 (50)
        {0x7C,0xC6,0x0E,0x1C,0x70,0xC0,0xFE,0x00},
        // 3 (51)
        {0x7C,0xC6,0x06,0x3C,0x06,0xC6,0x7C,0x00},
        // 4 (52)
        {0x1C,0x3C,0x6C,0xCC,0xFE,0x0C,0x1E,0x00},
        // 5 (53)
        {0xFE,0xC0,0xFC,0x06,0x06,0xC6,0x7C,0x00},
        // 6 (54)
        {0x38,0x60,0xC0,0xFC,0xC6,0xC6,0x7C,0x00},
        // 7 (55)
        {0xFE,0xC6,0x0C,0x18,0x30,0x30,0x30,0x00},
        // 8 (56)
        {0x7C,0xC6,0xC6,0x7C,0xC6,0xC6,0x7C,0x00},
        // 9 (57)
        {0x7C,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00},
        // : (58)
        {0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x00},
        // ; (59)
        {0x00,0x30,0x30,0x00,0x00,0x30,0x30,0x60},
        // < (60)
        {0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00},
        // = (61)
        {0x00,0x00,0x7E,0x00,0x7E,0x00,0x00,0x00},
        // > (62)
        {0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00},
        // ? (63)
        {0x7C,0xC6,0x0E,0x1C,0x18,0x00,0x18,0x00},
        // @ (64)
        {0x7C,0xC6,0xDE,0xDE,0xDE,0xC0,0x7C,0x00},
        // A (65)
        {0x38,0x6C,0xC6,0xC6,0xFE,0xC6,0xC6,0x00},
        // B (66)
        {0xFC,0x66,0x66,0x7C,0x66,0x66,0xFC,0x00},
        // C (67)
        {0x3C,0x66,0xC0,0xC0,0xC0,0x66,0x3C,0x00},
        // D (68)
        {0xF8,0x6C,0x66,0x66,0x66,0x6C,0xF8,0x00},
        // E (69)
        {0xFE,0x62,0x68,0x78,0x68,0x62,0xFE,0x00},
        // F (70)
        {0xFE,0x62,0x68,0x78,0x68,0x60,0xF0,0x00},
        // G (71)
        {0x3C,0x66,0xC0,0xC0,0xCE,0x66,0x3E,0x00},
        // H (72)
        {0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0x00},
        // I (73)
        {0x3C,0x18,0x18,0x18,0x18,0x18,0x3C,0x00},
        // J (74)
        {0x1E,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00},
        // K (75)
        {0xE6,0x66,0x6C,0x78,0x6C,0x66,0xE6,0x00},
        // L (76)
        {0xF0,0x60,0x60,0x60,0x62,0x66,0xFE,0x00},
        // M (77)
        {0xC6,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0x00},
        // N (78)
        {0xC6,0xE6,0xF6,0xDE,0xCE,0xC6,0xC6,0x00},
        // O (79)
        {0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00},
        // P (80)
        {0xFC,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00},
        // Q (81)
        {0x7C,0xC6,0xC6,0xC6,0xDA,0xCC,0x76,0x00},
        // R (82)
        {0xFC,0x66,0x66,0x7C,0x6C,0x66,0xE6,0x00},
        // S (83)
        {0x7C,0xC6,0x60,0x38,0x0C,0xC6,0x7C,0x00},
        // T (84)
        {0x7E,0x7E,0x5A,0x18,0x18,0x18,0x3C,0x00},
        // U (85)
        {0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00},
        // V (86)
        {0xC6,0xC6,0xC6,0x6C,0x6C,0x38,0x10,0x00},
        // W (87)
        {0xC6,0xC6,0xD6,0xFE,0xFE,0xEE,0xC6,0x00},
        // X (88)
        {0xC6,0x6C,0x38,0x10,0x38,0x6C,0xC6,0x00},
        // Y (89)
        {0x66,0x66,0x66,0x3C,0x18,0x18,0x3C,0x00},
        // Z (90)
        {0xFE,0xCC,0x8C,0x18,0x32,0x66,0xFE,0x00},
        // [ (91)
        {0x3C,0x30,0x30,0x30,0x30,0x30,0x3C,0x00},
        // \ (92)
        {0xC0,0x60,0x30,0x18,0x0C,0x06,0x02,0x00},
        // ] (93)
        {0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00},
        // ^ (94)
        {0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00},
        // _ (95)
        {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF},
        // ` (96)
        {0x30,0x18,0x0C,0x00,0x00,0x00,0x00,0x00},
        // a (97)
        {0x00,0x00,0x7C,0x06,0x7E,0xC6,0x7E,0x00},
        // b (98)
        {0xE0,0x60,0x7C,0x66,0x66,0x66,0xDC,0x00},
        // c (99)
        {0x00,0x00,0x7C,0xC6,0xC0,0xC6,0x7C,0x00},
        // d (100)
        {0x1C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00},
        // e (101)
        {0x00,0x00,0x7C,0xC6,0xFE,0xC0,0x7C,0x00},
        // f (102)
        {0x38,0x6C,0x60,0xF8,0x60,0x60,0xF0,0x00},
        // g (103)
        {0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0xF8},
        // h (104)
        {0xE0,0x60,0x6C,0x76,0x66,0x66,0xE6,0x00},
        // i (105)
        {0x18,0x00,0x38,0x18,0x18,0x18,0x3C,0x00},
        // j (106)
        {0x0C,0x00,0x1C,0x0C,0x0C,0xCC,0xCC,0x78},
        // k (107)
        {0xE0,0x60,0x66,0x6C,0x78,0x6C,0xE6,0x00},
        // l (108)
        {0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00},
        // m (109)
        {0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xC6,0x00},
        // n (110)
        {0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x00},
        // o (111)
        {0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x7C,0x00},
        // p (112)
        {0x00,0x00,0xDC,0x66,0x66,0x7C,0x60,0xF0},
        // q (113)
        {0x00,0x00,0x76,0xCC,0xCC,0x7C,0x0C,0x1E},
        // r (114)
        {0x00,0x00,0xDC,0x76,0x66,0x60,0xF0,0x00},
        // s (115)
        {0x00,0x00,0x7E,0xC0,0x7C,0x06,0xFC,0x00},
        // t (116)
        {0x30,0x30,0xFC,0x30,0x30,0x36,0x1C,0x00},
        // u (117)
        {0x00,0x00,0xCC,0xCC,0xCC,0xCC,0x76,0x00},
        // v (118)
        {0x00,0x00,0xC6,0xC6,0xC6,0x6C,0x38,0x00},
        // w (119)
        {0x00,0x00,0xC6,0xD6,0xFE,0xFE,0x6C,0x00},
        // x (120)
        {0x00,0x00,0xC6,0x6C,0x38,0x6C,0xC6,0x00},
        // y (121)
        {0x00,0x00,0xC6,0xC6,0xC6,0x7E,0x06,0xFC},
        // z (122)
        {0x00,0x00,0xFE,0x4C,0x18,0x32,0xFE,0x00},
        // { (123)
        {0x0E,0x18,0x18,0x70,0x18,0x18,0x0E,0x00},
        // | (124)
        {0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x00},
        // } (125)
        {0x70,0x18,0x18,0x0E,0x18,0x18,0x70,0x00},
        // ~ (126)
        {0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00}
};

// Функция для рендеринга всех символов ASCII
void render_ascii(ANativeWindow* window) {
    if (!window) return;

    // Получаем размеры окна
    int32_t width = ANativeWindow_getWidth(window);
    int32_t height = ANativeWindow_getHeight(window);

    ANativeWindow_Buffer buffer;
    // Блокируем окно для доступа к буферу пикселей
    if (ANativeWindow_lock(window, &buffer, nullptr) != 0) {
        LOGI("Не удалось заблокировать окно");
        return;
    }

    // Устанавливаем фон белым цветом
    uint32_t* pixels = (uint32_t*)buffer.bits;
    int32_t stride = buffer.stride;
    for (int y = 0; y < height; y++) {
        for(int x = 0; x < width; x++) {
            pixels[y * stride + x] = 0xFFFFFFFF; // Белый цвет
        }
    }

    // Параметры сетки
    const int char_width = 8;
    const int char_height = 8;
    const int margin = 10;
    const int chars_per_row = (width - 2 * margin) / (char_width + 2);
    const int rows = (height - 2 * margin) / (char_height + 2);

    // Начальная позиция
    int start_x = margin;
    int start_y = margin;

    // Общее количество символов
    const int total_chars = 95; // От 32 до 126

    for(int i = 0; i < total_chars; i++) {
        // Вычисляем позицию для текущего символа
        int row = i / chars_per_row;
        int col = i % chars_per_row;

        if(row >= rows) {
            // Достигли предела экрана
            break;
        }

        int x_offset = start_x + col * (char_width + 2);
        int y_offset = start_y + row * (char_height + 2);

        // Получаем битовый шаблон символа
        const uint8_t* bitmap = font8x8_basic[i];

        // Проходим по каждой строке символа
        for(int y = 0; y < char_height; y++) {
            uint8_t row_bits = bitmap[y];
            for(int x = 0; x < char_width; x++) {
                if(row_bits & (1 << (7 - x))) {
                    int px = x_offset + x;
                    int py = y_offset + y;
                    if(px >= 0 && px < width && py >=0 && py < height){
                        pixels[py * stride + px] = 0xFF000000; // Черный цвет
                    }
                }
            }
        }
    }

    // Разблокируем и отображаем буфер
    ANativeWindow_unlockAndPost(window);
}

// Обработчик команд приложения
static void handle_cmd(struct android_app* app, int32_t cmd) {
    switch(cmd) {
        case APP_CMD_INIT_WINDOW:
            if (app->window != nullptr) {
                render_ascii(app->window);
            }
            break;
        default:
            break;
    }
}

// Главная функция приложения
void android_main(struct android_app* app) {
    // Устанавливаем обработчик команд
    app->onAppCmd = handle_cmd;

    // Главный цикл обработки событий
    while (1) {
        int events;
        struct android_poll_source* source;
        // Обрабатываем все события
        while (ALooper_pollAll(0, nullptr, &events, (void**)&source) >= 0) {
            if (source != nullptr) {
                source->process(app, source);
            }

            // Если приложение должно быть закрыто, выходим из цикла
            if (app->destroyRequested != 0) {
                return;
            }
        }
        // Здесь можно выполнять другие задачи, если необходимо
    }
}