Ugly font display with monochrome device

Hello,

I’m using lvgl from master branch (but same with 9.2.2) with a 128x64 monochrome display.

As the arrangement of the pixels in memory is “different”, I had to develop my own conversion routine.
So far, so good, it seems with some tests that it works as it should.

Now, I tried 2 others tests:

  • Line from top-left corner to bottom-right: As the display is exactly twice wider than height, I expected a regular line which is not the case. It is thicker in the middle:

Sorry, some pictures will be posted in some answers. As a new user, I’m not allowed to post more than 2 attachments

  • A text: Font is montserrat_20. I expected a more regular shape.

As a comparison, here’s what I was able to get with LVGL8 and a 200x200 display -better definition though- but with a smaller font montserrat 16 for the smaller text. To me it looks far better.

I must have missed something in my code. I looked at how to disable antialiasing for example, but it looks that this is already taken care of by the library.
So what’s wrong?

I join the conf.h file.

Here’s the initialisation code:

void display__init() {
    lv_init();

    lv_display_t *display = lv_display_create(WIDTH, HEIGHT);
    lv_display_set_color_format(display, LV_COLOR_FORMAT_I1);

    lv_display_set_rotation(display, LV_DISPLAY_ROTATION_0);

    lv_display_set_buffers(display, buffer_lvgl, NULL, sizeof(buffer_lvgl), LV_DISPLAY_RENDER_MODE_FULL);
    lv_display_set_flush_cb(display, my_flush_cb);
    lv_display_add_event_cb(display, my_rounder_cb, LV_EVENT_INVALIDATE_AREA, display);
    m_default_scr = lv_disp_get_scr_act(NULL);

    //--- label
    lblAltitude = lv_label_create(m_default_scr);
    lv_label_set_text(lblAltitude, "rotation 2");
    lv_obj_set_width(lblAltitude, 100);
    lv_obj_set_x(lblAltitude, 10);
    lv_obj_set_y(lblAltitude, 10);

    lv_scr_load(m_default_scr);

    lv_task_handler();


Thanks for your help
Julien
lv_conf.h (25.2 KB)

Missing pictures from previous post:

Diagonal line:

Other display lvgl8:

Hello,

small follow-up in case anybody needs it.
I built a custom 1bit font from montserrat ttf and the result is better in my opinion. I also choosed the medium variant of the font.

Hi Julien,

Have you tried UNSCII_8 and UNSCII_16 for the monochrome display?

This is very useful if you want to create your own font:
https://www.pentacom.jp/pentacom/bitfontmaker2

disable anti-alias

Hi Marton,

I found UNSCII_8 too fat for my use.

Very interesting website!

Thanks for your help.
Julien

Hello

Do you have any advice on how to do it?

Thanks
Julien

I would have to look at the code as well. It could be disabled based on the color depth. However it doesn’t look like it is from your example image.

You should be able to change it by changing the field value for it in lv_display_t (lv_disp_t prior to V9).