summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-10-29 20:17:35 +0200
committerخالد حسني <khaled@aliftype.com>2022-11-02 23:06:46 +0100
commit643fec7cf7a81bf8c89a8efd47c0310b38f9076c (patch)
tree95add7bdb619d55d5ca35ca3258d79bcb9af187a /vcl/inc
parent29f318f90d2ed72a807d803094734d5ee7322a2d (diff)
vcl: add PhysicalFontFace::GetVariations()
Use it to set the variations on hb_font_t, and we will use it for other things in later commits. Change-Id: Iae1861f74b38af4921ac97c1facecf0d4815c201 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142024 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/font/PhysicalFontFace.hxx3
-rw-r--r--vcl/inc/quartz/salgdi.h5
-rw-r--r--vcl/inc/unx/freetype_glyphcache.hxx3
-rw-r--r--vcl/inc/unx/glyphcache.hxx2
4 files changed, 8 insertions, 5 deletions
diff --git a/vcl/inc/font/PhysicalFontFace.hxx b/vcl/inc/font/PhysicalFontFace.hxx
index 3d7fa0cba71d..ae0e6ad7d5bf 100644
--- a/vcl/inc/font/PhysicalFontFace.hxx
+++ b/vcl/inc/font/PhysicalFontFace.hxx
@@ -194,6 +194,8 @@ public:
return nullptr;
}
+ virtual std::vector<hb_variation_t> GetVariations() const { return {}; };
+
protected:
mutable hb_face_t* mpHbFace;
mutable hb_font_t* mpHbUnscaledFont;
@@ -201,6 +203,7 @@ protected:
mutable vcl::FontCapabilities maFontCapabilities;
mutable bool mbFontCapabilitiesRead;
mutable std::vector<ColorPalette> maColorPalettes;
+ mutable std::vector<hb_variation_t> m_aVariations;
explicit PhysicalFontFace(const FontAttributes&);
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index b621e715ef54..f3bab610f08b 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -72,6 +72,8 @@ public:
virtual hb_blob_t* GetHbTable(hb_tag_t nTag) const override;
+ std::vector<hb_variation_t> GetVariations() const override;
+
private:
CTFontDescriptorRef mxFontDescriptor;
};
@@ -98,11 +100,8 @@ public:
private:
explicit CoreTextFont(const CoreTextFontFace&, const vcl::font::FontSelectPattern&);
- virtual void ImplInitHbFont(hb_font_t*) override;
bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const override;
- void SetFontVariationsOnHBFont(hb_font_t*) const;
-
CTFontRef mpCTFont;
};
diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx
index ca35beccc211..0ec53c073006 100644
--- a/vcl/inc/unx/freetype_glyphcache.hxx
+++ b/vcl/inc/unx/freetype_glyphcache.hxx
@@ -100,6 +100,8 @@ public:
virtual hb_face_t* GetHbFace() const override;
virtual hb_blob_t* GetHbTable(hb_tag_t nTag) const override;
+
+ std::vector<hb_variation_t> GetVariations() const override;
};
class SAL_DLLPUBLIC_RTTI FreetypeFontInstance final : public LogicalFontInstance
@@ -108,7 +110,6 @@ class SAL_DLLPUBLIC_RTTI FreetypeFontInstance final : public LogicalFontInstance
std::unique_ptr<FreetypeFont> mxFreetypeFont;
- virtual void ImplInitHbFont(hb_font_t*) override;
virtual bool ImplGetGlyphBoundRect(sal_GlyphId, tools::Rectangle&, bool) const override;
explicit FreetypeFontInstance(const vcl::font::PhysicalFontFace& rPFF, const vcl::font::FontSelectPattern& rFSP);
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index f6f885badbf3..a6be9e872da6 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -129,7 +129,7 @@ public:
bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const;
bool GetAntialiasAdvice() const;
- void SetFontVariationsOnHBFont(hb_font_t* pHbFace) const;
+ std::vector<hb_variation_t> GetVariations() const;
private:
friend class FreetypeFontInstance;