개정판 6282063e
issue #937: 텍스트가 엔터로 시작될때 잘리는 현상 수정
Change-Id: I4a98cd40896e4adfc57cad865f980b2dfc2018df
FinalService/KCOM_FinalService/MarkupToPDF/Controls_PDF/HoneyPDFLib_DrawSet_DrawString.cs | ||
---|---|---|
21 | 21 |
/// <param name="rect"></param> |
22 | 22 |
/// <param name="text"></param> |
23 | 23 |
/// <returns></returns> |
24 |
private static iTextSharp.text.Font CreateFont(FontStyle fontstyle, FontWeight fontweight, TextDecorationCollection isUnderline, Rectangle rect, string text) |
|
24 |
private static iTextSharp.text.Font CreateFont(FontFamily fontFamilly, FontStyle fontstyle, FontWeight fontweight, TextDecorationCollection isUnderline, Rectangle rect, string text)
|
|
25 | 25 |
{ |
26 |
string ARIALUNI_TFF = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "Arial Unicode MS.TTF"); |
|
26 |
///int iFonts = FontFactory.RegisterDirectory(Environment.GetFolderPath(Environment.SpecialFolder.Fonts)); |
|
27 |
string sFontPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "Arial Unicode MS.TTF"); |
|
28 |
|
|
29 |
//bool bTextIsAscii = !text.Any(c => !Char.IsLetterOrDigit(c)); /// text가 ascii인지 확인 |
|
30 |
//if (bTextIsAscii) |
|
31 |
//{ |
|
32 |
// sFontPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Fonts), "TIMES.TTF"); |
|
33 |
//} |
|
27 | 34 |
|
28 | 35 |
double dFontSize = double.MaxValue; |
29 |
BaseFont bf = BaseFont.CreateFont(ARIALUNI_TFF, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
|
|
36 |
BaseFont bf = BaseFont.CreateFont(sFontPath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
|
|
30 | 37 |
string[] tokens = text.Split(Environment.NewLine.ToArray(), StringSplitOptions.RemoveEmptyEntries); |
31 | 38 |
foreach (var token in tokens) |
32 | 39 |
{ |
... | ... | |
144 | 151 |
HoneyPDFLib_DrawSet_Text.PaintFill(contentByte, PaintStyle, bs); |
145 | 152 |
} |
146 | 153 |
|
147 |
iTextSharp.text.Font itextFont = HoneyPDFLib_DrawSet_Text.CreateFont(fontstyle, fontweight, isUnderline, calRect, text); |
|
154 |
iTextSharp.text.Font itextFont = HoneyPDFLib_DrawSet_Text.CreateFont(fontFamilly, fontstyle, fontweight, isUnderline, calRect, text);
|
|
148 | 155 |
|
149 | 156 |
contentByte.SetColorStroke(bs); |
150 | 157 |
contentByte.SetColorFill(bs); |
151 | 158 |
|
152 |
if (Char.IsWhiteSpace(text, 0)) |
|
153 |
{ |
|
154 |
text = text.Remove(0, 1); |
|
155 |
} |
|
156 |
|
|
157 | 159 |
string[] tokens = text.Split(new[] { Environment.NewLine }, StringSplitOptions.None); |
158 | 160 |
/// single line text |
159 | 161 |
if (tokens.Length == 1) |
FinalService/KCOM_FinalService/MarkupToPDF/MarkupToPDF.cs | ||
---|---|---|
926 | 926 |
//인구 수정 Arrow Text Style적용 되도록 변경 |
927 | 927 |
Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
928 | 928 |
newStartPoint, tempMidPoint, |
929 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, new FontFamily(), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
929 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, new FontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
|
|
930 | 930 |
} |
931 | 931 |
else |
932 | 932 |
{ |
... | ... | |
956 | 956 |
Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
957 | 957 |
tempStartPoint, testP, |
958 | 958 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, |
959 |
new FontFamily(), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
959 |
new FontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
|
|
960 | 960 |
} |
961 | 961 |
else |
962 | 962 |
{ |
963 | 963 |
//인구 수정 Arrow Text Style적용 되도록 변경 |
964 | 964 |
Controls_PDF.HoneyPDFLib_DrawSet_Text.DrawString_ArrowText(tempEndPoint, new Point(tempEndPoint.X + control.BoxWidth / scaleWidth, tempEndPoint.Y - control.BoxHeight / scaleHeight), |
965 | 965 |
newStartPoint, newMidPoint, |
966 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, new FontFamily(), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle); |
|
966 |
LineSize, contentByte, _SetColor, Paint, fontsize, isHighlight, new FontFamily(control.fontConfig[0]), fontStyle, fontWeight, decoration, Text, sizeF, Opacity, Angle);
|
|
967 | 967 |
} |
968 | 968 |
} |
969 | 969 |
} |
내보내기 Unified diff