Commit e84fd4c8 authored by Claes Sjofors's avatar Claes Sjofors

Plc HelpText object pdf text size fix

parent ae7ad342
...@@ -77,6 +77,7 @@ void FlowAnnot::print( void *pos, void *node, int highlight) ...@@ -77,6 +77,7 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
(text_size +4) - 4); (text_size +4) - 4);
double size = 8.0 + 6.0/3*idx; double size = 8.0 + 6.0/3*idx;
double x; double x;
double print_zoom_factor = 312;
if ( size <= 0) if ( size <= 0)
return; return;
...@@ -162,24 +163,25 @@ void FlowAnnot::print( void *pos, void *node, int highlight) ...@@ -162,24 +163,25 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
switch ( ctx->current_print->type()) { switch ( ctx->current_print->type()) {
case print_eType_Pdf: { case print_eType_Pdf: {
ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, h1_size, &z_width, &z_height, ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, h1_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*h1_size)); print_zoom_factor / ctx->base_zoom_factor * (12+2*h1_size));
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62; float k = - 2.5 * print_zoom_factor / ctx->base_zoom_factor + 2.62;
z_height *= k; z_height *= k * ctx->print_zoom_factor / print_zoom_factor;
size = 0.85 * z_height;
break; break;
} }
default: default:
ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold,
h1_size, &z_width, &z_height, h1_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*h1_size)); ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*h1_size));
}
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62; float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62;
z_height *= k; z_height *= k;
size = 8.0 + 48.0/3*idx;
}
if ( line_cnt > 0) if ( line_cnt > 0)
y_offs += z_height; y_offs += z_height;
else else
y_offs += z_height/3; y_offs += z_height/3;
size = 8.0 + 48.0/3*idx;
ctx->current_print->text( z_x, z_y + y_offs, &line[4], ctx->current_print->text( z_x, z_y + y_offs, &line[4],
len-4, flow_eDrawType_TextHelveticaBold, size, line_cnt); len-4, flow_eDrawType_TextHelveticaBold, size, line_cnt);
} }
...@@ -188,24 +190,25 @@ void FlowAnnot::print( void *pos, void *node, int highlight) ...@@ -188,24 +190,25 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
switch ( ctx->current_print->type()) { switch ( ctx->current_print->type()) {
case print_eType_Pdf: { case print_eType_Pdf: {
ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, h2_size, &z_width, &z_height, ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, h2_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*h2_size)); print_zoom_factor / ctx->base_zoom_factor * (12+2*h2_size));
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62; float k = (- 2.5 * print_zoom_factor / ctx->base_zoom_factor + 2.62) * ctx->print_zoom_factor / print_zoom_factor;
z_height *= k; z_height *= k;
size = 0.85 * z_height;
break; break;
} }
default: default:
ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold,
h2_size, &z_width, &z_height, h2_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*h2_size)); ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*h2_size));
}
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62; float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62;
z_height *= k; z_height *= k;
size = 8.0 + 20.0/3*idx;
}
if ( line_cnt > 0) if ( line_cnt > 0)
y_offs += z_height; y_offs += z_height;
else else
y_offs += z_height/3; y_offs += z_height/3;
size = 8.0 + 20.0/3*idx;
ctx->current_print->text( z_x, z_y + y_offs, &line[4], ctx->current_print->text( z_x, z_y + y_offs, &line[4],
len-4, flow_eDrawType_TextHelveticaBold, size, line_cnt); len-4, flow_eDrawType_TextHelveticaBold, size, line_cnt);
} }
...@@ -213,24 +216,25 @@ void FlowAnnot::print( void *pos, void *node, int highlight) ...@@ -213,24 +216,25 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
switch ( ctx->current_print->type()) { switch ( ctx->current_print->type()) {
case print_eType_Pdf: { case print_eType_Pdf: {
ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, text_size, &z_width, &z_height, ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, text_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size)); print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size));
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62; float k = - 2.5 * print_zoom_factor / ctx->base_zoom_factor + 2.62;
z_height *= k; z_height *= k * ctx->print_zoom_factor / print_zoom_factor;
size = 0.85 * z_height;
break; break;
} }
default: default:
ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold, ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelveticaBold,
text_size, &z_width, &z_height, text_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size)); ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size));
}
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62; float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62;
z_height *= k; z_height *= k;
size = 8.0 + 6.0/3*idx;
}
if ( line_cnt > 0) if ( line_cnt > 0)
y_offs += z_height; y_offs += z_height;
else else
y_offs += z_height/3; y_offs += z_height/3;
size = 8.0 + 6.0/3*idx;
ctx->current_print->text( z_x, z_y + y_offs, &line[3], ctx->current_print->text( z_x, z_y + y_offs, &line[3],
len-3, flow_eDrawType_TextHelveticaBold, size, line_cnt); len-3, flow_eDrawType_TextHelveticaBold, size, line_cnt);
...@@ -253,9 +257,9 @@ void FlowAnnot::print( void *pos, void *node, int highlight) ...@@ -253,9 +257,9 @@ void FlowAnnot::print( void *pos, void *node, int highlight)
switch ( ctx->current_print->type()) { switch ( ctx->current_print->type()) {
case print_eType_Pdf: { case print_eType_Pdf: {
ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelvetica, text_size, &z_width, &z_height, ctx->fdraw->get_text_extent( ctx, "Ag", 2, flow_eDrawType_TextHelvetica, text_size, &z_width, &z_height,
ctx->print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size)); print_zoom_factor / ctx->base_zoom_factor * (12+2*text_size));
float k = - 2.5 * ctx->print_zoom_factor / ctx->base_zoom_factor + 2.62; float k = - 2.5 * print_zoom_factor / ctx->base_zoom_factor + 2.62;
z_height *= k; z_height *= k * ctx->print_zoom_factor / print_zoom_factor;
break; break;
} }
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment