IVsFontAndColorStorage.SetFont Method

Stores the basic definition of a font to be used by the currently open Category.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function SetFont ( _
    pInfo As FontInfo() _
) As Integer
int SetFont(
    FontInfo[] pInfo
)
int SetFont(
    [InAttribute] array<FontInfo>^ pInfo
)
abstract SetFont : 
        pInfo:FontInfo[] -> int 
function SetFont(
    pInfo : FontInfo[]
) : int

Parameters

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsFontAndColorStorage::SetFont(
   [in] FontInfo *pInfo
);

Only the face name (bstrFaceName), character set (iCharSet), and point size (wPointSize) values specified by the incoming FontInfo structure are stored in the registry.

If a call to IVsFontAndColorStorage::SetFont succeed, and the item's Category was opened by OpenCategory with a mode of FCSF_PROPAGATECHANGES, the method generates an event to be handled by OnFontChanged. If the item's Category was not opened with FCSF_PROPAGATECHANGES, applications have to query the environment to obtain information using GetFont or GetFont.

It is up to applications rendering text to the Visual Studio environment to update their display to match the settings modified by this method.

.NET Framework Security

See Also

Reference

IVsFontAndColorStorage Interface

Microsoft.VisualStudio.Shell.Interop Namespace

IVsFontAndColorStorage2