summaryrefslogtreecommitdiff
path: root/include/i18nutil
diff options
context:
space:
mode:
authorJonathan Clark <jonathan@libreoffice.org>2024-09-25 16:07:06 -0600
committerJonathan Clark <jonathan@libreoffice.org>2024-09-26 22:44:03 +0200
commitd8f430e4bef414616fd80bbf4ea16d767991b5b9 (patch)
treec12ef8a2dbb0cf69c66e1166e5c1bfaf04575d56 /include/i18nutil
parent348efa75b992fe863bf85b39e5d0e71eb7ba8aba (diff)
tdf#163105 Use HB data while selecting kashida insertion positions
Previously, Writer and Edit Engine would skip inserting kashida in words if the highest-priority candidate position is marked as invalid by HarfBuzz. This would happen even if the word contained multiple lower-ranked valid candidate positions. This change updates Writer and Edit Engine to pass HarfBuzz kashida position data to the selection algorithm. The algorithm has been updated to return the highest-priority valid position, if any. The algorithm has also been updated to use raw positions marked as valid by HarfBuzz as a fallback, if no better positions could be found. Change-Id: I40c6432c4607aee197e8767e5667db504469956a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173963 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
Diffstat (limited to 'include/i18nutil')
-rw-r--r--include/i18nutil/kashida.hxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/i18nutil/kashida.hxx b/include/i18nutil/kashida.hxx
index 54797143143c..96969ff89197 100644
--- a/include/i18nutil/kashida.hxx
+++ b/include/i18nutil/kashida.hxx
@@ -10,6 +10,7 @@
#include <i18nutil/i18nutildllapi.h>
#include <rtl/ustring.hxx>
#include <optional>
+#include <vector>
namespace i18nutil
{
@@ -18,7 +19,8 @@ struct KashidaPosition
sal_Int32 nIndex;
};
-I18NUTIL_DLLPUBLIC std::optional<KashidaPosition> GetWordKashidaPosition(const OUString& rWord);
+I18NUTIL_DLLPUBLIC std::optional<KashidaPosition>
+GetWordKashidaPosition(const OUString& rWord, const std::vector<bool>& pValidPositions = {});
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */