BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 120
TabIndex = 0
Text = "Kerning for this font"
Top = 120
Width = 2475
End
Attribute VB_Name = "frmEx11A"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
' Copyright
1997 by Desaware Inc. All Rights Reserved.
Private Type KERNINGPAIR
wFirst As Integer
wSecond As Integer
iKernAmount As Long
End Type
Private Declare Function GetKerningPairs Lib "gdi32" Alias "GetKerningPairsA" (ByVal hdc As Long, ByVal cPairs As Long, lpkrnpair As KERNINGPAIR) As Long
Private Declare Function GetKerningPairsBynum Lib "gdi32" Alias "GetKerningPairsA" (ByVal hdc As Long, ByVal cPairs As Long, ByVal lpkrnpair As Long) As Long
Private Declare Function GetTextCharset Lib "gdi32" (ByVal hdc As Long) As Long
Private Sub cmdKerning_Click()
Dim numpairs&
Dim dl&, x%
' Cheap way to assign the text font to the form
' then use the form device context.
frmEx11A.Font = txtKern.Font
' Find out how many entries there are
numpairs = GetKerningPairsBynum(hdc, 0, 0)
' Allocate the kerning pair structures
ReDim kp(numpairs) As KERNINGPAIR
dl = GetKerningPairs(hdc, numpairs, kp(1))
' Display the results
For x = 1 To numpairs
list1.AddItem "Kerning " & Chr$(kp(x).wFirst) & " to " & Chr$(kp(x).wSecond) & " is " & kp(x).iKernAmount