mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-30 15:33:25 -04:00
Use constants for ascent, descent, etc
This way there won't be quite so many magic numbers in the font metrics.
This commit is contained in:
parent
c354f9c3ac
commit
29b33c20af
15
bedstead.c
15
bedstead.c
@ -108,8 +108,13 @@
|
||||
|
||||
#define VERSION "002.009"
|
||||
|
||||
/* Metrics expressed in pixels. */
|
||||
#define XSIZE 6
|
||||
#define YSIZE 10
|
||||
#define ASCENT 8
|
||||
#define DESCENT 2
|
||||
#define XHEIGHT 5
|
||||
#define CAPHEIGHT ASCENT
|
||||
|
||||
/*
|
||||
* Design parameters. These can vary between fonts in the Bedstead family.
|
||||
@ -2860,9 +2865,9 @@ main(int argc, char **argv)
|
||||
printf(" <created value='%s'/>\n", timestr);
|
||||
printf(" <modified value='%s'/>\n", timestr);
|
||||
printf(" <xMin value='%d'/>\n", 0);
|
||||
printf(" <yMin value='%d'/>\n", (int)(-2 * YPIX));
|
||||
printf(" <yMin value='%d'/>\n", (int)(-DESCENT * YPIX));
|
||||
printf(" <xMax value='%d'/>\n", (int)(XSIZE * XPIX));
|
||||
printf(" <yMax value='%d'/>\n", (int)((YSIZE - 2) * YPIX));
|
||||
printf(" <yMax value='%d'/>\n", (int)(ASCENT * YPIX));
|
||||
printf(" <macStyle value='00000000 0%c%c000%c'/>\n",
|
||||
width->ttfwidth > 5 ? '1' : '0', /* Expanded? */
|
||||
width->ttfwidth < 5 ? '1' : '0', /* Condensed? */
|
||||
@ -2875,8 +2880,8 @@ main(int argc, char **argv)
|
||||
|
||||
printf(" <hhea>\n");
|
||||
printf(" <tableVersion value='0x00010000'/>\n");
|
||||
printf(" <ascent value='%d'/>\n", (int)((YSIZE - 2) * YPIX));
|
||||
printf(" <descent value='%d'/>\n", (int)(-2 * YPIX));
|
||||
printf(" <ascent value='%d'/>\n", (int)(ASCENT * YPIX));
|
||||
printf(" <descent value='%d'/>\n", (int)(-DESCENT * YPIX));
|
||||
printf(" <lineGap value='0'/>\n");
|
||||
printf(" <advanceWidthMax value='%d'/>\n", (int)(XSIZE * XPIX));
|
||||
printf(" <minLeftSideBearing value='0'/>\n");
|
||||
@ -3931,7 +3936,7 @@ 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 base = DESCENT;
|
||||
int i;
|
||||
|
||||
printf("%%!\n");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user