Avoid potential negative array index access to cached text.
[LibreOffice.git] / vcl / inc / font / FeatureCollector.hxx
blob1b71d021599d6479292040eef274bfaf403e5684
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 */
11 #pragma once
13 #include <vcl/font/Feature.hxx>
14 #include <hb.h>
15 #include <i18nlangtag/languagetag.hxx>
17 #include <font/PhysicalFontFace.hxx>
19 namespace vcl::font
21 class FeatureCollector
23 private:
24 const PhysicalFontFace* m_pFace;
25 hb_face_t* m_pHbFace;
26 std::vector<vcl::font::Feature>& m_rFontFeatures;
27 const LanguageTag& m_rLanguageTag;
29 public:
30 FeatureCollector(const PhysicalFontFace* pFace, std::vector<vcl::font::Feature>& rFontFeatures,
31 const LanguageTag& rLanguageTag)
32 : m_pFace(pFace)
33 , m_pHbFace(pFace->GetHbFace())
34 , m_rFontFeatures(rFontFeatures)
35 , m_rLanguageTag(rLanguageTag)
39 private:
40 void collectForTable(hb_tag_t aTableTag);
41 bool collectGraphite();
43 public:
44 bool collect();
47 } // namespace vcl::font
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */