mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-10 05:53:05 -04:00
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.
This commit is contained in:
parent
034e78153b
commit
820ea3a7dc
22
bedstead.c
22
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");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user