From dac60206ff553ff424593f15d6c196a6c9cc0b5d Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 16 Sep 2022 07:39:04 +0200 Subject: vcl: Add PhysicalFontFace API to get color layers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic221582a04982f0b1565089fa0beff1b34a749d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140123 Tested-by: Jenkins Reviewed-by: خالد حسني --- vcl/inc/font/PhysicalFontFace.hxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vcl/inc') diff --git a/vcl/inc/font/PhysicalFontFace.hxx b/vcl/inc/font/PhysicalFontFace.hxx index 01ad46dea54e..75133503e8af 100644 --- a/vcl/inc/font/PhysicalFontFace.hxx +++ b/vcl/inc/font/PhysicalFontFace.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -84,6 +85,14 @@ private: hb_blob_t* mpBlob; }; +struct ColorLayer +{ + sal_GlyphId nGlyphIndex; + uint32_t nColorIndex; +}; + +typedef std::vector ColorPalette; + // TODO: no more direct access to members // TODO: get rid of height/width for scalable fonts // TODO: make cloning cheaper @@ -125,6 +134,10 @@ public: bool CreateFontSubset(std::vector&, const sal_GlyphId*, const sal_uInt8*, const int, FontSubsetInfo&) const; + bool HasColorLayers() const; + const ColorPalette& GetColorPalette(size_t) const; + std::vector GetGlyphColorLayers(sal_GlyphId) const; + virtual hb_face_t* GetHbFace() const; virtual hb_blob_t* GetHbTable(hb_tag_t) const { @@ -137,6 +150,7 @@ protected: mutable FontCharMapRef mxCharMap; mutable vcl::FontCapabilities maFontCapabilities; mutable bool mbFontCapabilitiesRead; + mutable std::vector maColorPalettes; explicit PhysicalFontFace(const FontAttributes&); }; -- cgit