openDecal/Native/Inject/FontCache.h
erik d1442e3747 Initial commit: Complete open-source Decal rebuild
All 5 phases of the open-source Decal rebuild:

Phase 1: 14 decompiled .NET projects (Interop.*, Adapter, FileService, DecalUtil)
Phase 2: 10 native DLLs rewritten as C# COM servers with matching GUIDs
  - DecalDat, DHS, SpellFilter, DecalInput, DecalNet, DecalFilters
  - Decal.Core, DecalControls, DecalRender, D3DService
Phase 3: C++ shims for Inject.DLL (D3D9 hooking) and LauncherHook.DLL
Phase 4: DenAgent WinForms tray application
Phase 5: WiX installer and build script

25 C# projects building with 0 errors.
Native C++ projects require VS 2022 + Windows SDK (x86).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:27:56 +01:00

50 lines
1.3 KiB
C++

// FontCache.h : Declaration of the cFontCache
#ifndef __FONTCACHE_H_
#define __FONTCACHE_H_
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// cFontCache
class ATL_NO_VTABLE cFontCache :
public CComObjectRootEx<CComMultiThreadModel>,
public IDispatchImpl< IFontCache, &IID_IFontCacheDisp, &LIBID_DecalPlugins >
{
public:
cFontCache()
{
m_bFontSmoothing = FALSE;
SystemParametersInfo( SPI_GETFONTSMOOTHING, 0, &m_bFontSmoothing, 0 );
}
~cFontCache();
struct cCharMetrics
{
short m_nWidth;
};
BOOL m_bFontSmoothing;
SIZE m_szCharCell;
cCharMetrics m_nWidths[ 256 ];
LOGFONT m_lf;
CComPtr< ICanvas > m_pBuffer;
bool checkBuffer();
BEGIN_COM_MAP(cFontCache)
COM_INTERFACE_ENTRY(IFontCache)
COM_INTERFACE_ENTRY(IFontCacheDisp)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
// IFontCache
public:
STDMETHOD(HitTest)(BSTR szText, long nPos, /*[out, retval]*/ long *nIndex);
STDMETHOD(MeasureText)( BSTR szText, /*[out]*/ LPSIZE pszExt );
STDMETHOD(DrawText)( LPPOINT pt, BSTR szText, long clr, ICanvas *pCanvas );
STDMETHOD(DrawTextEx)( LPPOINT pt, BSTR szText, long clr1, long clr2, long lFlags, ICanvas *pCanvas );
};
#endif //__FONTCACHE_H_