diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 60e7146fcc12..4d2e84708c2f 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1200,7 +1200,7 @@ public: bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, std::vector< tools::Rectangle >& rVector ) const; - + bool SupportsOpenTypeMath() const; sal_Int32 HasGlyphs( const vcl::Font& rFont, std::u16string_view rStr, sal_Int32 nIndex = 0, sal_Int32 nLen = -1 ) const; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 2b6008580c0f..0e807600b403 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1405,6 +1405,20 @@ sal_Int32 OutputDevice::HasGlyphs( const vcl::Font& rTempFont, std::u16string_vi return -1; } +bool OutputDevice::SupportsOpenTypeMath() const +{ + if (!ImplNewFont()) + return false; + + LogicalFontInstance* pFontInstance = mpFontInstance.get(); + + if (pFontInstance) { + auto pFace = pFontInstance->GetFontFace(); + return pFace->HasOpenTypeMathTable(); + } + return false; +} + void OutputDevice::ReleaseFontCache() { mxFontCache.reset(); } void OutputDevice::ReleaseFontCollection() { mxFontCollection.reset(); }