IVsFontAndColorEvents::OnFontChanged Method (Guid, array<FontInfo>^, array<LOGFONTW>^, UInt32)
Called by the Visual Studio environment when the fonts of one Categories of the items listed in the Display Items drop-down list is modified.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int OnFontChanged( [InAttribute] Guid% rguidCategory, array<FontInfo>^ pInfo, array<LOGFONTW>^ pLOGFONT, unsigned int HFONT )
Parameters
- rguidCategory
-
Type:
System::Guid
[in] Specifies the GUID of the affected category. Compare this GUID to the GUID of your category to determine whether the event applies to your VSPackage.
- pInfo
-
Type:
array<Microsoft.VisualStudio.Shell.Interop::FontInfo>^
[in] Pointer to a FontInfo structure that contains font identification information.
- pLOGFONT
-
Type:
array<Microsoft.VisualStudio.Shell.Interop::LOGFONTW>^
[in] Pointer to a LOGFONTW structure containing the attributes of the font.
- HFONT
-
Type:
System::UInt32
[in] Pointer to a font object.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsFontAndColorEvents::OnFontChanged( [in] REFGUID rguidCategory, [in] const FontInfo *pInfo, [in] const LOGFONTW *pLOGFONT, [in] HFONT hFont );
Fonts are defined for on a Category basis, not a Display Items basis: all Display Items in a Category share the same font.
The bFaceNameValid, bPointSizeValid, and bCharSetValid, members of the returned FontInfo object (pInfo) indicate whether the corresponding font attributes have changed. Invalid attributes should be ignored. If all attributes are marked as invalid, pLOGFONT is NULL (C++) or null (C#).
The hFont parameter is included so that you need not create two separate HFONT objects, as creating an HFONT object is a resource-intensive activity. The parameter may be null, in which case the method creates an HFONT object as needed.