parent
27fd8e2b70
commit
158ffdc13e
@ -1,179 +0,0 @@
|
|||||||
From 6330ded7e48442f351a79d61b9439b30a2c8c24f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Stephan Bergmann <sbergman@redhat.com>
|
|
||||||
Date: Fri, 7 Jun 2019 15:57:13 +0200
|
|
||||||
Subject: [PATCH] Adapt to upcoming Python 3.8
|
|
||||||
|
|
||||||
...which changed PyTypeObject in <https://github.com/python/cpython/commit/
|
|
||||||
aacc77fbd77640a8f03638216fa09372cc21673d> "bpo-36974: implement PEP 590
|
|
||||||
(GH-13185)".
|
|
||||||
|
|
||||||
Change-Id: I687ec38aeda05d0747b9ed08221db75a758bed51
|
|
||||||
---
|
|
||||||
pyuno/source/module/pyuno.cxx | 9 ++++++++-
|
|
||||||
pyuno/source/module/pyuno_callable.cxx | 9 ++++++++-
|
|
||||||
pyuno/source/module/pyuno_iterator.cxx | 18 ++++++++++++++++--
|
|
||||||
pyuno/source/module/pyuno_runtime.cxx | 9 ++++++++-
|
|
||||||
pyuno/source/module/pyuno_struct.cxx | 9 ++++++++-
|
|
||||||
5 files changed, 48 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
|
|
||||||
index f5f23bf058fa..e59319030eb8 100644
|
|
||||||
--- a/pyuno/source/module/pyuno.cxx
|
|
||||||
+++ b/pyuno/source/module/pyuno.cxx
|
|
||||||
@@ -1636,7 +1636,11 @@ static PyTypeObject PyUNOType =
|
|
||||||
sizeof (PyUNO),
|
|
||||||
0,
|
|
||||||
PyUNO_del,
|
|
||||||
- nullptr,
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ 0, // Py_ssize_t tp_vectorcall_offset
|
|
||||||
+#else
|
|
||||||
+ nullptr, // printfunc tp_print
|
|
||||||
+#endif
|
|
||||||
PyUNO_getattr,
|
|
||||||
PyUNO_setattr,
|
|
||||||
/* this type does not exist in Python 3: (cmpfunc) */ nullptr,
|
|
||||||
@@ -1680,6 +1684,9 @@ static PyTypeObject PyUNOType =
|
|
||||||
, 0
|
|
||||||
#if PY_VERSION_HEX >= 0x03040000
|
|
||||||
, nullptr
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ , nullptr // vectorcallfunc tp_vectorcall
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/pyuno/source/module/pyuno_callable.cxx b/pyuno/source/module/pyuno_callable.cxx
|
|
||||||
index 6519d20734c9..656d1c84cb0e 100644
|
|
||||||
--- a/pyuno/source/module/pyuno_callable.cxx
|
|
||||||
+++ b/pyuno/source/module/pyuno_callable.cxx
|
|
||||||
@@ -181,7 +181,11 @@ static PyTypeObject PyUNO_callable_Type =
|
|
||||||
sizeof (PyUNO_callable),
|
|
||||||
0,
|
|
||||||
::pyuno::PyUNO_callable_del,
|
|
||||||
- nullptr,
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ 0, // Py_ssize_t tp_vectorcall_offset
|
|
||||||
+#else
|
|
||||||
+ nullptr, // printfunc tp_print
|
|
||||||
+#endif
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
@@ -225,6 +229,9 @@ static PyTypeObject PyUNO_callable_Type =
|
|
||||||
, 0
|
|
||||||
#if PY_VERSION_HEX >= 0x03040000
|
|
||||||
, nullptr
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ , nullptr // vectorcallfunc tp_vectorcall
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/pyuno/source/module/pyuno_iterator.cxx b/pyuno/source/module/pyuno_iterator.cxx
|
|
||||||
index 5f643c13b67e..a7862857d719 100644
|
|
||||||
--- a/pyuno/source/module/pyuno_iterator.cxx
|
|
||||||
+++ b/pyuno/source/module/pyuno_iterator.cxx
|
|
||||||
@@ -118,7 +118,11 @@ static PyTypeObject PyUNO_iterator_Type =
|
|
||||||
sizeof (PyUNO_iterator),
|
|
||||||
0,
|
|
||||||
PyUNO_iterator_del,
|
|
||||||
- nullptr,
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ 0, // Py_ssize_t tp_vectorcall_offset
|
|
||||||
+#else
|
|
||||||
+ nullptr, // printfunc tp_print
|
|
||||||
+#endif
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
@@ -162,6 +166,9 @@ static PyTypeObject PyUNO_iterator_Type =
|
|
||||||
0
|
|
||||||
#if PY_VERSION_HEX >= 0x03040000
|
|
||||||
, nullptr
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ , nullptr // vectorcallfunc tp_vectorcall
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -248,7 +255,11 @@ static PyTypeObject PyUNO_list_iterator_Type =
|
|
||||||
sizeof (PyUNO_list_iterator),
|
|
||||||
0,
|
|
||||||
PyUNO_list_iterator_del,
|
|
||||||
- nullptr,
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ 0, // Py_ssize_t tp_vectorcall_offset
|
|
||||||
+#else
|
|
||||||
+ nullptr, // printfunc tp_print
|
|
||||||
+#endif
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
@@ -292,6 +303,9 @@ static PyTypeObject PyUNO_list_iterator_Type =
|
|
||||||
0
|
|
||||||
#if PY_VERSION_HEX >= 0x03040000
|
|
||||||
, nullptr
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ , nullptr // vectorcallfunc tp_vectorcall
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
|
|
||||||
index 9887c1fbc828..d307f9af363c 100644
|
|
||||||
--- a/pyuno/source/module/pyuno_runtime.cxx
|
|
||||||
+++ b/pyuno/source/module/pyuno_runtime.cxx
|
|
||||||
@@ -75,7 +75,11 @@ static PyTypeObject RuntimeImpl_Type =
|
|
||||||
sizeof (RuntimeImpl),
|
|
||||||
0,
|
|
||||||
RuntimeImpl::del,
|
|
||||||
- nullptr,
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ 0, // Py_ssize_t tp_vectorcall_offset
|
|
||||||
+#else
|
|
||||||
+ nullptr, // printfunc tp_print
|
|
||||||
+#endif
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
nullptr,
|
|
||||||
@@ -119,6 +123,9 @@ static PyTypeObject RuntimeImpl_Type =
|
|
||||||
, 0
|
|
||||||
#if PY_VERSION_HEX >= 0x03040000
|
|
||||||
, nullptr
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ , nullptr // vectorcallfunc tp_vectorcall
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx
|
|
||||||
index 7088fc346145..9ad9439318ce 100644
|
|
||||||
--- a/pyuno/source/module/pyuno_struct.cxx
|
|
||||||
+++ b/pyuno/source/module/pyuno_struct.cxx
|
|
||||||
@@ -296,7 +296,11 @@ static PyTypeObject PyUNOStructType =
|
|
||||||
sizeof (PyUNO),
|
|
||||||
0,
|
|
||||||
PyUNOStruct_del,
|
|
||||||
- nullptr,
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ 0, // Py_ssize_t tp_vectorcall_offset
|
|
||||||
+#else
|
|
||||||
+ nullptr, // printfunc tp_print
|
|
||||||
+#endif
|
|
||||||
PyUNOStruct_getattr,
|
|
||||||
PyUNOStruct_setattr,
|
|
||||||
/* this type does not exist in Python 3: (cmpfunc) */ nullptr,
|
|
||||||
@@ -340,6 +344,9 @@ static PyTypeObject PyUNOStructType =
|
|
||||||
, 0
|
|
||||||
#if PY_VERSION_HEX >= 0x03040000
|
|
||||||
, nullptr
|
|
||||||
+#if PY_VERSION_HEX >= 0x03080000
|
|
||||||
+ , nullptr // vectorcallfunc tp_vectorcall
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
From 8c9cd3856067b8cbac26cb6228b2fce786001a3c Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Mon, 10 Jun 2019 20:11:48 +0100
|
|
||||||
Subject: [PATCH] Related: rhbz#1718063 look for pkg-config
|
|
||||||
python-version-embed
|
|
||||||
|
|
||||||
Change-Id: I7048171501e32d29f9d5a58f0d5fc0b96b318a4e
|
|
||||||
---
|
|
||||||
configure.ac | 3 +++
|
|
||||||
1 file changed, 3 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index e14d3b4f4d45..fa58f9ff3591 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -8462,6 +8462,9 @@ if test $enable_python = system; then
|
|
||||||
if test -z "$PKG_CONFIG"; then
|
|
||||||
PYTHON_CFLAGS="-I$python_include"
|
|
||||||
PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
|
|
||||||
+ elif $PKG_CONFIG --exists python-$python_version-embed; then
|
|
||||||
+ PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version-embed`"
|
|
||||||
+ PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version-embed` $python_libs"
|
|
||||||
elif $PKG_CONFIG --exists python-$python_version; then
|
|
||||||
PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
|
|
||||||
PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
|||||||
From b54cfe9d3d22fdd40f7015bd343df8620c983779 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Mon, 27 Mar 2017 11:47:01 +0100
|
|
||||||
Subject: [PATCH] Resolves: rhbz#1432468 disable opencl by default
|
|
||||||
|
|
||||||
Change-Id: Ie037fcabdd219f195425979dd721501fb5527573
|
|
||||||
---
|
|
||||||
officecfg/registry/schema/org/openoffice/Office/Common.xcs | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
|
|
||||||
index 946bd32..284d694 100644
|
|
||||||
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
|
|
||||||
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
|
|
||||||
@@ -5670,7 +5670,7 @@
|
|
||||||
<desc>Determines whether OpenCL can be used, when available, to speed up
|
|
||||||
some operations.</desc>
|
|
||||||
</info>
|
|
||||||
- <value>true</value>
|
|
||||||
+ <value>false</value>
|
|
||||||
</prop>
|
|
||||||
<prop oor:name="OpenCLBlackList" oor:type="oor:string-list" oor:nillable="false">
|
|
||||||
<!-- UIHints: Tools - Options General OpenCL -->
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
|||||||
From 623ad17227406b30e53436046831c43f160a6486 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Fri, 29 Mar 2019 15:23:28 +0000
|
|
||||||
Subject: [PATCH] Resolves: rhbz#1712823 prefer help strings to a11y strings
|
|
||||||
when available
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Reviewed-on: https://gerrit.libreoffice.org/69934
|
|
||||||
Tested-by: Jenkins
|
|
||||||
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
||||||
Tested-by: Caolán McNamara <caolanm@redhat.com>
|
|
||||||
(cherry picked from commit b70053ba681a9b62afd6fa700ad94256d98d8dc7)
|
|
||||||
|
|
||||||
Change-Id: I50b36f697b8dd9ff8108392d48a7050702edbfbe
|
|
||||||
---
|
|
||||||
vcl/unx/gtk3/gtk3gtkinst.cxx | 29 ++++++++++++++++++-----------
|
|
||||||
1 file changed, 18 insertions(+), 11 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
|
|
||||||
index a69e4df05806..5123db7c9f2e 100644
|
|
||||||
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
|
|
||||||
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
|
|
||||||
@@ -6514,6 +6514,13 @@ public:
|
|
||||||
return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ virtual OUString get_accessible_description() const override
|
|
||||||
+ {
|
|
||||||
+ AtkObject* pAtkObject = default_drawing_area_get_accessible(m_pWidget);
|
|
||||||
+ const char* pStr = pAtkObject ? atk_object_get_description(pAtkObject) : nullptr;
|
|
||||||
+ return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
virtual ~GtkInstanceDrawingArea() override
|
|
||||||
{
|
|
||||||
g_object_steal_data(G_OBJECT(m_pDrawingArea), "g-lo-GtkInstanceDrawingArea");
|
|
||||||
@@ -7579,16 +7586,7 @@ namespace
|
|
||||||
const ImplSVData* pSVData = ImplGetSVData();
|
|
||||||
if (pSVData->maHelpData.mbBalloonHelp)
|
|
||||||
{
|
|
||||||
- /*This is how I would prefer things to be, only a few like this though*/
|
|
||||||
- AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget);
|
|
||||||
- const char* pDesc = pAtkObject ? atk_object_get_description(pAtkObject) : nullptr;
|
|
||||||
- if (pDesc)
|
|
||||||
- {
|
|
||||||
- gtk_tooltip_set_text(tooltip, pDesc);
|
|
||||||
- return true;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /*So fallback to existing mechanism which needs help installed*/
|
|
||||||
+ /*Current mechanism which needs help installed*/
|
|
||||||
OString sHelpId = ::get_help_id(pWidget);
|
|
||||||
Help* pHelp = !sHelpId.isEmpty() ? Application::GetHelp() : nullptr;
|
|
||||||
if (pHelp)
|
|
||||||
@@ -7600,10 +7598,19 @@ namespace
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ /*This is how I would prefer things to be, only a few like this though*/
|
|
||||||
+ AtkObject* pAtkObject = gtk_widget_get_accessible(pWidget);
|
|
||||||
+ const char* pDesc = pAtkObject ? atk_object_get_description(pAtkObject) : nullptr;
|
|
||||||
+ if (pDesc && pDesc[0])
|
|
||||||
+ {
|
|
||||||
+ gtk_tooltip_set_text(tooltip, pDesc);
|
|
||||||
+ return true;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* pDesc = gtk_widget_get_tooltip_text(pWidget);
|
|
||||||
- if (pDesc)
|
|
||||||
+ if (pDesc && pDesc[0])
|
|
||||||
{
|
|
||||||
gtk_tooltip_set_text(tooltip, pDesc);
|
|
||||||
return true;
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
|||||||
From ffab9dc94dd82e71586e999175fe5172504df443 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Sun, 26 May 2019 14:18:03 +0100
|
|
||||||
Subject: [PATCH] Resolves: rhbz#1713827 protect against null ViewShell
|
|
||||||
|
|
||||||
like SfxHintId::ScAccCursorChanged does
|
|
||||||
|
|
||||||
Change-Id: I75ab2da866a345d817e39536ac966d3edf24b90a
|
|
||||||
---
|
|
||||||
.../Accessibility/AccessibleSpreadsheet.cxx | 55 ++++++++++---------
|
|
||||||
1 file changed, 29 insertions(+), 26 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
|
|
||||||
index 269379812e6f..adbf5d041d0d 100644
|
|
||||||
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
|
|
||||||
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
|
|
||||||
@@ -651,35 +651,38 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint
|
|
||||||
CommitTableModelChange(maRange.aStart.Row(), maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), AccessibleTableModelChangeType::UPDATE);
|
|
||||||
else
|
|
||||||
mbDelIns = false;
|
|
||||||
- ScViewData& rViewData = mpViewShell->GetViewData();
|
|
||||||
- ScAddress aNewCell = rViewData.GetCurPos();
|
|
||||||
- if( maActiveCell == aNewCell)
|
|
||||||
+ if (mpViewShell)
|
|
||||||
{
|
|
||||||
- ScDocument* pScDoc= GetDocument(mpViewShell);
|
|
||||||
- if (pScDoc)
|
|
||||||
+ ScViewData& rViewData = mpViewShell->GetViewData();
|
|
||||||
+ ScAddress aNewCell = rViewData.GetCurPos();
|
|
||||||
+ if( maActiveCell == aNewCell)
|
|
||||||
{
|
|
||||||
- OUString valStr(pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab()));
|
|
||||||
- if(m_strCurCellValue != valStr)
|
|
||||||
- {
|
|
||||||
- AccessibleEventObject aEvent;
|
|
||||||
- aEvent.EventId = AccessibleEventId::VALUE_CHANGED;
|
|
||||||
- mpAccCell->CommitChange(aEvent);
|
|
||||||
- m_strCurCellValue=valStr;
|
|
||||||
- }
|
|
||||||
- OUString tabName;
|
|
||||||
- pScDoc->GetName( maActiveCell.Tab(), tabName );
|
|
||||||
- if( m_strOldTabName != tabName )
|
|
||||||
+ ScDocument* pScDoc= GetDocument(mpViewShell);
|
|
||||||
+ if (pScDoc)
|
|
||||||
{
|
|
||||||
- AccessibleEventObject aEvent;
|
|
||||||
- aEvent.EventId = AccessibleEventId::NAME_CHANGED;
|
|
||||||
- OUString sOldName(ScResId(STR_ACC_TABLE_NAME));
|
|
||||||
- sOldName = sOldName.replaceFirst("%1", m_strOldTabName);
|
|
||||||
- aEvent.OldValue <<= sOldName;
|
|
||||||
- OUString sNewName(ScResId(STR_ACC_TABLE_NAME));
|
|
||||||
- sOldName = sNewName.replaceFirst("%1", tabName);
|
|
||||||
- aEvent.NewValue <<= sNewName;
|
|
||||||
- CommitChange( aEvent );
|
|
||||||
- m_strOldTabName = tabName;
|
|
||||||
+ OUString valStr(pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab()));
|
|
||||||
+ if(m_strCurCellValue != valStr)
|
|
||||||
+ {
|
|
||||||
+ AccessibleEventObject aEvent;
|
|
||||||
+ aEvent.EventId = AccessibleEventId::VALUE_CHANGED;
|
|
||||||
+ mpAccCell->CommitChange(aEvent);
|
|
||||||
+ m_strCurCellValue=valStr;
|
|
||||||
+ }
|
|
||||||
+ OUString tabName;
|
|
||||||
+ pScDoc->GetName( maActiveCell.Tab(), tabName );
|
|
||||||
+ if( m_strOldTabName != tabName )
|
|
||||||
+ {
|
|
||||||
+ AccessibleEventObject aEvent;
|
|
||||||
+ aEvent.EventId = AccessibleEventId::NAME_CHANGED;
|
|
||||||
+ OUString sOldName(ScResId(STR_ACC_TABLE_NAME));
|
|
||||||
+ sOldName = sOldName.replaceFirst("%1", m_strOldTabName);
|
|
||||||
+ aEvent.OldValue <<= sOldName;
|
|
||||||
+ OUString sNewName(ScResId(STR_ACC_TABLE_NAME));
|
|
||||||
+ sOldName = sNewName.replaceFirst("%1", tabName);
|
|
||||||
+ aEvent.NewValue <<= sNewName;
|
|
||||||
+ CommitChange( aEvent );
|
|
||||||
+ m_strOldTabName = tabName;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,507 +0,0 @@
|
|||||||
From f13d0ae5a68c3ae93d2839a1cc8ff3fe96622a6e Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
||||||
Date: Wed, 20 Mar 2019 15:41:20 +0000
|
|
||||||
Subject: [PATCH] rhbz#1690732 basic font variation support
|
|
||||||
|
|
||||||
on the fontconfig/harfbuzz/cairo drawing path for preset variations
|
|
||||||
|
|
||||||
Related: rhbz#1690732 FC_INDEX doesn't mean exactly what it used to mean
|
|
||||||
|
|
||||||
its been repurposed to hold font face variation information too
|
|
||||||
|
|
||||||
(cherry picked from commit 3681e8d8e6270912090b22445e67899bc2207e39)
|
|
||||||
|
|
||||||
Change-Id: I95ef68aecfd59687ae9aae58e01e394c83c6ea9e
|
|
||||||
---
|
|
||||||
vcl/inc/unx/fc_fontoptions.hxx | 2 +-
|
|
||||||
vcl/inc/unx/fontmanager.hxx | 6 +-
|
|
||||||
vcl/inc/unx/freetype_glyphcache.hxx | 9 +--
|
|
||||||
vcl/inc/unx/glyphcache.hxx | 8 ++-
|
|
||||||
vcl/unx/generic/fontmanager/fontconfig.cxx | 54 ++++++++++++------
|
|
||||||
vcl/unx/generic/fontmanager/fontmanager.cxx | 20 ++++++-
|
|
||||||
vcl/unx/generic/gdi/cairotextrender.cxx | 3 +-
|
|
||||||
.../generic/glyphs/freetype_glyphcache.cxx | 55 +++++++++++++++++--
|
|
||||||
vcl/unx/generic/glyphs/glyphcache.cxx | 5 +-
|
|
||||||
vcl/unx/generic/print/genpspgraphics.cxx | 3 +-
|
|
||||||
10 files changed, 129 insertions(+), 36 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/vcl/inc/unx/fc_fontoptions.hxx b/vcl/inc/unx/fc_fontoptions.hxx
|
|
||||||
index 4e21a4d28c3e..c5ea38ce4f54 100644
|
|
||||||
--- a/vcl/inc/unx/fc_fontoptions.hxx
|
|
||||||
+++ b/vcl/inc/unx/fc_fontoptions.hxx
|
|
||||||
@@ -34,7 +34,7 @@ public:
|
|
||||||
mpPattern(pPattern) {}
|
|
||||||
~FontConfigFontOptions();
|
|
||||||
|
|
||||||
- void SyncPattern(const OString& rFileName, int nFontFace, bool bEmbolden);
|
|
||||||
+ void SyncPattern(const OString& rFileName, sal_uInt32 nFontFace, sal_uInt32 nFontVariation, bool bEmbolden);
|
|
||||||
FcPattern* GetPattern() const;
|
|
||||||
static void cairo_font_options_substitute(FcPattern* pPattern);
|
|
||||||
private:
|
|
||||||
diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
|
|
||||||
index e19b5f3fc9ae..d796aba7e944 100644
|
|
||||||
--- a/vcl/inc/unx/fontmanager.hxx
|
|
||||||
+++ b/vcl/inc/unx/fontmanager.hxx
|
|
||||||
@@ -131,6 +131,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
|
|
||||||
int m_nDirectory; // atom containing system dependent path
|
|
||||||
OString m_aFontFile; // relative to directory
|
|
||||||
int m_nCollectionEntry; // 0 for regular fonts, 0 to ... for fonts stemming from collections
|
|
||||||
+ int m_nVariationEntry; // 0 for regular fonts, 0 to ... for fonts stemming from font variations
|
|
||||||
|
|
||||||
explicit PrintFont();
|
|
||||||
};
|
|
||||||
@@ -154,7 +155,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
|
|
||||||
bool analyzeSfntFile(PrintFont* pFont) const;
|
|
||||||
// finds the font id for the nFaceIndex face in this font file
|
|
||||||
// There may be multiple font ids for font collections
|
|
||||||
- fontID findFontFileID( int nDirID, const OString& rFile, int nFaceIndex ) const;
|
|
||||||
+ fontID findFontFileID(int nDirID, const OString& rFile, int nFaceIndex, int nVariationIndex) const;
|
|
||||||
|
|
||||||
// There may be multiple font ids for font collections
|
|
||||||
std::vector<fontID> findFontFileIDs( int nDirID, const OString& rFile ) const;
|
|
||||||
@@ -242,6 +243,9 @@ public:
|
|
||||||
// get the ttc face number
|
|
||||||
int getFontFaceNumber( fontID nFontID ) const;
|
|
||||||
|
|
||||||
+ // get the ttc face variation
|
|
||||||
+ int getFontFaceVariation( fontID nFontID ) const;
|
|
||||||
+
|
|
||||||
// get a specific fonts ascend
|
|
||||||
int getFontAscend( fontID nFontID ) const;
|
|
||||||
|
|
||||||
diff --git a/vcl/inc/unx/freetype_glyphcache.hxx b/vcl/inc/unx/freetype_glyphcache.hxx
|
|
||||||
index 774eec877957..3c09fe9b4157 100644
|
|
||||||
--- a/vcl/inc/unx/freetype_glyphcache.hxx
|
|
||||||
+++ b/vcl/inc/unx/freetype_glyphcache.hxx
|
|
||||||
@@ -55,10 +55,9 @@ private:
|
|
||||||
class FreetypeFontInfo
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
- FreetypeFontInfo( const FontAttributes&,
|
|
||||||
- const OString& rNativeFileName,
|
|
||||||
- int nFaceNum, sal_IntPtr nFontId);
|
|
||||||
- ~FreetypeFontInfo();
|
|
||||||
+ FreetypeFontInfo(const FontAttributes&, const OString& rNativeFileName,
|
|
||||||
+ int nFaceNum, int nFaceVariation, sal_IntPtr nFontId);
|
|
||||||
+ ~FreetypeFontInfo();
|
|
||||||
|
|
||||||
const unsigned char* GetTable( const char*, sal_uLong* pLength) const;
|
|
||||||
|
|
||||||
@@ -67,6 +66,7 @@ public:
|
|
||||||
|
|
||||||
const OString& GetFontFileName() const { return mpFontFile->GetFileName(); }
|
|
||||||
int GetFontFaceIndex() const { return mnFaceNum; }
|
|
||||||
+ int GetFontFaceVariation() const { return mnFaceVariation; }
|
|
||||||
sal_IntPtr GetFontId() const { return mnFontId; }
|
|
||||||
bool IsSymbolFont() const { return maDevFontAttributes.IsSymbolFont(); }
|
|
||||||
const FontAttributes& GetFontAttributes() const { return maDevFontAttributes; }
|
|
||||||
@@ -80,6 +80,7 @@ private:
|
|
||||||
FT_FaceRec_* maFaceFT;
|
|
||||||
FreetypeFontFile* const mpFontFile;
|
|
||||||
const int mnFaceNum;
|
|
||||||
+ const int mnFaceVariation;
|
|
||||||
int mnRefCount;
|
|
||||||
sal_IntPtr const mnFontId;
|
|
||||||
FontAttributes maDevFontAttributes;
|
|
||||||
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
|
|
||||||
index 59811d6a144a..77a764e6e058 100644
|
|
||||||
--- a/vcl/inc/unx/glyphcache.hxx
|
|
||||||
+++ b/vcl/inc/unx/glyphcache.hxx
|
|
||||||
@@ -57,9 +57,9 @@ public:
|
|
||||||
|
|
||||||
static GlyphCache& GetInstance();
|
|
||||||
|
|
||||||
- void AddFontFile(
|
|
||||||
- const OString& rNormalizedName,
|
|
||||||
- int nFaceNum, sal_IntPtr nFontId,
|
|
||||||
+ void AddFontFile(const OString& rNormalizedName,
|
|
||||||
+ int nFaceNum, int nVariantNum,
|
|
||||||
+ sal_IntPtr nFontId,
|
|
||||||
const FontAttributes&);
|
|
||||||
|
|
||||||
void AnnounceFonts( PhysicalFontCollection* ) const;
|
|
||||||
@@ -98,6 +98,7 @@ public:
|
|
||||||
|
|
||||||
const OString& GetFontFileName() const;
|
|
||||||
int GetFontFaceIndex() const;
|
|
||||||
+ int GetFontFaceVariation() const;
|
|
||||||
bool TestFont() const { return mbFaceOk;}
|
|
||||||
FT_Face GetFtFace() const;
|
|
||||||
int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
|
|
||||||
@@ -117,6 +118,7 @@ public:
|
|
||||||
|
|
||||||
FreetypeFontInstance* GetFontInstance() const { return mpFontInstance.get(); }
|
|
||||||
|
|
||||||
+ void SetFontVariationsOnHBFont(hb_font_t* pHbFace) const;
|
|
||||||
private:
|
|
||||||
friend class GlyphCache;
|
|
||||||
friend class FreetypeFontInstance;
|
|
||||||
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
|
|
||||||
index 76598746bec6..7205ef386668 100644
|
|
||||||
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
|
|
||||||
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
|
|
||||||
@@ -467,6 +467,22 @@ static void lcl_FcFontSetRemove(FcFontSet* pFSet, int i)
|
|
||||||
memmove(pFSet->fonts + i, pFSet->fonts + i + 1, nTail*sizeof(FcPattern*));
|
|
||||||
}
|
|
||||||
|
|
||||||
+namespace
|
|
||||||
+{
|
|
||||||
+ // for variable fonts, FC_INDEX has been changed such that the lower half is now the
|
|
||||||
+ // index of the font within the collection, and the upper half has been repurposed
|
|
||||||
+ // as the index within the variations
|
|
||||||
+ unsigned int GetCollectionIndex(unsigned int nEntryId)
|
|
||||||
+ {
|
|
||||||
+ return nEntryId & 0xFFFF;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ unsigned int GetVariationIndex(unsigned int nEntryId)
|
|
||||||
+ {
|
|
||||||
+ return nEntryId >> 16;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int>& o_rVisitedPaths )
|
|
||||||
{
|
|
||||||
int nFonts = 0;
|
|
||||||
@@ -487,7 +503,7 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int>& o
|
|
||||||
int weight = 0;
|
|
||||||
int width = 0;
|
|
||||||
int spacing = 0;
|
|
||||||
- int nCollectionEntry = -1;
|
|
||||||
+ int nEntryId = -1;
|
|
||||||
FcBool outline = false;
|
|
||||||
|
|
||||||
FcResult eFileRes = FcPatternGetString(pFSet->fonts[i], FC_FILE, 0, &file);
|
|
||||||
@@ -500,7 +516,7 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int>& o
|
|
||||||
FcResult eWidthRes = FcPatternGetInteger(pFSet->fonts[i], FC_WIDTH, 0, &width);
|
|
||||||
FcResult eSpacRes = FcPatternGetInteger(pFSet->fonts[i], FC_SPACING, 0, &spacing);
|
|
||||||
FcResult eOutRes = FcPatternGetBool(pFSet->fonts[i], FC_OUTLINE, 0, &outline);
|
|
||||||
- FcResult eIndexRes = FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nCollectionEntry);
|
|
||||||
+ FcResult eIndexRes = FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nEntryId);
|
|
||||||
FcResult eFormatRes = FcPatternGetString(pFSet->fonts[i], FC_FONTFORMAT, 0, &format);
|
|
||||||
|
|
||||||
if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eOutRes != FcResultMatch )
|
|
||||||
@@ -565,8 +581,9 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int>& o
|
|
||||||
else // more than one font
|
|
||||||
{
|
|
||||||
// a collection entry, get the correct index
|
|
||||||
- if( eIndexRes == FcResultMatch && nCollectionEntry != -1 )
|
|
||||||
+ if( eIndexRes == FcResultMatch && nEntryId != -1 )
|
|
||||||
{
|
|
||||||
+ int nCollectionEntry = GetCollectionIndex(nEntryId);
|
|
||||||
for (auto & font : aFonts)
|
|
||||||
{
|
|
||||||
if( font->m_nCollectionEntry == nCollectionEntry )
|
|
||||||
@@ -583,14 +600,14 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int>& o
|
|
||||||
// additional entries will be created in the cache
|
|
||||||
// if this is a new index (that is if the loop above
|
|
||||||
// ran to the end of the list)
|
|
||||||
- xUpdate->m_nCollectionEntry = nCollectionEntry;
|
|
||||||
+ xUpdate->m_nCollectionEntry = GetCollectionIndex(nEntryId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SAL_INFO(
|
|
||||||
"vcl.fonts",
|
|
||||||
"multiple fonts for file, but no index in fontconfig pattern ! (index res ="
|
|
||||||
- << eIndexRes << " collection entry = " << nCollectionEntry
|
|
||||||
+ << eIndexRes << " collection entry = " << nEntryId
|
|
||||||
<< "; file will not be used");
|
|
||||||
// we have found more than one font in this file
|
|
||||||
// but fontconfig will not tell us which index is meant
|
|
||||||
@@ -610,9 +627,9 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int>& o
|
|
||||||
if( eSlantRes == FcResultMatch )
|
|
||||||
xUpdate->m_eItalic = convertSlant(slant);
|
|
||||||
if( eStyleRes == FcResultMatch )
|
|
||||||
- {
|
|
||||||
xUpdate->m_aStyleName = OStringToOUString( OString( reinterpret_cast<char*>(style) ), RTL_TEXTENCODING_UTF8 );
|
|
||||||
- }
|
|
||||||
+ if( eIndexRes == FcResultMatch )
|
|
||||||
+ xUpdate->m_nVariationEntry = GetVariationIndex(nEntryId);
|
|
||||||
|
|
||||||
// sort into known fonts
|
|
||||||
fontID aFont = m_nNextFontID++;
|
|
||||||
@@ -933,16 +950,16 @@ void PrintFontManager::Substitute(FontSelectPattern &rPattern, OUString& rMissin
|
|
||||||
//extract the closest match
|
|
||||||
FcChar8* file = nullptr;
|
|
||||||
FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file);
|
|
||||||
- int nCollectionEntry = 0;
|
|
||||||
- FcResult eIndexRes = FcPatternGetInteger(pSet->fonts[0], FC_INDEX, 0, &nCollectionEntry);
|
|
||||||
+ int nEntryId = 0;
|
|
||||||
+ FcResult eIndexRes = FcPatternGetInteger(pSet->fonts[0], FC_INDEX, 0, &nEntryId);
|
|
||||||
if (eIndexRes != FcResultMatch)
|
|
||||||
- nCollectionEntry = 0;
|
|
||||||
+ nEntryId = 0;
|
|
||||||
if( eFileRes == FcResultMatch )
|
|
||||||
{
|
|
||||||
OString aDir, aBase, aOrgPath( reinterpret_cast<char*>(file) );
|
|
||||||
splitPath( aOrgPath, aDir, aBase );
|
|
||||||
int nDirID = getDirectoryAtom( aDir );
|
|
||||||
- fontID aFont = findFontFileID( nDirID, aBase, nCollectionEntry );
|
|
||||||
+ fontID aFont = findFontFileID(nDirID, aBase, GetCollectionIndex(nEntryId), GetVariationIndex(nEntryId));
|
|
||||||
if( aFont > 0 )
|
|
||||||
{
|
|
||||||
FastPrintFontInfo aInfo;
|
|
||||||
@@ -1060,12 +1077,13 @@ FcPattern *FontConfigFontOptions::GetPattern() const
|
|
||||||
return mpPattern;
|
|
||||||
}
|
|
||||||
|
|
||||||
-void FontConfigFontOptions::SyncPattern(const OString& rFileName, int nIndex, bool bEmbolden)
|
|
||||||
+void FontConfigFontOptions::SyncPattern(const OString& rFileName, sal_uInt32 nIndex, sal_uInt32 nVariation, bool bEmbolden)
|
|
||||||
{
|
|
||||||
FcPatternDel(mpPattern, FC_FILE);
|
|
||||||
FcPatternAddString(mpPattern, FC_FILE, reinterpret_cast<FcChar8 const *>(rFileName.getStr()));
|
|
||||||
FcPatternDel(mpPattern, FC_INDEX);
|
|
||||||
- FcPatternAddInteger(mpPattern, FC_INDEX, nIndex);
|
|
||||||
+ sal_uInt32 nFcIndex = (nVariation << 16) | nIndex;
|
|
||||||
+ FcPatternAddInteger(mpPattern, FC_INDEX, nFcIndex);
|
|
||||||
FcPatternDel(mpPattern, FC_EMBOLDEN);
|
|
||||||
FcPatternAddBool(mpPattern, FC_EMBOLDEN, bEmbolden ? FcTrue : FcFalse);
|
|
||||||
}
|
|
||||||
@@ -1145,16 +1163,18 @@ void PrintFontManager::matchFont( FastPrintFontInfo& rInfo, const css::lang::Loc
|
|
||||||
//extract the closest match
|
|
||||||
FcChar8* file = nullptr;
|
|
||||||
FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file);
|
|
||||||
- int nCollectionEntry = 0;
|
|
||||||
- FcResult eIndexRes = FcPatternGetInteger(pSet->fonts[0], FC_INDEX, 0, &nCollectionEntry);
|
|
||||||
+ int nEntryId = 0;
|
|
||||||
+ FcResult eIndexRes = FcPatternGetInteger(pSet->fonts[0], FC_INDEX, 0, &nEntryId);
|
|
||||||
if (eIndexRes != FcResultMatch)
|
|
||||||
- nCollectionEntry = 0;
|
|
||||||
+ nEntryId = 0;
|
|
||||||
if( eFileRes == FcResultMatch )
|
|
||||||
{
|
|
||||||
OString aDir, aBase, aOrgPath( reinterpret_cast<char*>(file) );
|
|
||||||
splitPath( aOrgPath, aDir, aBase );
|
|
||||||
int nDirID = getDirectoryAtom( aDir );
|
|
||||||
- fontID aFont = findFontFileID( nDirID, aBase, nCollectionEntry );
|
|
||||||
+ fontID aFont = findFontFileID(nDirID, aBase,
|
|
||||||
+ GetCollectionIndex(nEntryId),
|
|
||||||
+ GetVariationIndex(nEntryId));
|
|
||||||
if( aFont > 0 )
|
|
||||||
getFontFastInfo( aFont, rInfo );
|
|
||||||
}
|
|
||||||
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
|
|
||||||
index 394c5484a5bd..16e8b786dc88 100644
|
|
||||||
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
|
|
||||||
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
|
|
||||||
@@ -108,6 +108,7 @@ PrintFontManager::PrintFont::PrintFont()
|
|
||||||
, m_nYMax(0)
|
|
||||||
, m_nDirectory(0)
|
|
||||||
, m_nCollectionEntry(0)
|
|
||||||
+, m_nVariationEntry(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -278,7 +279,7 @@ std::vector<std::unique_ptr<PrintFontManager::PrintFont>> PrintFontManager::anal
|
|
||||||
return aNewFonts;
|
|
||||||
}
|
|
||||||
|
|
||||||
-fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile, int nFaceIndex ) const
|
|
||||||
+fontID PrintFontManager::findFontFileID(int nDirID, const OString& rFontFile, int nFaceIndex, int nVariationIndex) const
|
|
||||||
{
|
|
||||||
fontID nID = 0;
|
|
||||||
|
|
||||||
@@ -293,7 +294,9 @@ fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile, i
|
|
||||||
continue;
|
|
||||||
PrintFont* const pFont = (*it).second.get();
|
|
||||||
if (pFont->m_nDirectory == nDirID &&
|
|
||||||
- pFont->m_aFontFile == rFontFile && pFont->m_nCollectionEntry == nFaceIndex)
|
|
||||||
+ pFont->m_aFontFile == rFontFile &&
|
|
||||||
+ pFont->m_nCollectionEntry == nFaceIndex &&
|
|
||||||
+ pFont->m_nVariationEntry == nVariationIndex)
|
|
||||||
{
|
|
||||||
nID = it->first;
|
|
||||||
if (nID)
|
|
||||||
@@ -838,6 +841,19 @@ int PrintFontManager::getFontFaceNumber( fontID nFontID ) const
|
|
||||||
return nRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
+int PrintFontManager::getFontFaceVariation( fontID nFontID ) const
|
|
||||||
+{
|
|
||||||
+ int nRet = 0;
|
|
||||||
+ PrintFont* pFont = getFont( nFontID );
|
|
||||||
+ if (pFont)
|
|
||||||
+ {
|
|
||||||
+ nRet = pFont->m_nVariationEntry;
|
|
||||||
+ if (nRet < 0)
|
|
||||||
+ nRet = 0;
|
|
||||||
+ }
|
|
||||||
+ return nRet;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
FontFamily PrintFontManager::matchFamilyName( const OUString& rFamily )
|
|
||||||
{
|
|
||||||
typedef struct {
|
|
||||||
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
|
|
||||||
index c8956d02226b..f9e6a0a522a1 100644
|
|
||||||
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
|
|
||||||
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
|
|
||||||
@@ -408,12 +408,13 @@ void CairoTextRender::GetDevFontList( PhysicalFontCollection* pFontCollection )
|
|
||||||
|
|
||||||
// normalize face number to the GlyphCache
|
|
||||||
int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID );
|
|
||||||
+ int nVariantNum = rMgr.getFontFaceVariation( aInfo.m_nID );
|
|
||||||
|
|
||||||
// inform GlyphCache about this font provided by the PsPrint subsystem
|
|
||||||
FontAttributes aDFA = GenPspGraphics::Info2FontAttributes( aInfo );
|
|
||||||
aDFA.IncreaseQualityBy( 4096 );
|
|
||||||
const OString& rFileName = rMgr.getFontFileSysPath( aInfo.m_nID );
|
|
||||||
- rGC.AddFontFile( rFileName, nFaceNum, aInfo.m_nID, aDFA );
|
|
||||||
+ rGC.AddFontFile( rFileName, nFaceNum, nVariantNum, aInfo.m_nID, aDFA );
|
|
||||||
}
|
|
||||||
|
|
||||||
// announce glyphcache fonts
|
|
||||||
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
|
|
||||||
index 42bf6d0a98b9..1fcb0938ef77 100644
|
|
||||||
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
|
|
||||||
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
|
|
||||||
@@ -47,6 +47,7 @@
|
|
||||||
#include <ft2build.h>
|
|
||||||
#include FT_FREETYPE_H
|
|
||||||
#include FT_GLYPH_H
|
|
||||||
+#include FT_MULTIPLE_MASTERS_H
|
|
||||||
#include FT_OUTLINE_H
|
|
||||||
#include FT_SIZES_H
|
|
||||||
#include FT_SYNTHESIS_H
|
|
||||||
@@ -166,11 +167,12 @@ void FreetypeFontFile::Unmap()
|
|
||||||
}
|
|
||||||
|
|
||||||
FreetypeFontInfo::FreetypeFontInfo( const FontAttributes& rDevFontAttributes,
|
|
||||||
- const OString& rNativeFileName, int nFaceNum, sal_IntPtr nFontId)
|
|
||||||
+ const OString& rNativeFileName, int nFaceNum, int nFaceVariation, sal_IntPtr nFontId)
|
|
||||||
:
|
|
||||||
maFaceFT( nullptr ),
|
|
||||||
mpFontFile( FreetypeFontFile::FindFontFile( rNativeFileName ) ),
|
|
||||||
mnFaceNum( nFaceNum ),
|
|
||||||
+ mnFaceVariation( nFaceVariation ),
|
|
||||||
mnRefCount( 0 ),
|
|
||||||
mnFontId( nFontId ),
|
|
||||||
maDevFontAttributes( rDevFontAttributes )
|
|
||||||
@@ -194,12 +196,50 @@ FT_FaceRec_* FreetypeFontInfo::GetFaceFT()
|
|
||||||
mpFontFile->GetFileSize(), mnFaceNum, &maFaceFT );
|
|
||||||
if( (rc != FT_Err_Ok) || (maFaceFT->num_glyphs <= 0) )
|
|
||||||
maFaceFT = nullptr;
|
|
||||||
+
|
|
||||||
+ if (maFaceFT && mnFaceVariation)
|
|
||||||
+ {
|
|
||||||
+ FT_MM_Var *pFtMMVar;
|
|
||||||
+ if (FT_Get_MM_Var(maFaceFT, &pFtMMVar) == 0)
|
|
||||||
+ {
|
|
||||||
+ if (static_cast<sal_uInt32>(mnFaceVariation) <= pFtMMVar->num_namedstyles)
|
|
||||||
+ {
|
|
||||||
+ FT_Var_Named_Style *instance = &pFtMMVar->namedstyle[mnFaceVariation - 1];
|
|
||||||
+ FT_Set_Var_Design_Coordinates(maFaceFT, pFtMMVar->num_axis, instance->coords);
|
|
||||||
+ }
|
|
||||||
+ FT_Done_MM_Var(aLibFT, pFtMMVar);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
++mnRefCount;
|
|
||||||
return maFaceFT;
|
|
||||||
}
|
|
||||||
|
|
||||||
+void FreetypeFont::SetFontVariationsOnHBFont(hb_font_t* pHbFace) const
|
|
||||||
+{
|
|
||||||
+ sal_uInt32 nFaceVariation = mpFontInfo->GetFontFaceVariation();
|
|
||||||
+ if (maFaceFT && nFaceVariation)
|
|
||||||
+ {
|
|
||||||
+ FT_MM_Var *pFtMMVar;
|
|
||||||
+ if (FT_Get_MM_Var(maFaceFT, &pFtMMVar) == 0)
|
|
||||||
+ {
|
|
||||||
+ if (nFaceVariation <= pFtMMVar->num_namedstyles)
|
|
||||||
+ {
|
|
||||||
+ FT_Var_Named_Style *instance = &pFtMMVar->namedstyle[nFaceVariation - 1];
|
|
||||||
+ std::vector<hb_variation_t> aVariations(pFtMMVar->num_axis);
|
|
||||||
+ for (FT_UInt i = 0; i < pFtMMVar->num_axis; ++i)
|
|
||||||
+ {
|
|
||||||
+ aVariations[i].tag = pFtMMVar->axis[i].tag;
|
|
||||||
+ aVariations[i].value = instance->coords[i] / 65536.0;
|
|
||||||
+ }
|
|
||||||
+ hb_font_set_variations(pHbFace, aVariations.data(), aVariations.size());
|
|
||||||
+ }
|
|
||||||
+ FT_Done_MM_Var(aLibFT, pFtMMVar);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void FreetypeFontInfo::ReleaseFaceFT()
|
|
||||||
{
|
|
||||||
if (--mnRefCount <= 0)
|
|
||||||
@@ -289,8 +329,8 @@ FT_Face FreetypeFont::GetFtFace() const
|
|
||||||
return maFaceFT;
|
|
||||||
}
|
|
||||||
|
|
||||||
-void GlyphCache::AddFontFile( const OString& rNormalizedName,
|
|
||||||
- int nFaceNum, sal_IntPtr nFontId, const FontAttributes& rDevFontAttr)
|
|
||||||
+void GlyphCache::AddFontFile(const OString& rNormalizedName,
|
|
||||||
+ int nFaceNum, int nVariantNum, sal_IntPtr nFontId, const FontAttributes& rDevFontAttr)
|
|
||||||
{
|
|
||||||
if( rNormalizedName.isEmpty() )
|
|
||||||
return;
|
|
||||||
@@ -299,7 +339,7 @@ void GlyphCache::AddFontFile( const OString& rNormalizedName,
|
|
||||||
return;
|
|
||||||
|
|
||||||
FreetypeFontInfo* pFontInfo = new FreetypeFontInfo( rDevFontAttr,
|
|
||||||
- rNormalizedName, nFaceNum, nFontId);
|
|
||||||
+ rNormalizedName, nFaceNum, nVariantNum, nFontId);
|
|
||||||
m_aFontInfoList[ nFontId ].reset(pFontInfo);
|
|
||||||
if( m_nMaxFontId < nFontId )
|
|
||||||
m_nMaxFontId = nFontId;
|
|
||||||
@@ -441,7 +481,7 @@ const FontConfigFontOptions* FreetypeFont::GetFontOptions() const
|
|
||||||
if (!mxFontOptions)
|
|
||||||
{
|
|
||||||
mxFontOptions.reset(GetFCFontOptions(mpFontInfo->GetFontAttributes(), mpFontInstance->GetFontSelectPattern().mnHeight));
|
|
||||||
- mxFontOptions->SyncPattern(GetFontFileName(), GetFontFaceIndex(), NeedsArtificialBold());
|
|
||||||
+ mxFontOptions->SyncPattern(GetFontFileName(), GetFontFaceIndex(), GetFontFaceVariation(), NeedsArtificialBold());
|
|
||||||
}
|
|
||||||
return mxFontOptions.get();
|
|
||||||
}
|
|
||||||
@@ -461,6 +501,11 @@ int FreetypeFont::GetFontFaceIndex() const
|
|
||||||
return mpFontInfo->GetFontFaceIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
+int FreetypeFont::GetFontFaceVariation() const
|
|
||||||
+{
|
|
||||||
+ return mpFontInfo->GetFontFaceVariation();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
FreetypeFont::~FreetypeFont()
|
|
||||||
{
|
|
||||||
if( maSizeFT )
|
|
||||||
diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx
|
|
||||||
index b541fe1861fe..d4a32f30a521 100644
|
|
||||||
--- a/vcl/unx/generic/glyphs/glyphcache.cxx
|
|
||||||
+++ b/vcl/unx/generic/glyphs/glyphcache.cxx
|
|
||||||
@@ -298,7 +298,10 @@ static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
|
|
||||||
|
|
||||||
hb_font_t* FreetypeFontInstance::ImplInitHbFont()
|
|
||||||
{
|
|
||||||
- return InitHbFont(hb_face_create_for_tables(getFontTable, this, nullptr));
|
|
||||||
+ hb_font_t* pRet = InitHbFont(hb_face_create_for_tables(getFontTable, this, nullptr));
|
|
||||||
+ assert(mpFreetypeFont);
|
|
||||||
+ mpFreetypeFont->SetFontVariationsOnHBFont(pRet);
|
|
||||||
+ return pRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FreetypeFontInstance::ImplGetGlyphBoundRect(sal_GlyphId nId, tools::Rectangle& rRect, bool bVertical) const
|
|
||||||
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
|
|
||||||
index e40b9fd5cc82..c5675bfa3bcd 100644
|
|
||||||
--- a/vcl/unx/generic/print/genpspgraphics.cxx
|
|
||||||
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
|
|
||||||
@@ -694,9 +694,10 @@ bool GenPspGraphics::AddTempDevFontHelper( PhysicalFontCollection* pFontCollecti
|
|
||||||
aDFA.IncreaseQualityBy( 5800 );
|
|
||||||
|
|
||||||
int nFaceNum = rMgr.getFontFaceNumber( aInfo.m_nID );
|
|
||||||
+ int nVariantNum = rMgr.getFontFaceVariation( aInfo.m_nID );
|
|
||||||
|
|
||||||
const OString& rFileName = rMgr.getFontFileSysPath( aInfo.m_nID );
|
|
||||||
- rGC.AddFontFile( rFileName, nFaceNum, aInfo.m_nID, aDFA );
|
|
||||||
+ rGC.AddFontFile( rFileName, nFaceNum, nVariantNum, aInfo.m_nID, aDFA );
|
|
||||||
}
|
|
||||||
|
|
||||||
// announce new font to device's font list
|
|
||||||
--
|
|
||||||
2.21.0
|
|
||||||
|
|
Loading…
Reference in new issue