summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-10-04 15:03:19 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-11-12 12:12:13 +0100
commit5054202e71605cb4f10c798be766798d99cb1b6a (patch)
treeb8acfb363bee5faf60f9fd191cab0a29880d4c14 /offapi
parentb2247f86e42c05991165834ff5d63731b0da2b3b (diff)
make it possible to find out what fonts are actually really used
A document specifies which font each text is supposed to use, but we still need to map that to a real available font, which includes also font fallback in case the font selected doesn't cover all glyphs. This commit adds API to track this font mapping, first StartTrackingFontMappingUse() will make VCL record this information, and then FinishTrackingFontMappingUse() will stop and return all the information, as a listing saying that a requested font got mapped to a list of fonts and the number of times this took place. This can be useful to find out what actually gets used for a specific document, or compare how changing fonts available affects a specific document. Change-Id: I6426ecef354166bef337b1dc9b9007fda148d5c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123051 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'offapi')
-rw-r--r--offapi/UnoApi_offapi.mk3
-rw-r--r--offapi/com/sun/star/awt/XFontMappingUse.idl56
-rw-r--r--offapi/com/sun/star/awt/XFontMappingUseItem.idl55
-rw-r--r--offapi/com/sun/star/awt/XToolkit3.idl47
-rw-r--r--offapi/com/sun/star/awt/XToolkitExperimental.idl4
5 files changed, 163 insertions, 2 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 26b56bedd8e5..6f1dc604a8e3 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1828,6 +1828,8 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/awt,\
XFocusListener \
XFont \
XFont2 \
+ XFontMappingUse \
+ XFontMappingUseItem \
XGraphics \
XGraphics2 \
XImageButton \
@@ -1890,6 +1892,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/awt,\
XToggleButton \
XToolkit \
XToolkit2 \
+ XToolkit3 \
XToolkitExperimental \
XToolkitRobot \
XTopWindow \
diff --git a/offapi/com/sun/star/awt/XFontMappingUse.idl b/offapi/com/sun/star/awt/XFontMappingUse.idl
new file mode 100644
index 000000000000..8140d6a78a4a
--- /dev/null
+++ b/offapi/com/sun/star/awt/XFontMappingUse.idl
@@ -0,0 +1,56 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_awt_XFontMappingUse_idl__
+#define __com_sun_star_awt_XFontMappingUse_idl__
+
+#include <com/sun/star/uno/XInterface.idl>
+#include <com/sun/star/awt/XFontMappingUseItem.idl>
+
+module com { module sun { module star { module awt {
+
+/**
+ This interface extends the XToolkit interface with support
+ for tracking how requested fonts are mapped to actual fonts
+ when laying out text.
+ @since LibreOffice 7.3
+*/
+published interface XFontMappingUse: com::sun::star::uno::XInterface
+{
+ /**
+ Activate tracking of how requested fonts are mapped to available
+ fonts.
+ */
+ void startTrackingFontMappingUse();
+
+ /**
+ Stop tracking of how requested fonts are mapped to available
+ fonts and return the mappings that took place since the call
+ to startTrackingFontMappingUse().
+ */
+ sequence<XFontMappingUseItem> finishTrackingFontMappingUse();
+
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XFontMappingUseItem.idl b/offapi/com/sun/star/awt/XFontMappingUseItem.idl
new file mode 100644
index 000000000000..2cb5a8936fd2
--- /dev/null
+++ b/offapi/com/sun/star/awt/XFontMappingUseItem.idl
@@ -0,0 +1,55 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_awt_XFontMappingUseItem_idl__
+#define __com_sun_star_awt_XFontMappingUseItem_idl__
+
+module com { module sun { module star { module awt {
+
+/**
+ Information about a font mapping that took place.
+ @since LibreOffice 7.3
+*/
+published struct XFontMappingUseItem
+{
+ /**
+ The family name or 'familyName/styleName' (if style name is not empty)
+ of the requested font.
+ */
+ string originalFont;
+
+ /**
+ A list of fonts that were actually used, in their order. Each font
+ is identified as family name or 'familyName/styleName' (if style
+ name is not empty).
+ */
+ sequence<string> usedFonts;
+
+ /**
+ The number of times this mapping took place.
+ */
+ long count;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XToolkit3.idl b/offapi/com/sun/star/awt/XToolkit3.idl
new file mode 100644
index 000000000000..36d9800c560c
--- /dev/null
+++ b/offapi/com/sun/star/awt/XToolkit3.idl
@@ -0,0 +1,47 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_awt_XToolkit3_idl__
+#define __com_sun_star_awt_XToolkit3_idl__
+
+#include <com/sun/star/awt/XToolkit2.idl>
+#include <com/sun/star/awt/XFontMappingUse.idl>
+
+
+
+module com { module sun { module star { module awt {
+
+
+/**
+ Provides a unified interface for the new-style service Toolkit to implement.
+
+ @since LibreOffice 7.3
+ */
+published interface XToolkit3
+{
+ interface XToolkit2;
+
+ interface com::sun::star::awt::XFontMappingUse;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XToolkitExperimental.idl b/offapi/com/sun/star/awt/XToolkitExperimental.idl
index 958c80c1cb9b..d47353dc70b5 100644
--- a/offapi/com/sun/star/awt/XToolkitExperimental.idl
+++ b/offapi/com/sun/star/awt/XToolkitExperimental.idl
@@ -10,14 +10,14 @@
#ifndef __com_sun_star_awt_XToolkitExperimental_idl__
#define __com_sun_star_awt_XToolkitExperimental_idl__
-#include <com/sun/star/awt/XToolkit2.idl>
+#include <com/sun/star/awt/XToolkit3.idl>
module com { module sun { module star { module awt {
/** Work in progress, don't use unless you know what you are doing.
*/
-interface XToolkitExperimental : XToolkit2
+interface XToolkitExperimental : XToolkit3
{
/** Process all pending idle events
*/