From: Ben Harris Date: Mon, 31 Jul 2017 15:49:05 +0000 (+0100) Subject: Replace "param" in variable etc names with "width". X-Git-Tag: bedstead-002.000~114 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=820ea3a7dc3961ce3f49cfaf1ffdb7b99e3e4dcd;p=bedstead.git Replace "param" in variable etc names with "width". I think I'll want to vary different design parameters independently, and I don't want to have to maintain the full cross product by hand. --- diff --git a/bedstead.c b/bedstead.c index 7f25cbe..bdd0328 100644 --- a/bedstead.c +++ b/bedstead.c @@ -125,7 +125,7 @@ * to 124 so that XQTR will be precisely an integer. */ -struct param { +struct width { char const * option; char const * fontname; char const * fullname; @@ -133,7 +133,7 @@ struct param { int ttfwidth; }; -struct param const params[] = { +struct width const widths[] = { { "--normal", "Bedstead", "Bedstead", @@ -171,13 +171,13 @@ struct param const params[] = { 7, /* ttfwidth */ }, }; -static int const nparams = sizeof(params) / sizeof(params[0]); +static int const nwidths = sizeof(widths) / sizeof(widths[0]); -struct param const *param = ¶ms[0]; +struct width const *width = &widths[0]; /* Size of pixels in font design units (usually 1000/em) */ -#define XPIX (param->xpix) +#define XPIX (width->xpix) #define YPIX 100 /* We work internally in smaller units, though. */ @@ -1274,9 +1274,9 @@ main(int argc, char **argv) while (argc > 1) { - for (i = 0; i < nparams; i++) - if (strcmp(argv[1], params[i].option) == 0) { - param = ¶ms[i]; + for (i = 0; i < nwidths; i++) + if (strcmp(argv[1], widths[i].option) == 0) { + width = &widths[i]; argv++; argc--; goto next; } @@ -1324,8 +1324,8 @@ main(int argc, char **argv) if (glyphs[i].unicode == -1) extraglyphs++; printf("SplineFontDB: 3.0\n"); - printf("FontName: %s\n", param->fontname); - printf("FullName: %s\n", param->fullname); + printf("FontName: %s\n", width->fontname); + printf("FullName: %s\n", width->fullname); printf("FamilyName: Bedstead\n"); printf("Weight: Medium\n"); printf("OS2_WeightWidthSlopeOnly: 1\n"); @@ -1349,7 +1349,7 @@ main(int argc, char **argv) printf("OS2SupYOff: %d\n", 2 * YPIX); printf("FSType: 0\n"); printf("TTFWeight: 500\n"); - printf("TTFWidth: %d\n", param->ttfwidth); + printf("TTFWidth: %d\n", width->ttfwidth); dopanose(); printf("OS2FamilyClass: %d\n", 0x080a); printf("LayerCount: 2\n");