If the Printable Text - X Location is set for an annotation Type and text is entered in the annotation between square brackets, the text will be displayed next to the step with the annotation. This is limited since there mat not be much space next to the step. The location is in points (1/72 of an inch, 36=> 1/2 inch, 18=> 1/4 inch). Also Up and Down arrows can be included in this text, by typing {Up} and {Down} within the square brackets.

This commit is contained in:
Rich 2016-09-26 21:11:28 +00:00
parent 645dd85bf7
commit 234682420f

View File

@ -3763,7 +3763,12 @@ namespace Volian.Print.Library
if (XOffsetCenter != null) XOffset = (float)XOffsetCenter;
ProfileTimer.Pop(profileDepth);
}
private static VE_Font _AnnotationFont;
public static VE_Font AnnotationFont
{
get { return vlnParagraph._AnnotationFont; }
set { vlnParagraph._AnnotationFont = value; }
}
private void DoAnnotationPrintableText(PdfContentByte cb, ItemInfo itemInfo, float yoff)
{
// if this step has an Annotation and it has config data to define location, parse out '[xx]' and print it at the location
@ -3782,9 +3787,13 @@ namespace Volian.Print.Library
int end = ai.SearchText.IndexOf("]");
if (st != -1 && end != -1 && end > st)
{
string pref = ai.SearchText.Substring(st, end - st + 1); // annotation - parse out [xx]
string pref = ai.SearchText.Substring(st+1, end - st - 1); // annotation - parse out [xx]
pref = Regex.Replace(pref,"{Up}",@"\u8593?", RegexOptions.IgnoreCase);
pref = Regex.Replace(pref,"{Down}",@"\u8595?", RegexOptions.IgnoreCase);
float xPref = atc.PrintableText_XLocation;
PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, _MyItemInfo.FormatStepData.Font));
if(AnnotationFont==null)
AnnotationFont = new VE_Font(_MyItemInfo.FormatStepData.Font.Family,6,(E_Style)_MyItemInfo.FormatStepData.Font.Style,20F);
PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, AnnotationFont));
break;
}
}
@ -5348,12 +5357,12 @@ namespace Volian.Print.Library
}
if (!itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB")) // Don't do the following if in a vcb format (part of fix F2016-039)
{
if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0)
CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment
else if (!FmtHasAdj && HasCheckOffHeading(itemInfo, formatInfo))
// For Robinson, tried using font's CharsToTwips but it made it too narrow, so used hardcoded 6:
CheckOffAdj = -((float)9 * 6);
}
if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0)
CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment
else if (!FmtHasAdj && HasCheckOffHeading(itemInfo, formatInfo))
// For Robinson, tried using font's CharsToTwips but it made it too narrow, so used hardcoded 6:
CheckOffAdj = -((float)9 * 6);
}
}
float adjwidth = CheckOffAdj;
CheckOffWidth = -CheckOffAdj;
@ -5479,7 +5488,7 @@ namespace Volian.Print.Library
{
// don't adjust the width if there already was an adjustment for checkoffs - for VCB only (F2016-039)
if (!(itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB") && coadj))
adjwidth = MyTab != null ? -MyTab.Width : 0;
adjwidth = MyTab != null ? -MyTab.Width : 0;
}
else if (sd.UseMetaSections)
{