EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Adding an t1a font to PDF

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#8697
Posted: 01/22/2009 14:31:02
by Sebastian Jaeschke (Priority Standard support level)
Joined: 12/15/2006
Posts: 11

Hello there,

I checked out the tinysigner example and tried around with the AddTrueTypeFont function. Following the suggestion from http://www.eldos.com/documentation/sbb/documentation/ref_howto_pdf_sign_unicode.html I want to include a subset to reduce the size of the resulting PDF.
All I found out is that it seems to be needed to assign the t1a file to FontFile instead of FontFile2 for ttfs. Everything else failed, I guess cause its not a ttf nor a CIDFontType2 subtype so the rest of the code of the sample function does not fit.

Do you have such a sample like AddTrueTypeFont to include t1a fonts? Or afm/pfa|b fonts? I'm completely lost here....

Many thanks in advance for your support as allways!!

best regards,
Sebastian
#8710
Posted: 01/23/2009 08:23:14
by Dmytro Bogatskyy (EldoS Corp.)

Quote
I want to include a subset to reduce the size of the resulting PDF

Simplest way is to exclude characters from TrueType font.
For example, using fontforge (it requires cygwin X11) you can remove unnecessary glyps, and so reduce ttf file.
Then you need to regenerate "ufm" file using "ttf2ufm" utility. I think it is a little bit easier then using Type1 fonts.

Quote
All I found out is that it seems to be needed to assign the t1a file to FontFile instead of FontFile2 for ttfs. Everything else failed, I guess cause its not a ttf nor a CIDFontType2 subtype so the rest of the code of the sample function does not fit.

Type 1 font could contain up to 256 glyphs, so you'll need to define font’s encoding (mapping from codes to glyphs). Also you'll need to re-encode standard properties of signature widget like SignerCaption.
.afm file contains font metrics, and .pfb contains a data that should be set to FontDescriptor.FontFile of SimpleFont.

Reply

Statistics

Topic viewed 1447 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!