Freigeben über


IVsFontAndColorStorage.GetFont Method

Returns the font attributes for the currently open Category.

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

Syntax

'Declaration
Function GetFont ( _
    <OutAttribute> pLOGFONT As LOGFONTW(), _
    <OutAttribute> pInfo As FontInfo() _
) As Integer
'Usage
Dim instance As IVsFontAndColorStorage
Dim pLOGFONT As LOGFONTW()
Dim pInfo As FontInfo()
Dim returnValue As Integer

returnValue = instance.GetFont(pLOGFONT, _
    pInfo)
int GetFont(
    LOGFONTW[] pLOGFONT,
    FontInfo[] pInfo
)
int GetFont(
    [InAttribute] [OutAttribute] array<LOGFONTW>^ pLOGFONT, 
    [InAttribute] [OutAttribute] array<FontInfo>^ pInfo
)
function GetFont(
    pLOGFONT : LOGFONTW[], 
    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::GetFont(
   [in, out] LOGFONTW *pLOGFONT,
   [in, out] FontInfo *pInfo
);

Either pLOGFONT or pInfo may be NULL (C++) or nulla null reference (Nothing in Visual Basic) (C#). The only data retrieved is the face name, character set, and point size.

In C++, the face name is a BSTR that must be freed by the client.

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

Permissions

See Also

Reference

IVsFontAndColorStorage Interface

IVsFontAndColorStorage Members

Microsoft.VisualStudio.Shell.Interop Namespace

IVsFontAndColorStorage2