This documentation is archived and is not being maintained.

IVsFontAndColorUtilities Interface

Provides tools for working with the input and output data used by the methods of the Visual StudioFont and Color mechanism.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in microsoft.visualstudio.shell.interop.8.0.dll)

[GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50")] 
[InterfaceTypeAttribute(1)] 
public interface IVsFontAndColorUtilities
/** @attribute GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50") */ 
/** @attribute InterfaceTypeAttribute(1) */ 
public interface IVsFontAndColorUtilities
GuidAttribute("A356A017-07EE-4D06-ACDE-FEFDBB49EB50") 
InterfaceTypeAttribute(1) 
public interface IVsFontAndColorUtilities

The methods of the IVsFontAndColorUtilities interface allow a VSPackage to provide Font and Color support tools for working with FontInfo, __FONTCOLORFLAGS, __FCFONTFLAGS, and LOGFONTW, which are used to specify and modify font and color information.

If a VSPackage providing Fonts and Colors changes its default settings, it must call ClearCache or ClearAllCaches. This will force the reloading of Fonts and Colors providers, ensure the propagation of its settings and the currency of future Fonts and Colors queries.

NoteNote

Many of the methods in this interface work with color data stored as a COLORREF, consistent with the Windows 32 SDK GetSysColor function. A COLORREF (RGB) has the hex format of 0x00bbggrr. Managed code can obtain functionality equivalent to GetSysColor with SystemColors and convert between COLORREF and the System.Drawing.Color structure using M:System.Drawing.ColorTranslator.FromWin32 and M:System.Drawing.ColorTranslator.ToWin32.

Notes to Callers The IVsFontAndColorUtilities is obtained from the SVsFontAndColorStorage service implementation. VSPackages developed using managed code can obtain an IVsFontAndColorCacheManager interface by calling GetService with an argument of SVsFontAndColorStorage and casting to IVsFontAndColorUtilities:

    IVsFontAndColorUtilities store=null;
    store=GetService(typeof(SVsFontAndColorStorage)) as IVsFontAndColorUtilities;
    if (store == null ){
        throw new ApplicationException("Unable to obtain IVsFontAndColorUtilities Interface");
} COM programmers can obtain an IVsFontAndColorCacheManager interface by calling QueryService with a service ID SID_SVsFontAndColorStorage and the interface ID IID_IVsFontAndColorUtilities:
    CComPtr<IVsFontAndColorUtilities> srpFCCacheMgr;
    pSP->QueryService(SID_SVsFontAndColorStorage , IID_IVsFontAndColorUtilities , (void**)&srpFCCacheMgr);
    VSASSERT(SUCCEEDED(hr), " IVsFontAndColorUtilities not provided");
Show: