Hi!
document.CreateFontSubset("GulimChe", true, true, pdfe,
"C:\\Windows\\Fonts\\GulimChe1.ttf") creates 'not-precise' subset.
It just pulls every symbol from choosen encoding to document
(0...255 symbols in your case).
Try document.GetFont("GulimChe", true, true, true,
PdfFontFactory::eFontCreationFlags_Subsetting, pdfe,
"path-to-font" ) instead to create precise-subsetting font.
BTW your example should work and should create the document with
embedded font with just 255 symbols. Don't sure why it doesn't
embed the specified symbols to document. Try to debug the
non-patched podofo version if this approach sufficient for you.
PS. If you preciselly know the range of the symbols which will be
in the document up the front, and the number of symbols isn't big
(e.g. just 255 first symbols from the font as in your example),
than you will not get much of space savings from
precise-subsetting using. Precise subsetting will work better if
you don't know what symbols will be in document and if your font
of choise is pretty big. For example in my case I didn't know the
symbols and had 15 MegaBytes unicode font. I was able to create
~200KB files with precise subsetting.
Regards,
cybevnm
4/25/2013 5:00 PM, Malcolm Gates пишет:
Attached is a 7z containing the files used to
create the PDF documents. There are two PDF documents. The
correct one is generated without using the new 'precise'
subsetting code. The incorrect one is generated using the new
'precise' subsetting code.
No changes were made to the podofo code itself, apart from
applying the PdfFontFactory
refactoring and PdfFontSubsettedCID patches.
Date: Wed, 24 Apr 2013 22:16:35 +0300
From: cybe...@gmail.com
To: malcolmga...@hotmail.com
CC: podofo-us...@lists.sf.net
Subject: Re: [Podofo-users] Embedding partial font
Hi!
Can you show me the code, which you used to create the font
?
Regards,
cybevnm
On 04/24/2013 09:01 PM, Malcolm Gates wrote:
I applied the PdfFontFactory
refactoring and PdfFontSubsettedCID patches. After
running, the subsetted font is referenced but is not
embedded (missing) in the resulting PDF document.
Are there any specific instructions/steps to get the
'precise' subsetted font into the PDF document?
Date: Sat, 20 Apr 2013 22:05:21
+0300
From: cybe...@gmail.com
To: malcolmga...@hotmail.com
CC: podofo-us...@lists.sf.net
Subject: Re: [Podofo-users] Embedding partial font
Hi!
You can control what characters will be embedded in a
document using PdfFontTTFSubset API, but you should
know the characters set in advance.
AFAIK 'precise' subsetting can't be done with current
podofo API, but I've posted patch for doing that to
this mailing list recently (you can find it in March
posts). I didn't received any feedback on it, but
maybe you'll find it usefull (as whole or as source
for ideas). Don't sure if I did the job right, but the
patch worked pretty well for me.
Little copy-paste from patch:
/**
* CID font which performs "precise" subsetting, i.e.
only actually used in the
* document characters embedded.
*/
class PdfFontSubsettedCID : public PdfFontCID { ... }
Regards,
cybevnm
On 04/19/2013 09:40 PM, Malcolm Gates wrote:
Hello,
Using the
podofo library, how does one unmap glyphs for
characters that are not present in the final PDF
document?
Thanks,
Malcolm Gates
Hello,
I know about embedding a
TTF font in a PDF.
Is there a method to
embed only that portion of the font for the
characters present in the PDF? For example, a
PDF document comprising the text “Hello,
world.” would have the font subset including
only those letters, the space, the comma and
the period.
Doing so should reduce
the size of the resulting PDF. Is that
correct?
Many thanks,
Malcolm Gates
Professional Services
Contractor
NCR Corporation
Telephone: 770.623.7330

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users
|