mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-25 21:23:38 -04:00
Emit cntrmask operators
This commit is contained in:
parent
cf28bd71ef
commit
5e46500fb8
24
bedstead.c
24
bedstead.c
@ -3871,14 +3871,15 @@ emit_hints(int vstems[XSIZE], int ledges[XSIZE], int redges[XSIZE],
|
||||
{
|
||||
int i, start, size, cur;
|
||||
enum hint_type vhints[XSIZE], hhints[YSIZE];
|
||||
bool printed;
|
||||
bool printed, need_cntrmask;
|
||||
|
||||
select_hints(YSIZE, hstems, tedges, bedges, hhints);
|
||||
cur = DESCENT * YPIX; printed = false;
|
||||
for (i = 0; i < YSIZE; i++) {
|
||||
switch (hhints[YSIZE - 1 - i]) {
|
||||
case hint_stem:
|
||||
case hint_counter_stem:
|
||||
need_cntrmask = true; /* FALLTHROUGH */
|
||||
case hint_stem:
|
||||
start = i * YPIX_S;
|
||||
size = YPIX_S;
|
||||
break;
|
||||
@ -3905,8 +3906,9 @@ emit_hints(int vstems[XSIZE], int ledges[XSIZE], int redges[XSIZE],
|
||||
size = XPIX_S + weight->weight;
|
||||
for (i = 0; i < XSIZE; i++) {
|
||||
switch (vhints[i]) {
|
||||
case hint_stem:
|
||||
case hint_counter_stem:
|
||||
need_cntrmask = true; /* FALLTHROUGH */
|
||||
case hint_stem:
|
||||
start = i * XPIX_S - weight->weight;
|
||||
size = XPIX_S + weight->weight;
|
||||
break;
|
||||
@ -3927,6 +3929,22 @@ emit_hints(int vstems[XSIZE], int ledges[XSIZE], int redges[XSIZE],
|
||||
printed = true;
|
||||
}
|
||||
if (printed) printf(" vstem");
|
||||
|
||||
if (need_cntrmask) {
|
||||
int nhints = 0;
|
||||
printf(" cntrmask ");
|
||||
for (i = 0; i < YSIZE; i++)
|
||||
if (hhints[i]) {
|
||||
printf("%c", "X0100"[hhints[i]]);
|
||||
nhints++;
|
||||
}
|
||||
for (i = 0; i < XSIZE; i++)
|
||||
if (vhints[i]) {
|
||||
printf("%c", "X0100"[vhints[i]]);
|
||||
nhints++;
|
||||
}
|
||||
printf("0000000" + (nhints - 1) % 8);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user