summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-26 01:12:22 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-26 01:40:30 -0300
commitae518b0432c49abb21229f632020f54a2b159903 (patch)
tree6cd81474fadbde396fb0fc6024ec6d010d56141b /kicad
parentce09b77d3be3cf2f61142dbdf22b05afe881f59c (diff)
downloadeeshow-ae518b0432c49abb21229f632020f54a2b159903.tar.gz
eeshow-ae518b0432c49abb21229f632020f54a2b159903.tar.bz2
eeshow-ae518b0432c49abb21229f632020f54a2b159903.zip
kicad/dwg.c: add text style to label drawing functions
Diffstat (limited to 'kicad')
-rw-r--r--kicad/dwg.c68
-rw-r--r--kicad/dwg.h9
-rw-r--r--kicad/sch-render.c5
-rw-r--r--kicad/sch.h2
4 files changed, 45 insertions, 39 deletions
diff --git a/kicad/dwg.c b/kicad/dwg.c
index f925539..7b2be1c 100644
--- a/kicad/dwg.c
+++ b/kicad/dwg.c
@@ -81,16 +81,17 @@ static enum box_type flip_box(enum box_type box)
void dwg_label(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox)
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox)
{
struct text txt = {
- .s = s,
- .size = dim,
- .x = x,
- .y = y,
- .rot = 0,
- .hor = 0,
- .vert = text_min,
+ .s = s,
+ .size = dim,
+ .x = x,
+ .y = y,
+ .rot = 0,
+ .hor = 0,
+ .vert = text_min,
+ .style = style,
};
int dx = 0, dy = 0;
@@ -126,16 +127,17 @@ void dwg_label(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
void dwg_glabel(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox)
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox)
{
struct text txt = {
- .s = s,
- .size = dim,
- .x = x,
- .y = y,
- .rot = 0,
- .hor = 0,
- .vert = text_mid,
+ .s = s,
+ .size = dim,
+ .x = x,
+ .y = y,
+ .rot = 0,
+ .hor = 0,
+ .vert = text_mid,
+ .style = style,
};
int n = 6;
int vx[7];
@@ -326,16 +328,17 @@ static int make_box(enum box_type box, int h, int *vx, int *vy)
void dwg_hlabel(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox)
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox)
{
struct text txt = {
- .s = s,
- .size = dim,
- .x = x,
- .y = y,
- .rot = 0,
- .hor = 0,
- .vert = text_mid,
+ .s = s,
+ .size = dim,
+ .x = x,
+ .y = y,
+ .rot = 0,
+ .hor = 0,
+ .vert = text_mid,
+ .style = style,
};
int vx[6], vy[6];
int rot;
@@ -405,16 +408,17 @@ void dwg_hlabel(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
void dwg_text(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox)
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox)
{
struct text txt = {
- .s = s,
- .size = dim,
- .x = x,
- .y = y,
- .rot = 0,
- .hor = text_min,
- .vert = text_min,
+ .s = s,
+ .size = dim,
+ .x = x,
+ .y = y,
+ .rot = 0,
+ .hor = text_min,
+ .vert = text_min,
+ .style = style,
};
switch (dir) {
diff --git a/kicad/dwg.h b/kicad/dwg.h
index be1ac60..16242b7 100644
--- a/kicad/dwg.h
+++ b/kicad/dwg.h
@@ -15,6 +15,7 @@
#define KICAD_DWG_H
#include "gfx/gfx.h"
+#include "gfx/text.h"
enum dwg_shape {
@@ -32,13 +33,13 @@ struct dwg_bbox {
void dwg_label(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox);
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);
void dwg_hlabel(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox);
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);
void dwg_glabel(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox);
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);
void dwg_text(struct gfx *gfx, int x, int y, const char *s, int dir, int dim,
- enum dwg_shape shape, struct dwg_bbox *bbox);
+ enum dwg_shape shape, enum text_style style, struct dwg_bbox *bbox);
void dwg_junction(struct gfx *gfx, int x, int y);
void dwg_noconn(struct gfx *gfx, int x, int y);
diff --git a/kicad/sch-render.c b/kicad/sch-render.c
index 49b5e64..55670fc 100644
--- a/kicad/sch-render.c
+++ b/kicad/sch-render.c
@@ -127,7 +127,7 @@ static void render_sheet(const struct sch_obj *obj,
for (field = sheet->fields; field; field = field->next)
dwg_hlabel(gfx, field->x, field->y, field->s,
field->side, field->dim,
- field->shape, NULL);
+ field->shape, text_normal, NULL);
// free(field->s)
}
@@ -159,7 +159,8 @@ void sch_render(const struct sheet *sheet, struct gfx *gfx)
text->fn(gfx, obj->x, obj->y,
text->s, text->dir,
- text->dim, text->shape, &text->bbox);
+ text->dim, text->shape, text->style,
+ &text->bbox);
}
break;
case sch_obj_comp:
diff --git a/kicad/sch.h b/kicad/sch.h
index 1ccb3fd..75f02ae 100644
--- a/kicad/sch.h
+++ b/kicad/sch.h
@@ -58,7 +58,7 @@ struct sch_obj {
void (*fn)(struct gfx *gfx,
int x, int y, const char *s,
int dir, int dim, enum dwg_shape shape,
- struct dwg_bbox *bbox);
+ enum text_style style, struct dwg_bbox *bbox);
const char *s;
int dir; /* orientation */
int dim; /* dimension */