Added the capability to read a value from a WIDTH entry for text.

Still not sure how it is supposed to be used, exactly.  Used it
to set a default text size in case a MAG value is missing.
This commit is contained in:
Tim Edwards 2019-07-16 11:45:10 -04:00
parent feac3d94dd
commit 70927709c7
1 changed files with 15 additions and 1 deletions

View File

@ -774,7 +774,21 @@ calmaElementText()
/* NOTE: Record may contain both PRESENTATION and WIDTH */
PEEKRH(nbytes, rtype);
if (nbytes > 0 && rtype != CALMA_STRANS)
if (nbytes > 0 && rtype == CALMA_WIDTH)
{
/* Use WIDTH value to set the font size */
if (!calmaReadI4Record(CALMA_WIDTH, &size))
{
calmaReadError("Error in reading WIDTH in calmaElementText()\n") ;
return;
}
size *= calmaReadScale1;
if (size % calmaReadScale2 != 0)
calmaReadError("Text width snapped to nearest integer boundary.\n");
size /= calmaReadScale2;
}
else if (nbytes > 0 && rtype != CALMA_STRANS)
calmaSkipSet(ignore);
READRH(nbytes, rtype);