The GetFontNames Method is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.
- languageName
- The language name. See remarks for more information.
Visual Basic (Declaration) | |
---|---|
Function GetFontNames( _ ByVal languageName As String _ ) As String() |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As IOcrDocumentManager Dim languageName As String Dim value() As String value = instance.GetFontNames(languageName) |
C# | |
---|---|
string[] GetFontNames( string languageName ) |
C++/CLI | |
---|---|
array<String^>^ GetFontNames( String^ languageName ) |
Parameters
- languageName
- The language name. See remarks for more information.
Return Value
An array of six string values that contains the font names used in the final document.Use GetFontNames and SetFontNames 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 as follows. The following table shows the array index and the font description:
Index | Description |
---|---|
0 | The font used with proportional serif characters |
1 | The font used with proportional sans-serif characters |
2 | The font used with monospaced serif characters |
3 | The font used with monospaced sans-serif characters |
4 | The font used with ICR (hand-written) characters |
5 | The font used with MICR (check font) characters |
The OcrCharacter.FontStyle member of each character returned in IOcrPage.GetRecognizedCharacters determines which font to use with the character. If the zone is ICR or MICR (the OcrZone.RecognitionModule member is OcrZoneRecognitionModule.Micr, OcrZoneRecognitionModule.IcrNumeral or OcrZoneRecognitionModule.IcrCharacter), then the character will use the ICR or 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 languageName equals to "en" for English or "de" for German will change the default Latin fonts used in the final document. This is the equivalant of passing null (Nothing in Visual Basic).
If the OCR engine supports Asian languages, 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 (null), Japanese (ja), Korean (ko), Chinese (zh-Hans and zh-Hant) and Korean (ko). The following table lists the default fonts used for each language:
Language | Fonts | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Latin (all other languages) including languageName equals to null |
|
||||||||||||||
Japanese (languageName equals to "ja") |
|
||||||||||||||
Chinese (languageName equals to "zh-Hans" or "zh-Hant") |
|
||||||||||||||
Korean (languageName equals to "ko") |
|
Note that changing the fonts is not recommended in most cases, the charcater 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 IOcrPage.GetRecognizedCharacters and IOcrPage.SetRecognizedCharacters to further change the character position and font size to create the final output document.
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7