home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / vbpg32 / samples4 / ch11 / enmfntx.bas < prev    next >
Encoding:
BASIC Source File  |  1997-02-16  |  2.4 KB  |  79 lines

  1. Attribute VB_Name = "ENMFNTX1"
  2. Option Explicit
  3. ' Copyright ⌐ 1997 by Desaware Inc. All Rights Reserved.
  4.  
  5. ' Logical Font
  6. Public Const LF_FACESIZE = 32
  7. Public Const LF_FULLFACESIZE = 64
  8.  
  9. Type LOGFONT
  10.         lfHeight As Long
  11.         lfWidth As Long
  12.         lfEscapement As Long
  13.         lfOrientation As Long
  14.         lfWeight As Long
  15.         lfItalic As Byte
  16.         lfUnderline As Byte
  17.         lfStrikeOut As Byte
  18.         lfCharSet As Byte
  19.         lfOutPrecision As Byte
  20.         lfClipPrecision As Byte
  21.         lfQuality As Byte
  22.         lfPitchAndFamily As Byte
  23.         lfFaceName(LF_FACESIZE - 1) As Byte
  24. End Type
  25.  
  26.  
  27. ' This used to be a NEWLOGFONT in Win16
  28. Type ENUMLOGFONT
  29.         elfLogFont As LOGFONT
  30.         elfFullName(LF_FULLFACESIZE - 1) As Byte
  31.         elfStyle(LF_FACESIZE - 1) As Byte
  32. End Type
  33.  
  34. ' Structure passed to FONTENUMPROC
  35. ' NOTE: NEWTEXTMETRIC is the same as TEXTMETRIC plus 4 new fields
  36. Type NEWTEXTMETRIC
  37.         tmHeight As Long
  38.         tmAscent As Long
  39.         tmDescent As Long
  40.         tmInternalLeading As Long
  41.         tmExternalLeading As Long
  42.         tmAveCharWidth As Long
  43.         tmMaxCharWidth As Long
  44.         tmWeight As Long
  45.         tmOverhang As Long
  46.         tmDigitizedAspectX As Long
  47.         tmDigitizedAspectY As Long
  48.         tmFirstChar As Byte
  49.         tmLastChar As Byte
  50.         tmDefaultChar As Byte
  51.         tmBreakChar As Byte
  52.         tmItalic As Byte
  53.         tmUnderlined As Byte
  54.         tmStruckOut As Byte
  55.         tmPitchAndFamily As Byte
  56.         tmCharSet As Byte
  57.         ntmFlags As Long
  58.         ntmSizeEM As Long
  59.         ntmCellHeight As Long
  60.         ntmAveWidth As Long
  61. End Type
  62.  
  63.  
  64. Public nlf As ENUMLOGFONT
  65.  
  66. Public ntm As NEWTEXTMETRIC
  67.  
  68. Public Const TMPF_TRUETYPE = 4
  69.  
  70. '  EnumFonts Masks
  71. Public Const RASTER_FONTTYPE = &H1
  72. Public Const DEVICE_FONTTYPE = &H2
  73. Public Const TRUETYPE_FONTTYPE = &H4
  74.  
  75. Declare Function EnumFontFamilies Lib "gdi32" Alias "EnumFontFamiliesA" (ByVal hdc As Long, ByVal lpszFamily As String, ByVal lpEnumFontFamProc As Long, ByVal lParam As Long) As Long
  76. Declare Function EnumFontFamiliesEx Lib "gdi32" Alias "EnumFontFamiliesExA" (ByVal hdc As Long, lpLogFont As LOGFONT, ByVal lpEnumFontProc As Long, ByVal lParam As Long, ByVal dw As Long) As Long
  77. Declare Function EnumFonts Lib "gdi32" Alias "EnumFontsA" (ByVal hdc As Long, ByVal lpsz As String, ByVal lpFontEnumProc As Long, ByVal lParam As Long) As Long
  78.  
  79.