chiark / gitweb /
Replace "param" in variable etc names with "width".
authorBen Harris <bjh21@bjh21.me.uk>
Mon, 31 Jul 2017 15:49:05 +0000 (16:49 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Mon, 31 Jul 2017 15:49:05 +0000 (16:49 +0100)
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.

bedstead.c

index 7f25cbe6b4c4be0fb6692b128ba68dacef9347d3..bdd0328afa0ca4be25a9e4c23d41d7b8f15b8889 100644 (file)
  * 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 = &params[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 = &params[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");