Changeset View
Changeset View
Standalone View
Standalone View
contrib/groff/src/devices/grolbp/lbp.cpp
- This file uses an unknown character encoding.
Show First 20 Lines • Show All 268 Lines • ▼ Show 20 Lines | if (siz >= 10) | ||||
cpi = 12; | cpi = 12; | ||||
else cpi = 17; | else cpi = 17; | ||||
} | } | ||||
// Now that we have all the data, let's generate the font name. | // Now that we have all the data, let's generate the font name. | ||||
if ((type != 'B') && (type != 'I')) // Roman font | if ((type != 'B') && (type != 'I')) // Roman font | ||||
sprintf(bfont_name, "%c%s%d", ori, nam, cpi); | sprintf(bfont_name, "%c%s%d", ori, nam, cpi); | ||||
else | else | ||||
sprintf(bfont_name, "%c%s%d%c", ori, nam, cpi, type); | sprintf(bfont_name, "%c%s%d%c", ori, nam, cpi, type); | ||||
delete[] nam; | |||||
return bfont_name; | return bfont_name; | ||||
} | } | ||||
void lbp_printer::set_char(int idx, font *f, const environment *env, | void lbp_printer::set_char(int idx, font *f, const environment *env, | ||||
int w, const char *) | int w, const char *) | ||||
{ | { | ||||
int code = f->get_code(idx); | int code = f->get_code(idx); | ||||
unsigned char ch = code & 0xff; | unsigned char ch = code & 0xff; | ||||
▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | inline void lbp_printer::polygon(int hpos, int vpos, int np, int *p) | ||||
points[0] = hpos; | points[0] = hpos; | ||||
points[1] = vpos; | points[1] = vpos; | ||||
// fprintf(stderr, "Poligon (%d,%d) ", points[0], points[1]); | // fprintf(stderr, "Poligon (%d,%d) ", points[0], points[1]); | ||||
for (i = 0; i < np; i++) | for (i = 0; i < np; i++) | ||||
points[i + 2] = p[i]; | points[i + 2] = p[i]; | ||||
// for (i = 0; i < np; i++) fprintf(stderr, " %d ", p[i]); | // for (i = 0; i < np; i++) fprintf(stderr, " %d ", p[i]); | ||||
// fprintf(stderr, "\n"); | // fprintf(stderr, "\n"); | ||||
vdmpolygon((np /2) + 1, points); | vdmpolygon((np /2) + 1, points); | ||||
delete[] points; | |||||
} | } | ||||
void lbp_printer::draw(int code, int *p, int np, const environment *env) | void lbp_printer::draw(int code, int *p, int np, const environment *env) | ||||
{ | { | ||||
if ((req_linethickness < 0 ) && (env->size != cur_size)) | if ((req_linethickness < 0 ) && (env->size != cur_size)) | ||||
set_line_thickness(req_linethickness,env); | set_line_thickness(req_linethickness,env); | ||||
switch (code) { | switch (code) { | ||||
▲ Show 20 Lines • Show All 306 Lines • Show Last 20 Lines |