summaryrefslogtreecommitdiff
path: root/cui/source/util/FontFeatures.cxx
diff options
context:
space:
mode:
authorDeb Barkley-Yeung <dbarkleyyeung@gmail.com>2021-06-27 23:28:50 -0700
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-16 09:02:28 +0200
commit44db9f08077f388306ef0bf7277c93a1e5cd89b8 (patch)
tree7deae22af1dbde827b82b12289db636b6d0b607f /cui/source/util/FontFeatures.cxx
parentfce76110e02409b67ad977ae0077adf55ca58065 (diff)
tdf#139654 Font feature sensativity
Disable font preview's "Features..." button if there are no features Change-Id: Ibcf6b34abe55818a3b938a65f4fd720ed724c8ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118965 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/util/FontFeatures.cxx')
-rwxr-xr-xcui/source/util/FontFeatures.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/cui/source/util/FontFeatures.cxx b/cui/source/util/FontFeatures.cxx
new file mode 100755
index 000000000000..f50980aabfa7
--- /dev/null
+++ b/cui/source/util/FontFeatures.cxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <FontFeatures.hxx>
+
+std::vector<vcl::font::Feature> getFontFeatureList(OUString const& rFontName, VirtualDevice& rVDev)
+{
+ rVDev.SetOutputSizePixel(Size(10, 10));
+
+ vcl::Font aFont = rVDev.GetFont();
+ aFont.SetFamilyName(rFontName);
+ rVDev.SetFont(aFont);
+
+ std::vector<vcl::font::Feature> vFontFeatures;
+
+ if (!rVDev.GetFontFeatures(vFontFeatures))
+ {
+ vFontFeatures.clear();
+ }
+
+ return vFontFeatures;
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file