[poppler] Re: [Patch] Info about document fonts

Leonard Rosenthol leonardr at pdfsages.com
Sat Jun 4 19:12:50 PDT 2005


At 01:04 PM 6/4/2005, Marco Pesenti Gritti wrote:
>Slightly updated patch, I implemented evince font properties page with this.

Here is a fragment from one of my Xpdf-based projects for getting font 
info, that does a more intelligent retrieval of the font's name.

The two things of note are that it removes the subset prefix, so that user 
can see the original font name in the output and that it uses the 
UnicodeMap to properly decode the name to Unicode (in my case, UTF-8).  It 
is possible (though unusual) for font names in CJK...


// font name - do it here after subset check...
if ( name ) {
         if ( subset ) {
                 // fontNode->attr( "name", std::string( 
name->getCString()+7 ) );
                 GString *subsetName = new GString( name->getCString()+7 );
                 String2XML( subsetName, std::string( "name" ), false, 
fontNode, uMap );
                 delete subsetName;
         } else {
                 // fontNode->attr( "name", std::string( name->getCString() 
) );
                 String2XML( name, std::string( "name" ), false, fontNode, 
uMap );
         }
} else
         fontNode->attr( "name", std::string( "unknown" ) );



Leonard

---------------------------------------------------------------------------
Leonard Rosenthol                            <mailto:leonardr at pdfsages.com>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-938-7080 (voice)
                                              215-938-0880 (fax)




More information about the poppler mailing list