mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-12-23 14:57:43 +02:00
genex/pdf.c: added printing of comments
This commit is contained in:
parent
904a60f7f9
commit
3f3d957c98
24
genex/pdf.c
24
genex/pdf.c
@ -77,6 +77,28 @@ static void make_title(FILE *file, const struct node *node, int unit)
|
||||
}
|
||||
|
||||
|
||||
static void print_comment(FILE *file, const struct line *comment)
|
||||
{
|
||||
const struct line *line;
|
||||
int lines = 0;
|
||||
int n;
|
||||
|
||||
fprintf(file, "gsave 90 rotate 0 setgray\n"
|
||||
"/Helvetica findfont 12 scalefont setfont\n");
|
||||
for (line = comment; line; line = line->next)
|
||||
lines++;
|
||||
n = 0;
|
||||
for (line = comment; line; line = line->next) {
|
||||
n++;
|
||||
fprintf(file, "20 -%d moveto\n", 600+(n-lines)*14);
|
||||
ps_string(file, line->s);
|
||||
fprintf(file, " show\n");
|
||||
}
|
||||
fprintf(file, "grestore\n");
|
||||
fflush(file);
|
||||
}
|
||||
|
||||
|
||||
static void convert_comp(const struct node *node, FILE *out)
|
||||
{
|
||||
char *tmp;
|
||||
@ -84,6 +106,8 @@ static void convert_comp(const struct node *node, FILE *out)
|
||||
|
||||
for (i = 0; i != node->units; i++) {
|
||||
make_title(stdout, node, i);
|
||||
if (!i && node->comment)
|
||||
print_comment(out, node->comment);
|
||||
if (asprintf(&tmp, "./sym2xps '%s' '%s' %d '%s' '%s'",
|
||||
node->lib, node->canon, i+1, "tmp", "tmp.ps") < 0) {
|
||||
perror("asprintf");
|
||||
|
Loading…
Reference in New Issue
Block a user