Emit cntrmask operators

This commit is contained in:
Ben Harris 2024-11-19 21:53:16 +00:00
parent cf28bd71ef
commit 5e46500fb8

View File

@ -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);
}
}
/*