summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-09-16 07:39:04 +0200
committerخالد حسني <khaled@aliftype.com>2022-09-19 12:24:20 +0200
commitdac60206ff553ff424593f15d6c196a6c9cc0b5d (patch)
tree074e2f36095234cac5074f7e4cb37a1b9c624c32 /vcl/inc
parent92d67d4d32dee25c6b40ade5924f9d1ab488a16c (diff)
vcl: Add PhysicalFontFace API to get color layers
Change-Id: Ic221582a04982f0b1565089fa0beff1b34a749d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140123 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/font/PhysicalFontFace.hxx14
1 files changed, 14 insertions, 0 deletions
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 <salhelper/simplereferenceobject.hxx>
#include <rtl/ref.hxx>
+#include <tools/color.hxx>
#include <tools/long.hxx>
#include <vcl/dllapi.h>
#include <vcl/fontcapabilities.hxx>
@@ -84,6 +85,14 @@ private:
hb_blob_t* mpBlob;
};
+struct ColorLayer
+{
+ sal_GlyphId nGlyphIndex;
+ uint32_t nColorIndex;
+};
+
+typedef std::vector<Color> 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<sal_uInt8>&, const sal_GlyphId*, const sal_uInt8*, const int,
FontSubsetInfo&) const;
+ bool HasColorLayers() const;
+ const ColorPalette& GetColorPalette(size_t) const;
+ std::vector<ColorLayer> 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<ColorPalette> maColorPalettes;
explicit PhysicalFontFace(const FontAttributes&);
};