Skip to content

Commit 3e2d777

Browse files
chenhuacaiyetist
authored andcommitted
tty: Add Chinese fonts support in console
Signed-off-by: Haiyong Sun <sunhy@lemote.com> Signed-off-by: Huacai Chen <chenhc@lemote.com>
1 parent 4002c0e commit 3e2d777

5 files changed

Lines changed: 135210 additions & 1 deletion

File tree

include/linux/font.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct font_desc {
3535
#define FONT6x10_IDX 10
3636
#define TER16x32_IDX 11
3737
#define FONT6x8_IDX 12
38+
#define UTF8x16_IDX 13
3839

3940
extern const struct font_desc font_vga_8x8,
4041
font_vga_8x16,
@@ -48,7 +49,8 @@ extern const struct font_desc font_vga_8x8,
4849
font_mini_4x6,
4950
font_6x10,
5051
font_ter_16x32,
51-
font_6x8;
52+
font_6x8,
53+
font_utf8_8x16;
5254

5355
/* Find a font with a specific name */
5456

lib/fonts/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ config FONT_8x16
4444

4545
If unsure, say Y.
4646

47+
config FONT_UTF8x16
48+
bool "UTF-8 8x16 font" if FONTS
49+
depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON
50+
default y
51+
help
52+
This is the "high resolution" font for the VGA frame buffer (the one
53+
provided by the VGA text console 80x25 mode.
54+
55+
If unsure, say Y.
56+
57+
4758
config FONT_6x11
4859
bool "Mac console 6x11 font (not supported by all drivers)" if FONTS
4960
depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE
@@ -139,6 +150,7 @@ config FONT_AUTOSELECT
139150
depends on !FONT_10x18
140151
depends on !FONT_TER16x32
141152
depends on !FONT_6x8
153+
depends on !FONT_UTF8x16
142154
select FONT_8x16
143155

144156
endif # FONT_SUPPORT

lib/fonts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ font-objs-$(CONFIG_FONT_MINI_4x6) += font_mini_4x6.o
1616
font-objs-$(CONFIG_FONT_6x10) += font_6x10.o
1717
font-objs-$(CONFIG_FONT_TER16x32) += font_ter16x32.o
1818
font-objs-$(CONFIG_FONT_6x8) += font_6x8.o
19+
font-objs-$(CONFIG_FONT_UTF8x16) += font_utf8x16.o
1920

2021
font-objs += $(font-objs-y)
2122

0 commit comments

Comments
 (0)