chiark / gitweb /
Half-width versions of fonts.
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 2 Jul 2017 16:56:24 +0000 (17:56 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 2 Jul 2017 16:56:24 +0000 (17:56 +0100)
These are intended to be used as double-height characters.

Makefile
bedstead.c

index 80fa1a922ec1959ab4a185363a135be31987fe7a..23973b929a2efc50741bf7cfd93834784b2eb156 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
-all: bedstead.otf bedstead-ext.otf sample.png title.png extended.png \
+all: bedstead.otf bedstead-ext.otf bedstead-con.otf bedstead-sem.otf \
+     sample.png title.png extended.png \
      bedstead-10-df.png bedstead-20-df.png
 
 bedstead.sfd: bedstead
@@ -7,6 +8,12 @@ bedstead.sfd: bedstead
 bedstead-ext.sfd: bedstead
        ./bedstead --extended > bedstead-ext.sfd
 
+bedstead-con.sfd: bedstead
+       ./bedstead --condensed > bedstead-con.sfd
+
+bedstead-sem.sfd: bedstead
+       ./bedstead --semicondensed > bedstead-sem.sfd
+
 %.otf %-10.bdf %-20.bdf: %.sfd
        fontforge -lang=ff \
            -c 'Open($$1); BitmapsAvail([10, 20]); Generate($$2, "bdf")' $< $@
index c21a5209caba50aeab0f8064e8823bbcf7db940a..83723ee8e31b24e8280472c1f6e9e64ec170dcd9 100644 (file)
@@ -144,6 +144,18 @@ struct param extended_param = {
        7,              /* ttfwidth */
 };
 
+struct param condensed_param = {
+       "Bedstead-Condensed", "Bedstead Condensed",
+       50,             /* xpix */
+       1,              /* ttfwidth */
+};
+
+struct param semicondensed_param = {
+       "Bedstead-Semicondensed", "Bedstead Semicondensed",
+       62,             /* xpix */
+       2,              /* ttfwidth */
+};
+
 struct param *param = &default_param;
 
 /* Size of pixels in font design units (usually 1000/em) */
@@ -1205,6 +1217,12 @@ main(int argc, char **argv)
                if (strcmp(argv[1], "--extended") == 0) {
                        param = &extended_param;
                        argv++; argc--;
+               } else if (strcmp(argv[1], "--condensed") == 0) {
+                       param = &condensed_param;
+                       argv++; argc--;
+               } else if (strcmp(argv[1], "--semicondensed") == 0) {
+                       param = &semicondensed_param;
+                       argv++; argc--;
                } else if (strcmp(argv[1], "--") == 0) {
                        argv++; argc--;
                        break;
@@ -1717,7 +1735,7 @@ emit_path()
                        if (!started) printf("Fore\nSplineSet\n");
                        started = 1;
                        do {
-                               printf(" %.0f %.0f %s 1\n",
+                               printf(" %g %g %s 1\n",
                                       (double)p->v.x / SCALE,
                                       (double)p->v.y / SCALE - 3*YPIX,
                                    p == &points[i] && p->next ? "m" : "l");