PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Fonts not resolved on Docker and alphine linux
https://forum.pdfsharp.net/viewtopic.php?f=2&t=4530
Page 1 of 1

Author:  dssmith [ Thu Jan 04, 2024 3:58 pm ]
Post subject:  Fonts not resolved on Docker and alphine linux

We are using PDFSharp 6.1.0-preview-1 on Docker with alphine linux when we create our PDF we use this code to create a font that will be used to write the page number on the page:

Code:
font = new XFont("Arial", fontSize, XFontStyleEx.Regular, embeddedFontOptions)


we also use this code for the resolver:

Code:
GlobalFontSettings.FontResolver = new FailsafeFontResolver();


We have Arial on the linux docker container, and was previously working untill the upgrade to PDFSharp 6.0 and PDFSharp 6.1.0-preview-1...

I can see this in the container terminal:

2024-01-04 16:51:19 info: PdfSharp.Snippets.Font.FailsafeFontResolver[0]
2024-01-04 16:51:19 'Arial' was substituted by a SegoeWP font.
2024-01-04 16:51:19 info: PdfSharp.Snippets.Font.FailsafeFontResolver[0]
2024-01-04 16:51:19 Get font for 'SegoeWP'.

But when I open the PDF in ADOBE viewer it seems the font is not embedded and is replaced incorrectly..

When running this on windows on my local machine it works, and the font Arial is found

See ADOBE dialog and font issue screenshots...

Please advise.

Attachments:
Screenshot 2024-01-04 175434.zip [18.01 KiB]
Downloaded 557 times

Author:  TH-Soft [ Mon Jan 08, 2024 9:12 am ]
Post subject:  Re: Fonts not resolved on Docker and alphine linux

dssmith wrote:
We have Arial on the linux docker container, and was previously working untill the upgrade to PDFSharp 6.0 and PDFSharp 6.1.0-preview-1...
And which older versions were working?

FailsafeFontResolver is not useful if you want to use Arial under Linux.
Better implement your own font resolver that uses the correct fonts.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/