Modified the GDS read routine to account for use of WIDTH in a text

record without a MAG in the PRESENTATION record to override it.
This commit is contained in:
Tim Edwards 2019-07-16 16:26:56 -04:00
parent 70927709c7
commit cd32e39d58
1 changed files with 15 additions and 8 deletions

View File

@ -725,7 +725,7 @@ calmaElementText()
angle = 0; angle = 0;
/* Default size is 1um */ /* Default size is 1um */
size = (int)((800 * cifCurReadStyle->crs_multiplier) size = (int)((1000 * cifCurReadStyle->crs_multiplier)
/ cifCurReadStyle->crs_scaleFactor); / cifCurReadStyle->crs_scaleFactor);
/* Default position is bottom-right (but what the spec calls "top-left"!) */ /* Default position is bottom-right (but what the spec calls "top-left"!) */
pos = GEO_SOUTHEAST; pos = GEO_SOUTHEAST;
@ -776,17 +776,23 @@ calmaElementText()
PEEKRH(nbytes, rtype); PEEKRH(nbytes, rtype);
if (nbytes > 0 && rtype == CALMA_WIDTH) if (nbytes > 0 && rtype == CALMA_WIDTH)
{ {
int width;
/* Use WIDTH value to set the font size */ /* Use WIDTH value to set the font size */
if (!calmaReadI4Record(CALMA_WIDTH, &size)) if (!calmaReadI4Record(CALMA_WIDTH, &width))
{ {
calmaReadError("Error in reading WIDTH in calmaElementText()\n") ; calmaReadError("Error in reading WIDTH in calmaElementText()\n") ;
return; return;
} }
size *= calmaReadScale1; width *= calmaReadScale1;
if (size % calmaReadScale2 != 0) if (width % calmaReadScale2 != 0)
calmaReadError("Text width snapped to nearest integer boundary.\n"); calmaReadError("Text width snapped to nearest integer boundary.\n");
size /= calmaReadScale2; width /= calmaReadScale2;
/* Convert to database units, because dimension goes to PutLabel */
/* and is not converted through CIFPaintCurrent(). */
size = CIFScaleCoord(width, COORD_ANY);
} }
else if (nbytes > 0 && rtype != CALMA_STRANS) else if (nbytes > 0 && rtype != CALMA_STRANS)
calmaSkipSet(ignore); calmaSkipSet(ignore);
@ -801,9 +807,10 @@ calmaElementText()
if (nbytes > 0 && rtype == CALMA_MAG) if (nbytes > 0 && rtype == CALMA_MAG)
{ {
calmaReadR8(&dval); calmaReadR8(&dval);
/* Assume that MAG is the label size in microns */ /* Assume that MAG is the label size in microns */
/* "size" is the label size in 8 * (database units) */ /* "size" is the label size in 10 * (database units) */
size = (int)((dval * 800 * cifCurReadStyle->crs_multiplier) size = (int)((dval * 1000 * cifCurReadStyle->crs_multiplier)
/ cifCurReadStyle->crs_scaleFactor); / cifCurReadStyle->crs_scaleFactor);
} }
else else