How Do You Set Font in PDFDocument?

Var g As Graphics = pDocument.Graphics
g.Font. ???

Xojo Documentation example : aGraphics .FontName = newStringValue

does not work…

Thanks in Advance.


get error :
Type “Graphics” has no member named “FontName”
g.FontName = PDFDocument.StandardFontNames.Times

Hi @roger_holmes

There is no FontName under iOS.Graphics. Try this instead:

v = New Font("Helvetica-bold",35)
g.Font = v
g.DrawText("Apple Farm", 120, 70)

@Javier_Menendez, you should add these info to the docs.

Thank You Javier, the only change is :slight_smile:

Var v As Font
v = New Font(“Helvetica-bold”,35)
g.Font = v
g.DrawText(“Apple Farm”, 120, 70)


Oh, that is just existing Graphics behaviour between platforms. I mean, g.FontName / g.Font is not specific to PDF. In fact, you can find the Font property referenced at:

Thank you!