次の方法で共有


IVsFontAndColorStorage.SetFont(FontInfo[]) Method

Definition

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

public:
 int SetFont(cli::array <Microsoft::VisualStudio::Shell::Interop::FontInfo> ^ pInfo);
public:
 int SetFont(Platform::Array <Microsoft::VisualStudio::Shell::Interop::FontInfo> ^ pInfo);
int SetFont(std::Array <Microsoft::VisualStudio::Shell::Interop::FontInfo> const & pInfo);
public int SetFont (Microsoft.VisualStudio.Shell.Interop.FontInfo[] pInfo);
abstract member SetFont : Microsoft.VisualStudio.Shell.Interop.FontInfo[] -> int
Public Function SetFont (pInfo As FontInfo()) As Integer

Parameters

pInfo
FontInfo[]

[in] Reference to a FontInfo structure that contains the font specification.

Returns

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.

Applies to