freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] FW: Getting the charcode Value when the Glyph ID is known


From: Balraj Balakrishnan, Integra-PDY, IN
Subject: Re: [ft] FW: Getting the charcode Value when the Glyph ID is known
Date: Mon, 2 May 2011 09:19:37 +0000

Dear Suzuki,

 

As am new to freetype and all these font stuffs, I couldn’t rather frame my requirement in a right manner. I shall be making an another attempt to bring about much more clarity in what I really want from freetype:

 

1.  The scenario here is, we are trying to convert the source PDF into an HTML, while doing this there are many fonts in the PDF which are extracted or mapped to a wrong character. So we are extracting the font files from the PDF, to convert glyph's (Symbols, Unicode) in the font file as an image and replace the wrongly extracted characters/Symbols/Unicode in the HTML file with the image.

 

In the above mentioned scenario the image should maintain its position in the outline in order place it in an HTML file. If you look at the image below the fonts Quote right and the Comma is differentiated based on its position in a given line.

 

cid:image001.png@01CC08C0.4D7E5610

So what I am trying to achieve is to extract an image with its rectangular boundary intact, it shouldn’t be cropped for white spaces as shown below:

cid:image003.png@01CC08C3.116D1C30   cid:image004.png@01CC08C3.116D1C30

            

 

 

2.  >Can you help me with other alternatives which are there to iterate all the glyphs present in the font file irrespective of the cmap table.

 

You can get the maximum glyph index from FT_Face->num_glyphs.

Scanning like

 

                for ( gid = 0; gid < face->num_glyphs; gid ++ )

                {

How to get the character code for a particular gid if available?

                }

 

 

 

 

Be Well,

 

Amith Sai

 

 

-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: 30 April 2011 01:00
To: Balraj Balakrishnan, Integra-PDY, IN
Cc: address@hidden; address@hidden
Subject: Re: [ft] FW: Getting the charcode Value when the Glyph ID is known

 

On Fri, 29 Apr 2011 12:01:54 +0000

"Balraj Balakrishnan, Integra-PDY, IN"

<address@hidden> wrote:

>How can I achieve the glyph image with its proper positioning, in order

>to tackle this scenario?

 

Sorry, I could not understand it from your message, what is

your scenario? You want to do something like OCR?

 

>Can you help me with other alternatives which are there to iterate all

>the glyphs present in the font file irrespective of the cmap table.

 

You can get the maximum glyph index from FT_Face->num_glyphs.

Scanning like

 

      for ( gid = 0; gid < face->num_glyphs; gid ++ )

      {

            /* blah blah blah */

      }

 

is very popular in various softwares using FT2.

 

Regards,

mpsuzuki


reply via email to

[Prev in Thread] Current Thread [Next in Thread]