summaryrefslogtreecommitdiff
path: root/vcl/inc/font
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-11-19 14:58:40 +0200
committerخالد حسني <khaled@aliftype.com>2022-11-19 15:45:21 +0100
commita38bb773bb568ef942293f23d0701da933817e8f (patch)
treee628431e3afb207f2849afe923a6668e0e68d795 /vcl/inc/font
parente65b0bf83b8225fde81ee7b10c1fa4b9f32b6ed1 (diff)
vcl: use std::optional in PhysicalFontFace
Otherwise when a font does not, say, support variations or color palettes, we keep querying the font each time they are requested. Change-Id: I3a41bc73dd814b25af3a8b5b009632ecf7ef27ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142963 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/inc/font')
-rw-r--r--vcl/inc/font/PhysicalFontFace.hxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/inc/font/PhysicalFontFace.hxx b/vcl/inc/font/PhysicalFontFace.hxx
index ae0e6ad7d5bf..6e99ae4a098c 100644
--- a/vcl/inc/font/PhysicalFontFace.hxx
+++ b/vcl/inc/font/PhysicalFontFace.hxx
@@ -194,16 +194,15 @@ public:
return nullptr;
}
- virtual std::vector<hb_variation_t> GetVariations() const { return {}; };
+ virtual const std::vector<hb_variation_t>& GetVariations() const;
protected:
mutable hb_face_t* mpHbFace;
mutable hb_font_t* mpHbUnscaledFont;
mutable FontCharMapRef mxCharMap;
- mutable vcl::FontCapabilities maFontCapabilities;
- mutable bool mbFontCapabilitiesRead;
- mutable std::vector<ColorPalette> maColorPalettes;
- mutable std::vector<hb_variation_t> m_aVariations;
+ mutable std::optional<vcl::FontCapabilities> mxFontCapabilities;
+ mutable std::optional<std::vector<ColorPalette>> mxColorPalettes;
+ mutable std::optional<std::vector<hb_variation_t>> mxVariations;
explicit PhysicalFontFace(const FontAttributes&);