From 70927709c7c20d975c4521e0787f3cf741626ca2 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 16 Jul 2019 11:45:10 -0400 Subject: [PATCH] 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. --- calma/CalmaRdpt.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/calma/CalmaRdpt.c b/calma/CalmaRdpt.c index 60b6ffc4..9745e0d2 100644 --- a/calma/CalmaRdpt.c +++ b/calma/CalmaRdpt.c @@ -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);