Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 38385) +++ trunk/src/draw.c (revision 38386) @@ -1095,7 +1095,7 @@ if (rnd_render->gui) pcb_draw_force_termlab++; - pcb_text_draw_string(info, font, (unsigned const char *)label, x, y, scale/100, scale/100, direction*90.0, mirror, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE); + pcb_text_draw_string(info, font, (unsigned const char *)label, x, y, scale/100, scale/100, direction*90.0, mirror, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE, 0); if (rnd_render->gui) pcb_draw_force_termlab--; } Index: trunk/src/draw_label_smart.c =================================================================== --- trunk/src/draw_label_smart.c (revision 38385) +++ trunk/src/draw_label_smart.c (revision 38386) @@ -161,7 +161,7 @@ for(l = smart_labels; l != NULL; l = next) { next = l->next; - pcb_text_draw_string(info, font, (unsigned const char *)l->label, l->bbox.X1, l->bbox.Y1, l->scale, l->scale, l->rot, l->mirror, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE); + pcb_text_draw_string(info, font, (unsigned const char *)l->label, l->bbox.X1, l->bbox.Y1, l->scale, l->scale, l->rot, l->mirror, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE, 0); if ((l->bbox.X1 != l->x) || (l->bbox.Y1 != l->y)) { rnd_coord_t dx = l->w/2, dy = l->h/2; rnd_render->draw_line(pcb_draw_out.fgGC, l->bbox.X1+dx, l->bbox.Y1+dy, l->x+dx, l->y+dy); Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 38385) +++ trunk/src/obj_text.c (revision 38386) @@ -306,6 +306,9 @@ #define text_mirror_bits(t) \ ((PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, (t)) ? PCB_TXT_MIRROR_Y : 0) | ((t)->mirror_x ? PCB_TXT_MIRROR_X : 0)) +#define text_render_bits(t) \ + (PCB_FLAG_TEST(PCB_FLAG_ENTITY, (t)) ? RND_FONT_ENTITY : 0) + pcb_text_t *pcb_text_dup(pcb_layer_t *dst, pcb_text_t *src) { pcb_text_t *t = pcb_text_new_scaled(dst, pcb_font(PCB, src->fid, 1), src->X, src->Y, src->rot, text_mirror_bits(src), src->Scale, src->scale_x, src->scale_y, src->thickness, src->TextString, src->Flags); @@ -470,7 +473,7 @@ min_line_width = MAX(conf_core.design.min_wid, conf_core.design.min_slk); pcb_text_get_scale_xy(Text, &scx, &scy); - rnd_font_string_bbox_pcb_rnd(cx, cy, font, rendered, Text->X, Text->Y, scx, scy, Text->rot, text_mirror_bits(Text), Text->thickness, min_line_width, Text->Scale); + rnd_font_string_bbox_pcb_rnd(cx, cy, font, rendered, Text->X, Text->Y, scx, scy, Text->rot, text_mirror_bits(Text) | text_render_bits(Text), Text->thickness, min_line_width, Text->Scale); pcb_text_free_str(Text, rendered); /* rnd_trace("orig %mm %mm %mm %mm\n", Text->bbox_naked.X1, Text->bbox_naked.Y1, Text->bbox_naked.X2, Text->bbox_naked.Y2);*/ @@ -1283,7 +1286,7 @@ typedef void (*rnd_draw_text_cb)(void *ctx, const rnd_glyph_atom_t *atom); -RND_INLINE void pcb_text_draw_string_rnd(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny, pcb_draw_text_cb cb, void *cb_ctx) +RND_INLINE void pcb_text_draw_string_rnd(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny, pcb_flag_values_t text_flags, pcb_draw_text_cb cb, void *cb_ctx) { font_draw_atom_user_cb_t ucb; int poly_thin = info->xform->thin_draw || info->xform->wireframe; @@ -1310,6 +1313,8 @@ #ifdef PCB_WANT_FONT2 if (poly_thin) mirror |= RND_FONT_THIN_POLY; + if (text_flags & PCB_FLAG_ENTITY) + mirror |= RND_FONT_ENTITY; rnd_font_draw_string(font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, min_line_width, tiny, rcb, cb_ctx); #else rnd_font_draw_string(font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, min_line_width, poly_thin, tiny, rcb, cb_ctx); @@ -1317,18 +1322,18 @@ } -RND_INLINE void pcb_text_draw_string_(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny, pcb_draw_text_cb cb, void *cb_ctx) +RND_INLINE void pcb_text_draw_string_(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny, pcb_flag_values_t text_flags, pcb_draw_text_cb cb, void *cb_ctx) { - pcb_text_draw_string_rnd(info, font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, min_line_width, xordraw, xordx, xordy, tiny, cb, cb_ctx); + pcb_text_draw_string_rnd(info, font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, min_line_width, xordraw, xordx, xordy, tiny, text_flags, cb, cb_ctx); } -void pcb_text_draw_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny) +void pcb_text_draw_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny, pcb_flag_values_t text_flags) { - pcb_text_draw_string_(info, font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, min_line_width, xordraw, xordx, xordy, tiny, NULL, NULL); + pcb_text_draw_string_(info, font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, min_line_width, xordraw, xordx, xordy, tiny, text_flags, NULL, NULL); } -void pcb_text_draw_string_simple(rnd_font_t *font, const char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy) +void pcb_text_draw_string_simple(rnd_font_t *font, const char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_flag_values_t text_flags) { static rnd_xform_t xform = {0}; static pcb_draw_info_t info = {0}; @@ -1337,13 +1342,13 @@ if (font == NULL) font = pcb_font(PCB, 0, 0); - pcb_text_draw_string_(&info, font, (const unsigned char *)string, x0, y0, scx, scy, rotdeg, mirror, thickness, 0, xordraw, xordx, xordy, PCB_TXT_TINY_CHEAP, NULL, NULL); + pcb_text_draw_string_(&info, font, (const unsigned char *)string, x0, y0, scx, scy, rotdeg, mirror, thickness, 0, xordraw, xordx, xordy, PCB_TXT_TINY_CHEAP, text_flags, NULL, NULL); } -void pcb_text_decompose_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, pcb_draw_text_cb cb, void *cb_ctx) +void pcb_text_decompose_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, pcb_flag_values_t text_flags, pcb_draw_text_cb cb, void *cb_ctx) { - pcb_text_draw_string_(info, font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, 0, 0, 0, 0, PCB_TXT_TINY_ACCURATE, cb, cb_ctx); + pcb_text_draw_string_(info, font, string, x0, y0, scx, scy, rotdeg, mirror, thickness, 0, 0, 0, 0, PCB_TXT_TINY_ACCURATE, text_flags, cb, cb_ctx); } void pcb_text_decompose_text(pcb_draw_info_t *info, pcb_text_t *text, pcb_draw_text_cb cb, void *cb_ctx) @@ -1351,7 +1356,7 @@ unsigned char *rendered = pcb_text_render_str(text); double scx, scy; pcb_text_get_scale_xy(text, &scx, &scy); - pcb_text_decompose_string(info, pcb_font(PCB, text->fid, 1), rendered, text->X, text->Y, scx, scy, text->rot, text_mirror_bits(text), text->thickness, cb, cb_ctx); + pcb_text_decompose_string(info, pcb_font(PCB, text->fid, 1), rendered, text->X, text->Y, scx, scy, text->rot, text_mirror_bits(text), text->thickness, text->Flags.f, cb, cb_ctx); pcb_text_free_str(text, rendered); } @@ -1362,7 +1367,7 @@ unsigned char *rendered = pcb_text_render_str(Text); double scx, scy; pcb_text_get_scale_xy(Text, &scx, &scy); - pcb_text_draw_string_(info, pcb_font(PCB, Text->fid, 1), rendered, Text->X, Text->Y, scx, scy, Text->rot, text_mirror_bits(Text), Text->thickness, min_line_width, xordraw, xordx, xordy, tiny, NULL, NULL); + pcb_text_draw_string_(info, pcb_font(PCB, Text->fid, 1), rendered, Text->X, Text->Y, scx, scy, Text->rot, text_mirror_bits(Text), Text->thickness, min_line_width, xordraw, xordx, xordy, tiny, Text->Flags.f, NULL, NULL); pcb_text_free_str(Text, rendered); } Index: trunk/src/obj_text.h =================================================================== --- trunk/src/obj_text.h (revision 38385) +++ trunk/src/obj_text.h (revision 38386) @@ -112,7 +112,7 @@ void pcb_text_flagchg_post(pcb_text_t *Text, unsigned long oldflagbits, void **save); /* Low level draw call for direct rendering on preview */ -void pcb_text_draw_string_simple(rnd_font_t *font, const char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy); +void pcb_text_draw_string_simple(rnd_font_t *font, const char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_flag_values_t text_flags); /* Recalculate the bounding box of all dynamic text objects that are directly under data - useful e.g. on parent attr change */ Index: trunk/src/obj_text_draw.h =================================================================== --- trunk/src/obj_text_draw.h (revision 38385) +++ trunk/src/obj_text_draw.h (revision 38386) @@ -51,11 +51,11 @@ void pcb_text_draw_label(pcb_draw_info_t *info, pcb_text_t *text, rnd_bool vis_side); /* lowlevel drawing routine for text strings */ -void pcb_text_draw_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny); +void pcb_text_draw_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, rnd_coord_t min_line_width, int xordraw, rnd_coord_t xordx, rnd_coord_t xordy, pcb_text_tiny_t tiny, pcb_flag_values_t text_flags); /* Call cb(ctx, ...) for every object in a rendered string or text; obj will be disacrded after the call, can be modified by the callback */ typedef void (*pcb_draw_text_cb)(void *ctx, pcb_any_obj_t *obj); -void pcb_text_decompose_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, pcb_draw_text_cb cb, void *cb_ctx); +void pcb_text_decompose_string(pcb_draw_info_t *info, rnd_font_t *font, const unsigned char *string, rnd_coord_t x0, rnd_coord_t y0, double scx, double scy, double rotdeg, pcb_text_mirror_t mirror, rnd_coord_t thickness, pcb_flag_values_t text_flags, pcb_draw_text_cb cb, void *cb_ctx); void pcb_text_decompose_text(pcb_draw_info_t *info, pcb_text_t *text, pcb_draw_text_cb cb, void *cb_ctx); Index: trunk/src_plugins/dialogs/dlg_pinout.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pinout.c (revision 38385) +++ trunk/src_plugins/dialogs/dlg_pinout.c (revision 38386) @@ -77,7 +77,7 @@ bbox.X2 = bbox.Y2 = RND_MM_TO_COORD(10); rnd_dad_preview_zoomto(attrib, &bbox); rnd_render->set_color(gc, rnd_color_red); - pcb_text_draw_string_simple(NULL, tmp, RND_MM_TO_COORD(1), RND_MM_TO_COORD(20), 1.0, 1.0, 0, 0, 0, 0, 0, 0); + pcb_text_draw_string_simple(NULL, tmp, RND_MM_TO_COORD(1), RND_MM_TO_COORD(20), 1.0, 1.0, 0, 0, 0, 0, 0, 0, 0); } } Index: trunk/src_plugins/dialogs/dlg_test.c =================================================================== --- trunk/src_plugins/dialogs/dlg_test.c (revision 38385) +++ trunk/src_plugins/dialogs/dlg_test.c (revision 38386) @@ -522,7 +522,7 @@ static void prv_expose(rnd_hid_attribute_t *attrib, rnd_hid_preview_t *prv, rnd_hid_gc_t gc, rnd_hid_expose_ctx_t *e) { rnd_render->set_color(gc, rnd_color_red); - pcb_text_draw_string_simple(NULL, "foo", RND_MM_TO_COORD(1), RND_MM_TO_COORD(20), 5.0, 5.0, 10.0, 0, 0, 0, 0, 0); + pcb_text_draw_string_simple(NULL, "foo", RND_MM_TO_COORD(1), RND_MM_TO_COORD(20), 5.0, 5.0, 10.0, 0, 0, 0, 0, 0, 0); printf("expose in dlg_test!\n"); } Index: trunk/src_plugins/import_ttf/ttf.c =================================================================== --- trunk/src_plugins/import_ttf/ttf.c (revision 38385) +++ trunk/src_plugins/import_ttf/ttf.c (revision 38386) @@ -493,7 +493,7 @@ for(y = 0; y < 16; y++) { for(x = 0; x < 16; x++) s[x] = v++; - pcb_text_draw_string_simple(NULL, s, RND_MM_TO_COORD(0), RND_MM_TO_COORD(y*2), 1.0, 1.0, 0.0, 0, 0, 0, 0, 0); + pcb_text_draw_string_simple(NULL, s, RND_MM_TO_COORD(0), RND_MM_TO_COORD(y*2), 1.0, 1.0, 0.0, 0, 0, 0, 0, 0, 0); } } Index: trunk/src_plugins/show_netnames/show_netnames.c =================================================================== --- trunk/src_plugins/show_netnames/show_netnames.c (revision 38385) +++ trunk/src_plugins/show_netnames/show_netnames.c (revision 38386) @@ -233,7 +233,7 @@ } } - pcb_text_draw_string(info, font, (const unsigned char *)netname, x, y, lscale, lscale, rot, 0, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE); + pcb_text_draw_string(info, font, (const unsigned char *)netname, x, y, lscale, lscale, rot, 0, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE, 0); } break; default: @@ -242,7 +242,7 @@ scx = (double)(obj->bbox_naked.X2 - obj->bbox_naked.X1) / (double)shn->w * 0.8; scy = (double)(obj->bbox_naked.Y2 - obj->bbox_naked.Y1) / (double)shn->h * 0.8; lscale = RND_MIN(scx, scy); - pcb_text_draw_string(info, font, (const unsigned char *)netname, x, y, lscale, lscale, 0.0, 0, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE); + pcb_text_draw_string(info, font, (const unsigned char *)netname, x, y, lscale, lscale, 0.0, 0, conf_core.appearance.label_thickness, 0, 0, 0, 0, PCB_TXT_TINY_HIDE, 0); } } return NULL;