Quantcast

Embedding a font subset

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Embedding a font subset

Jason Berk
I've read the font chapters in the book twice and I'm now twice as
confused.

I'm producing statements for a credit union and we need to print some
routing numbers in OCR font.  Only numbers can appear in a routing
number, so I only need to embed 0 - 9.

Are only the glyphs that get used being embedded, or are a-z also
embedded?  If so, how do you specify only a subset (0-9) should be
embedded?

Code is as follows:

//embed the OCR font
BaseFont ocrBaseFont =
        BaseFont.createFont("C:/WINDOWS/Fonts/OCRAEXT.TTF",
BaseFont.CP1252, BaseFont.EMBEDDED);

//print the routing / micr number
cb.beginText();
cb.moveText(300, 18);
cb.setFontAndSize(ocrBaseFont, 9);
cb.moveTextWithLeading(0, -12);
cb.showText("0000000000000 99 00002000  00007777   042509");
cb.endText();


Thanks,

Jason
The PEN is now mightier than the PIN. Simply use your PEN
instead of your PIN and sign for your PEFCU Visa Check Card
purchases. Earn bonus points redeemable for gift and travel
awards. Combine PEFCU Visa check card and credit card points
for even more rewards.


***This is a transmission from Purdue Employees Federal Credit
Union (PEFCU) and is intended solely for its authorized
recipient(s), and may contain information that is confidential
and or legally privileged.  If you are not an addressee, or the
employee or agent responsible for delivering it to an addressee,
you are hereby notified that any use, dissemination,
distribution, publication or copying of the information
contained
in this email is strictly prohibited. If you have received this
transmission in error, please notify us by telephoning (765)
497-3328 or returning the email. You are then instructed to
delete the information from your computer.  Thank you for your
cooperation.***


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Embedding a font subset

iText mailing list
Jason Berk wrote:
> I've read the font chapters in the book twice and I'm now twice as
> confused.

Compare figure 8.5 with for instance figures 8.7 and 8.11.

Figure 8.5 tells you the fonts are (Embedded); the other two say there's
an (Embedded subset). As explained in the book, some fonts are ALWAYS
embedded (for instance when you use a pfb file), some are NEVER embedded
(for instance CJK fonts, or when you only use an afm file), some are
AUTOMATICALLY subset (for instance TTF, OTF and TTC).

You're talking about a TTF file, so if you open the Document >
Properties > Font box, you should see (Embedded subset) which means only
the glyphs that are used are embedded.

In other words: you can easily check for yourself what iText does with
any specific font you're using.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Embedding a font subset

JonyGreen
This post has NOT been accepted by the mailing list yet.
In reply to this post by Jason Berk
I find another free online ocr to convert image to text, it supports 40+ languages, and can save converted text to editable txt file and searchable pdf document.
Loading...