L_LTOCR_API L_INT EXT_FUNCTION L_OcrDocumentManager_SetFontName(documentManager, language, documentFontType, value)
|L_OcrDocumentManager documentManager;||handle to the OCR engine document manager|
|L_OcrLanguage language;||language ID|
|L_OcrDocumentFontType documentFontType;||the type of font to replace|
|const L_TCHAR* value;||the font name that will be used in final document|
Replaces the specific type of font used in the final document.
|documentManager||Handle to the OCR engine document manager.|
|documentFontType||The type of font to replace.|
|value||The font name that will be used in final document.|
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
Use L_OcrDocumentManager_GetFontName and L_OcrDocumentManager_SetFontName to get/set the fonts used in the final recognized document (PDF, DOC, HTML, etc). The fonts will not be used when the final document format is text.
The OCR engine uses six different fonts when creating the final output document. For more information, refer to L_OcrDocumentFontType.
The L_OcrCharacter.FontStyles member of each character returned in L_OcrPage_GetRecognizedCharacters determines which font to use with the character. If the zone is MICR (the L_OcrZone.ZoneType member is L_OcrZoneType.MICR) then the character will use the MICR fonts accordingly.
The OCR engine keeps a list of fonts for some languages, for example all the Latin languages currently use the same font. So passing language equals to L_OcrLanguage_EN for English or L_OcrLanguage_DE for German will change the default Latin fonts used in the final document.
If the OCR engine has Asian languages enabled, then each language will have its own font sets and you can get/set these fonts individually. Currently, the LEADTOOLS OCR toolkits supports individual fonts for Latin, Japanese, Korean and Chinese (zh-Hans and zh-Hant). The following table lists the default fonts used for each language:
|Latin (all other languages) including language equals to L_OcrLanguage_None||
|Japanese (language equals to L_OcrLanguage_JA)||
|Chinese (language equals to L_OcrLanguage_ZH_HANS or L_OcrLanguage_ZH_HANT)||
|Korean (language equals to L_OcrLanguage_KO)||
Note that changing the fonts is not recommended in most cases, the character position and size is calculated based on the default fonts even if the user changes the fonts before the recognition process. After the changing the fonts, it might be required to use L_OcrPage_GetRecognizedCharacters and L_OcrPage_SetRecognizedCharacters to further change the character position and font size to create the final output document.
Required DLLs and Libraries
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
|Functions:||L_OcrDocumentManager_CreateDocument, L_OcrDocumentManager_AppendDocumentFiles, L_OcrDocumentManager_AppendDocuments, L_OcrDocumentManager_GetFormatOptions, L_OcrDocumentManager_SetFormatOptions, L_OcrDocumentManager_GetFontName|
|Topics:||Programming with LEADTOOLS OCR Advantage|
|Starting and Shutting Down the OCR Engine|
|Recognizing OCR Pages|
For an example, refer to L_OcrDocumentManager_GetFontName.