We have successfully downloaded and installed Google Open Sans fonts (from the URL: https://fonts.google.com/specimen/Open%20Sans#:~:text=Open%20Sans%20is%20a%20humanist%20sans%20serif) to a Linux Ubuntu-based Docker container using the following Dockerfile script to install the dependencies and the fonts:
RUN apt-get update && apt-get install -y libfreetype6 libfontconfig1 fontconfig unzip #Google Fonts RUN mkdir -p /usr/share/fonts/truetype/googlefonts && cd /usr/share/fonts/truetype/googlefonts COPY ["Open_Sans.zip", "/usr/share/fonts/truetype/googlefonts"] RUN unzip -d /usr/share/fonts/truetype/googlefonts /usr/share/fonts/truetype/googlefonts/Open_Sans.zip RUN rm -f Open_Sans.zip RUN ls -al /usr/share/fonts/truetype/googlefonts RUN fc-cache -fv RUN fc-match OpenSans
Open_Sans.zip file should be in the solution folder when running the Docker from Visual Studio.
The fonts are displayed as expected when previewing in the browser. When exporting to PDF though, the Reporting engine throws the following exception when Open Sans font is used:
CSharp.Net8.Html5IntegrationDemo Error: 0 : System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeCollectionHeader.Read(FontReader fontReader)
at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeCollectionHeaderVersion2.Read(FontReader fontReader)
at Telerik.Reporting.Pdf.Fonts.TrueType.FontCollectionProgram.Decompile()
at Telerik.Reporting.Pdf.Fonts.TrueType.FontCollectionProgram.EnsureFonts()
at Telerik.Reporting.Pdf.Fonts.TrueType.FontCollectionProgram.get_Fonts()
at Telerik.Reporting.Pdf.Fonts.TrueType.FontCollectionProgram.SelectFontProgram(String fontName, String fontFamily, Boolean bold, Boolean italic, Boolean underline, Boolean strikeout)
at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeDescriptor..ctor(IFont engineFont)
at Telerik.Reporting.Pdf.Fonts.TrueType.TrueTypeDescriptor..ctor(PdfFont font)
at Telerik.Reporting.Pdf.PdfFontTable.GetDescriptor(PdfFont font)
at Telerik.Reporting.Pdf.PdfFontDictionary..ctor(PdfDocument document, PdfFont drawingFont)
at Telerik.Reporting.Pdf.PdfFontType0Dictionary..ctor(PdfDocument document, PdfFont font)
at Telerik.Reporting.Pdf.PdfFontTable.GetFont(PdfFont font)
at Telerik.Reporting.Pdf.PdfPageDictionary.GetFontName(PdfFont font, PdfFontDictionary& fontDictionary)
at Telerik.Reporting.Pdf.Rendering.PdfRenderer.GetFontName(PdfFont font, PdfFontDictionary& fontDictionary)
at Telerik.Reporting.Pdf.Rendering.PdfRendererGraphicsState.Update(PdfFont font, IBrush brush, Int32 renderMode)
at Telerik.Reporting.Pdf.Rendering.PdfRenderer.Update(PdfFont pdfFont, IBrush brush, Int32 renderMode)
at Telerik.Reporting.Pdf.Rendering.PdfRenderer.DrawString(String text, PdfFont pdfFont, IBrush brush, RectangleF rect, Boolean rightToLeft)
at Telerik.Reporting.Pdf.Drawing.PdfGraphics.DrawString(String s, IFont font, IBrush brush, RectangleF rect, StringFormatBase format)
at Telerik.Reporting.ImageRendering.CanvasPdf.DrawRegularChunk(String text, StringChunkContext context)
at Telerik.Reporting.ImageRendering.CanvasBase.DrawStringChunk(String s, StringChunkContext context)
at Telerik.Reporting.ImageRendering.CanvasBase.DrawStringMultiline(String s, StringChunkContext context, Boolean isFinalTextChunk)
at Telerik.Reporting.ImageRendering.DocumentBase.WriteText(String text, RectangleF bounds, IFont font, Color foreground, TextFormat format, MatrixBase transform, Boolean isFinalTextChunk)
at Telerik.Reporting.Writing.TextBoxWriter.WriteContent(DocumentWriter writer, TextBox textBox, ElementPageInfo pageInfo)
at Telerik.Reporting.Writing.ProcessingContentElementWriter`1.WriteElement(T element, ElementPageInfo pageInfo, DocumentWriter writer)
at Telerik.Reporting.Writing.ProcessingElementWriter`1.Write(T element, ElementPageInfo pageInfo, DocumentWriter writer)
at Telerik.Reporting.Writing.ElementWriter`1.Telerik.Reporting.Writing.IElementWriter.StartWrite(LayoutElement element, ElementPageInfo pageInfo, DocumentWriter writer)
at Telerik.Reporting.Writing.WriteStartOperationsDispatcher.Write(IElementWriter writer, LayoutElement element, ElementPageInfo pageInfo, DocumentWriter documentWriter)
at Telerik.Reporting.Writing.WriteOperationsDispatcher.Write(IElementWriter writer, LayoutElement element)
at Telerik.Reporting.Writing.WriteOperationsDispatcher.Visit(TextBox textBox)
at Telerik.Reporting.Processing.TextBox.Accept(ProcessingElementVisitor visitor)
at Telerik.Reporting.Processing.ProcessingElementVisitor.Visit(LayoutElement element)
at Telerik.Reporting.Writing.WriteOperationsDispatcher.DispatchWriteOperation(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.Writing.DocumentWriter.Telerik.Reporting.BaseRendering.IWriter.WriteStartElement(LayoutElement element, ElementPageInfo pageInfo)
at Telerik.Reporting.BaseRendering.PageHandler.Telerik.Reporting.Paging.IPageHandler.StartElement(LayoutElement element, ElementPageInfo info)
at Telerik.Reporting.Paging.PageStartElement.OutputToPage(IPageHandler handler)
at Telerik.Reporting.Paging.PageElementsLayer.OutputToPage(IPageHandler handler)
at Telerik.Reporting.Paging.PageContent.Output(IPageHandler handler)
at Telerik.Reporting.Paging.PageCompositionBase.OutputPageContent(Stopwatch stopwatchOutputContent, PageContent pageContent)
at Telerik.Reporting.Paging.PageCompositionBase.<>c__DisplayClass124_0.<CreatePageContentOutputTask>b__0()
CSharp.Net8.Html5IntegrationDemo Error: 0 : An error has occurred while rendering the report: System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.InternalWaitCore(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(CancellationToken cancellationToken)
at Telerik.Reporting.Paging.PageCompositionBase.SeparateThreadOutputBehavior.Finish()
at Telerik.Reporting.Paging.PageCompositionBase.CreatePages()
at Telerik.Reporting.Paging.PagerBase.Telerik.Reporting.Paging.IPager.CreatePages(IPageHandler handler, LayoutElement root)
at Telerik.Reporting.BaseRendering.RenderingExtensionBase.Render(LayoutElement root, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback, PageSettings pageSettings)
The same report with the same fonts is rendered successfully on Windows with the Standalone Report Designer for .NET 8 with both GDI and Skia graphics engines.