From: Ben Harris Date: Fri, 1 Nov 2024 10:18:14 +0000 (+0000) Subject: More BDF properties and a proper XLFD name X-Git-Tag: bedstead-3.246~87 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=4c81bfa2495067b27ef9b518c1a6f3524eca1d20;p=bedstead-debian.git More BDF properties and a proper XLFD name --- diff --git a/bedstead.c b/bedstead.c index 8c239db..3e0ff83 100644 --- a/bedstead.c +++ b/bedstead.c @@ -3839,6 +3839,8 @@ static void bdf_gen(int px_height) { int px_width = (px_height * XPIX * XSIZE) / (YPIX * YSIZE); + int pt_height = (long)(px_height * 7227 + 3750) / 7500; + int dpt_height = (long)(px_height * 7227 + 375) / 750; int base = (px_height * 200) / (YPIX * YSIZE); int i; @@ -3851,9 +3853,37 @@ bdf_gen(int px_height) printf("/buf %d string def\n", (px_width + 7) / 8); printf("(\\\n"); printf("STARTFONT 2.1\n"); - printf("FONT bedstead-%d\n", px_height); - printf("SIZE %d 75 75\n", px_height); + printf("FONT -bjh21-Bedstead-%s-R-%s--" + "%d-%d-75-75-C-%d-ISO10646-1\n", + *weight->suffix ? weight->suffix : "Medium", + *width->suffix ? width->suffix : "Normal", + dpt_height, px_height, px_width * 10); + printf("SIZE %d 75 75\n", pt_height); printf("FONTBOUNDINGBOX %d %d 0 %d\n", px_width, px_height, -base); + printf("STARTPROPERTIES 20\n"); + printf("FOUNDRY \"bjh21\"\n"); + printf("FAMILY_NAME \"Bedstead\"\n"); + printf("WEIGHT_NAME \"%s\"\n", + *weight->suffix ? weight->suffix : "Medium"); + printf("SLANT \"R\"\n"); + printf("SETWIDTH_NAME \"%s\"\n", + *width->suffix ? width->suffix : "Normal"); + printf("ADD_STYLE_NAME \"\"\n"); + printf("PIXEL_SIZE %d\n", px_height); + printf("POINT_SIZE %d\n", dpt_height); + printf("RESOLUTION_X 75\n"); + printf("RESOLUTION_Y 75\n"); + printf("SPACING \"C\"\n"); + printf("AVERAGE_WIDTH %d\n", px_width * 10); + printf("CHARSET_REGISTRY \"ISO10646\"\n"); + printf("CHARSET_ENCODING \"1\"\n"); + printf("FONT_ASCENT %d\n", px_height - base); + printf("FONT_DESCENT %d\n", base); + printf("UNDERLINE_POSITION %d\n", base / 2); + printf("UNDERLINE_THICKNESS %d\n", base / 2); + printf("RELATIVE_SETWIDTH %d\n", width->ttfwidth * 10); + printf("RELATIVE_WEIGHT %d\n", weight->ttfweight / 10); + printf("ENDPROPERTIES\n"); printf("CHARS %d\n", nglyphs); for (i = 0; i < nglyphs; i++) { struct glyph *g = &glyphs[i];