Aspose::Words::Fonts::FontInfoCollection::Contains method

FontInfoCollection::Contains method

Determines whether the collection contains a font with the given name.

_Bool Aspose::Words::Fonts::FontInfoCollection::Contains(const System::String & name)
ParameterTypeDescription
nameconst System::String &Case-insensitive name of the font to locate.

ReturnValue

true if the item is found in the collection; otherwise, false.

Examples

Shows info about the fonts that are present in the blank document.

auto doc = System::MakeObject<Aspose::Words::Document>();

// A blank document contains 3 default fonts. Each font in the document
// will have a corresponding FontInfo object which contains details about that font.
ASSERT_EQ(doc->get_FontInfos()->get_Count(), 3);

ASSERT_TRUE(doc->get_FontInfos()->Contains(u"Times New Roman"));
ASSERT_EQ(doc->get_FontInfos()->idx_get(u"Times New Roman")->get_Charset(), 204);

ASSERT_TRUE(doc->get_FontInfos()->Contains(u"Symbol"));
ASSERT_TRUE(doc->get_FontInfos()->Contains(u"Arial"));

See Also