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.

Roger

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)

Roger

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: https://documentation.xojo.com/api/graphics/graphics.html#graphics-font

Thank you!