MiFont Object

MiFont

Represents a font that was recognized in the text during an optical character recognition (OCR) operation.

Using the MiFont Object

Use the Font accessor property of the Word object to return an MiFont object and to gain access to the font family, size, face style, and serif style of the font in which the specified word appears.

Example

The following example performs OCR on the first page of a document, and then reports the font properties of the third recognized word.

Sub TestFont()
  
  Dim modiDoc As MODI.Document
  Dim modiFont As MODI.MiFont
  Dim strFontInfo As String
  
  ' Load an existing TIFF file.
  Set modiDoc = New MODI.Document
  modiDoc.Create "C:\document1.tif"
  
  ' Perform OCR.
  modiDoc.Images(0).OCR
  
  ' Retrieve and display font information.
  Set modiFont = modiDoc.Images(0).Layout.Words(2).Font
  strFontInfo = _
    "Font family: " & modiFont.Family & vbCrLf & _
    "Font size: " & modiFont.FontSize & vbCrLf & _
    "Face style: " & modiFont.FaceStyle & vbCrLf & _
    "Serif style: " & modiFont.SerifStyle & vbCrLf
  MsgBox strFontInfo, vbInformation + vbOKOnly, _
    "Font Information"
  
  Set modiFont = Nothing
  Set modiDoc = Nothing

End Sub

Properties | FaceStyle Property | Family Property | FontSize Property | SerifStyle Property

Parent Objects

Child Objects