Commit e2028c8e authored by Sven Schneider's avatar Sven Schneider Committed by Bartlomiej Zolnierkiewicz

lib/fonts: add font 6x8 for OLED display

This font is derived from lib/fonts/font_6x10.c and is useful for small
OLED displays
Signed-off-by: default avatarSven Schneider <s.schneider@arkona-technologies.de>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200820082137.5907-1-s.hauer@pengutronix.de
parent a91df118
...@@ -33,6 +33,7 @@ struct font_desc { ...@@ -33,6 +33,7 @@ struct font_desc {
#define MINI4x6_IDX 9 #define MINI4x6_IDX 9
#define FONT6x10_IDX 10 #define FONT6x10_IDX 10
#define TER16x32_IDX 11 #define TER16x32_IDX 11
#define FONT6x8_IDX 12
extern const struct font_desc font_vga_8x8, extern const struct font_desc font_vga_8x8,
font_vga_8x16, font_vga_8x16,
...@@ -45,7 +46,8 @@ extern const struct font_desc font_vga_8x8, ...@@ -45,7 +46,8 @@ extern const struct font_desc font_vga_8x8,
font_acorn_8x8, font_acorn_8x8,
font_mini_4x6, font_mini_4x6,
font_6x10, font_6x10,
font_ter_16x32; font_ter_16x32,
font_6x8;
/* Find a font with a specific name */ /* Find a font with a specific name */
......
...@@ -119,6 +119,12 @@ config FONT_TER16x32 ...@@ -119,6 +119,12 @@ config FONT_TER16x32
This is the high resolution, large version for use with HiDPI screens. This is the high resolution, large version for use with HiDPI screens.
If the standard font is unreadable for you, say Y, otherwise say N. If the standard font is unreadable for you, say Y, otherwise say N.
config FONT_6x8
bool "OLED 6x8 font" if FONTS
depends on FRAMEBUFFER_CONSOLE
help
This font is useful for small displays (OLED).
config FONT_AUTOSELECT config FONT_AUTOSELECT
def_bool y def_bool y
depends on !FONT_8x8 depends on !FONT_8x8
...@@ -132,6 +138,7 @@ config FONT_AUTOSELECT ...@@ -132,6 +138,7 @@ config FONT_AUTOSELECT
depends on !FONT_SUN12x22 depends on !FONT_SUN12x22
depends on !FONT_10x18 depends on !FONT_10x18
depends on !FONT_TER16x32 depends on !FONT_TER16x32
depends on !FONT_6x8
select FONT_8x16 select FONT_8x16
endif # FONT_SUPPORT endif # FONT_SUPPORT
...@@ -15,6 +15,7 @@ font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o ...@@ -15,6 +15,7 @@ font-objs-$(CONFIG_FONT_ACORN_8x8) += font_acorn_8x8.o
font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
font-objs-$(CONFIG_FONT_6x10) += font_6x10.o font-objs-$(CONFIG_FONT_6x10) += font_6x10.o
font-objs-$(CONFIG_FONT_TER16x32) += font_ter16x32.o font-objs-$(CONFIG_FONT_TER16x32) += font_ter16x32.o
font-objs-$(CONFIG_FONT_6x8) += font_6x8.o
font-objs += $(font-objs-y) font-objs += $(font-objs-y)
......
This diff is collapsed.
...@@ -57,6 +57,9 @@ static const struct font_desc *fonts[] = { ...@@ -57,6 +57,9 @@ static const struct font_desc *fonts[] = {
#ifdef CONFIG_FONT_TER16x32 #ifdef CONFIG_FONT_TER16x32
&font_ter_16x32, &font_ter_16x32,
#endif #endif
#ifdef CONFIG_FONT_6x8
&font_6x8,
#endif
}; };
#define num_fonts ARRAY_SIZE(fonts) #define num_fonts ARRAY_SIZE(fonts)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment