Skip to content

Commit 595859f

Browse files
Fix HTML PDF rendering using random font from Hashtable iteration (#1260)
(cherry picked from commit 792897c)
1 parent 6cd78ad commit 595859f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

dotnet/src/dotnetframework/GxPdfReportsCS/PDFReportItext4.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,14 +803,14 @@ public override void GxDrawText(String sTxt, int left, int top, int right, int b
803803
if (!string.IsNullOrEmpty(fontPath))
804804
{
805805
FontFactory.Register(fontPath, fontName);
806-
styles.LoadTagStyle("body", "face", fontName);
807-
808-
if (IsEmbeddedFont(fontName))
809-
styles.LoadTagStyle("body", "encoding", BaseFont.IDENTITY_H);
810-
else
811-
styles.LoadTagStyle("body", "encoding", BaseFont.WINANSI);
812806
}
813807
}
808+
string defaultFontName = baseFont.PostscriptFontName;
809+
styles.LoadTagStyle("body", "face", defaultFontName);
810+
if (IsEmbeddedFont(defaultFontName))
811+
styles.LoadTagStyle("body", "encoding", BaseFont.IDENTITY_H);
812+
else
813+
styles.LoadTagStyle("body", "encoding", BaseFont.WINANSI);
814814
}
815815

816816
//Bottom and top are the absolutes, regardless of the actual height at which the letters are written.

0 commit comments

Comments
 (0)