Hi all, I have an issue in PDFDocument where the Avenir and AvenirHeavy fonts are rendered incorrectly. A customer reported that Acrobat Reader for Windows reports that “The font ‘AvenirHeavy’ contains a bad /BBox.”
The attached screenshot shows how it is rendered on macOS.
This is the code used to generate the PDF:
var pdf As new PDFDocument(600, 800)
var g As Graphics = pdf.Graphics
g.FontName = "Avenir"
g.FontSize = 20
g.DrawText("Avenir", 10, 50)
var file As FolderItem = SpecialFolder.Desktop.Child("PDF_BadBBox.pdf")
Try
pdf.Save(file)
file.Open
Catch e As IOException
MessageBox(e.Message)
End Try
Adding pdf.EmbeddedFonts = True does not help, it only changes the position of the capital letter A.
Is it an issue in my code, in Xojo, and do you know of any workaround?
Edit: using Xojo 2024.4.2 on macOS 14.7.1
18 posts - 7 participants