[reportlab-users] About Helvetica font

Enrique Comesaña Figueroa ecomesana at googlemail.com
Fri Oct 24 13:23:00 EDT 2008


Thanks Adam,

With Ghostscript I was able to remove the Helvetica from the document
if I do not use it. But if it is used in any part of the document it
continues appearing without being embedded.

I have used Ghostcript with these options, is that what did you mean?


>>> gs -q -sDEVICE=pdfwrite -dEmbedAllFonts=true -sOutputFile=out_temp.pdf temp.pdf


However, now it is working as I wanted, I do not need to have
Helvetica in my documents.

Many thanks
Enrique

2008/10/24 adam hyde <adam at flossmanuals.net>:

> hi,

>

> if you use Ghostscript after you have made the PDF it can force embed

> all fonts

>

>

> adam

>

> On Fri, 2008-10-24 at 16:32 +0200, Enrique Comesaña Figueroa wrote:

>> Hello,

>>

>> I am trying to generate a PDF document with embedded fonts. I have no

>> problem with other fonts but Helvetica. It always appear in the list

>> of fonts in the properties document even if i do not use it.

>> And if I try to embed it in a document which uses this font, reportlab

>> generates it but do not embed the Helvetica font.

>>

>> Can anyone help me?, If that is not possible, can anyone suggest me

>> any other way to generate pdf with ALL fonts embedded?

>>

>> This is my python code:

>>

>> from reportlab.pdfbase import pdfmetrics

>> from reportlab.pdfbase.ttfonts import TTFont

>> from reportlab.pdfgen.canvas import Canvas

>>

>> justFace = pdfmetrics.EmbeddedType1Face('./Helvetica.afm', './Helvetica.pfb')

>> pdfmetrics.registerTypeFace(justFace)

>> justFont = pdfmetrics.Font('Helvetica','Helvetica','WinAnsiEncoding')

>> pdfmetrics.registerFont(justFont)

>>

>> c = Canvas('temp.pdf')

>> c.setFont('Helvetica', 32)

>> c.drawString(10, 150, "Some text")

>> c.save()

>>

>>

>> I have have the files Helvetica.afm and Helvetica.pfd in the same

>> folder as the python script

>> And pdffonts command return me this properties of the PDF document:

>>

>> >>> pdffonts temp.pdf

>> name type emb sub uni object ID

>> ------------------------------------ ----------------- --- --- --- ---------

>> Helvetica Type 1 no no no 2 0

>>

>> Many thanks,

>> Enrique

>> _______________________________________________

>> reportlab-users mailing list

>> reportlab-users at reportlab.com

>> http://two.pairlist.net/mailman/listinfo/reportlab-users

> --

> Adam Hyde

> Founder FLOSS Manuals

> http://www.flossmanuals.net

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users

>



More information about the reportlab-users mailing list