Nicomsoft OCR: Developer's Guide


Blk_GetWordFontSize


Syntax

C++:int Blk_GetWordFontSize(HBLK BlkObj, int LineIndex, int WordIndex)
C#:int Blk_GetWordFontSize(int BlkObj, int LineIndex, int WordIndex)
Visual Basic:Function Blk_GetWordFontSize(ByVal BlkObj As Integer, ByVal LineIndex As Integer, ByVal WordIndex As Integer) As Integer
Java:int Blk_GetWordFontSize(HBLK BlkObj, int LineIndex, int WordIndex)
Delphi:function Blk_GetWordFontSize(BlkObj:HBLK; LineIndex:integer; WordIndex:integer):integer


Description

Retrieves the text font size for the specified word or line, or for the entire block after performing OCR with the Img_OCR function. Use the Blk_GetLineCnt function to get the total number of text lines in the block. Use the Blk_GetWordCnt function to get the total number of words in the specified line.


Parameters

BlkObj [IN] – the Block object. You can also specify the Image object if you want to work with the global list of text lines for the entire image.
LineIndex [IN] – the index of the text line to retrieve. 0 – the first line; -1 – the entire block.
WordIndex [IN] – the index of the word in the specified text line to retrieve. 0 – the first word; -1 – the entire line.


Return value

If success, the text size in pixels multiplied by 1000; if the size cannot be calculated, zero; otherwise, an error code. For example, if the detected text size is 24.5 pixels, the function will return 24500. The size is calculated for the final image. Use the Img_GetScaleFactor function to calculate the size for the input image. If the word contains only special characters like "," or ".", the function may return 0, because the text size cannot be calculated properly.


Remarks

The OCRSTEP_OCR step must be executed before calling this function.


Example

See the sample code for the Img_GetBlockCnt function.