home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / Chapt_15 / Text / Panose.h < prev    next >
C/C++ Source or Header  |  2000-05-24  |  2KB  |  50 lines

  1. //-----------------------------------------------------------------------------------//
  2. //              Windows Graphics Programming: Win32 GDI and DirectDraw               //
  3. //                             ISBN  0-13-086985-6                                   //
  4. //                                                                                   //
  5. //  Written            by  Yuan, Feng                             www.fengyuan.com   //
  6. //  Copyright (c) 2000 by  Hewlett-Packard Company                www.hp.com         //
  7. //  Published          by  Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com      //
  8. //                                                                                   //
  9. //  FileName   : panose.h                                                             //
  10. //  Description: Panose font matching                                                //
  11. //  Version    : 1.00.000, May 31, 2000                                              //
  12. //-----------------------------------------------------------------------------------//
  13.  
  14. class KPanoseView : public KCanvas
  15. {
  16.     virtual LRESULT WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  17.     
  18.     HMENU            m_hViewMenu;
  19.     HWND            m_hFrame;
  20.     KListView        m_Fonts;
  21.  
  22.     void GetWndClassEx(WNDCLASSEX & wc)
  23.     {
  24.         KCanvas::GetWndClassEx(wc);
  25.     
  26.         wc.hIcon = LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_TEXT));
  27.     }
  28.  
  29. public:
  30.  
  31.     typedef enum    { MAX_FONTS = 256 };
  32.  
  33.     PANOSE            m_Panose[MAX_FONTS];
  34.     TCHAR            m_TypeFace[MAX_FONTS][32];
  35.     int                m_nFonts;
  36.  
  37.     KPanoseView()
  38.     {
  39.         m_hViewMenu    = NULL;
  40.         m_hFrame       = NULL;
  41.  
  42.         m_nFonts       = 0;
  43.     }
  44.  
  45.     void AddFont(const TCHAR * fullname, HDC hDC);
  46.     void ListPANOSE(void);
  47.  
  48.     bool Initialize(HINSTANCE hInstance, KStatusWindow * pStatus, HWND hWndFrame);
  49. };
  50.