Replaces the specific type of font used in the final document.
Handle to the OCR engine document manager.
The type of font to replace.
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
|Proportional Serif||Times New Roman|
|Monospace Serif||Courier New|
|Monospace Sans-Serif||Courier New|
|ICR||Bookman Old Style|
|MICR||Arial Unicode MS|
Japanese (language equals to
|Proportional Serif||MS PMincho|
|Proportional Sans-Serif||MS PGothic|
|Monospace Serif||MS Gothic|
Chinese (language equals to
|Monospace Serif||Hei Simplified|
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.
For an example, refer to L_OcrDocumentManager_GetFontName