font: Leverage KD_FONT_OP_GET/SET_TALL font operations
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 font: Leverage KD_FONT_OP_GET/SET_TALL font operations
The new KD_FONT_OP_GET/SET_TALL font operations allow to load fonts taller than 32 pixels by dropping the VGA-specific vertical pitch limitation.
The new maximum font size has thus been raised to 64x128.
We however continue using the older font operations for smaller fonts, to continue supporting older kernels.
Signed-off-by Samuel Thibault <[email protected]>
src/compat/linux-kd.h +4 -1
@@ -90,7 +90,8 @@ struct console_font_op {unsigned int flags;/* KD_FONT_FLAG_* */ unsigned int width, height;unsigned int charcount; -unsigned char *data;/* font data with height fixed to 32 */ +unsigned char *data;/* font data with vpitch fixed to 32 for +* KD_FONT_OP_SET/GET */ };#define KD_FONT_OP_SET 0/* Set font */
@@ -98,6 +99,8 @@ struct console_font_op {#define KD_FONT_OP_SET_DEFAULT 2/* Set font to default, \ data points to name / NULL */ #define KD_FONT_OP_COPY 3/* Copy from another console */ +#define KD_FONT_OP_SET_TALL 4/* Set font with arbitrary vpitch */ +#define KD_FONT_OP_GET_TALL 5/* Get font with arbitrary vpitch */ #define KD_FONT_FLAG_OLD 0x80000000/* Invoked via old interface */ #define KD_FONT_FLAG_DONT_RECALC 1/* Don't call adjust_height() */
src/libkfont/kdfontop.c +48 -10
120 lines not on this page · raw message
src/libkfont/kfont.h +5 -3
@@ -171,7 +171,8 @@ int kfont_load_unicodemap(struct kfont_c* Sets number of glyphs in COUNT, glyph size in WIDTH and HEIGHT. */ int kfont_get_font (struct kfont_context *ctx,int consolefd,unsigned char *buf, -unsigned int *count,unsigned int *width,unsigned int *height) +unsigned int *count,unsigned int *width,unsigned int *height, +unsigned int *vpitch) __attribute__((nonnull (1 )));/*
@@ -180,7 +181,8 @@ int kfont_get_font(struct kfont_context* Return 0 on success, -1 on failure. */ int kfont_put_font (struct kfont_context *ctx,int consolefd,unsigned char *buf, -unsigned int count,unsigned int width,unsigned int height) +unsigned int count,unsigned int width,unsigned int height, +unsigned int vpitch) __attribute__((nonnull (1 )));/*
@@ -239,7 +241,7 @@ void kfont_disactivatemap(int fd);#include <stdio.h> /* Maximum font size that we try to handle */ -#define MAXFONTSIZE 65536 +#define MAXFONTSIZE (512*64*128)/** * readpsffont reads a PSF font.
src/libkfont/setfont.c +30 -15
105 lines not on this page · raw message
src/showconsolefont.c +1 -1
@@ -205,7 +205,7 @@ int main(int argc, char **argv)if (info) { nr = rows = cols =0 ; - ret =kfont_get_font (kfont, fd,NULL , &nr, &rows, &cols); + ret =kfont_get_font (kfont, fd,NULL , &nr, &rows, &cols,NULL );if (ret !=0 )leave (kfont,EXIT_FAILURE );
tests/libtswrap/ioctl.c +6 -0
@@ -93,6 +93,12 @@ static struct translate_names kd_font_op { KD_FONT_OP_GET, "KD_FONT_OP_GET" }, { KD_FONT_OP_SET_DEFAULT, "KD_FONT_OP_SET_DEFAULT" }, { KD_FONT_OP_COPY, "KD_FONT_OP_COPY" }, +#ifdef KD_FONT_OP_SET_TALL + { KD_FONT_OP_SET_TALL, "KD_FONT_OP_SET_TALL" }, +#endif +#ifdef KD_FONT_OP_GET_TALL + { KD_FONT_OP_GET_TALL, "KD_FONT_OP_GET_TALL" }, +#endif { 0, NULL } };