From d8f430e4bef414616fd80bbf4ea16d767991b5b9 Mon Sep 17 00:00:00 2001 From: Jonathan Clark Date: Wed, 25 Sep 2024 16:07:06 -0600 Subject: 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 --- include/i18nutil/kashida.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include/i18nutil') 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 #include #include +#include namespace i18nutil { @@ -18,7 +19,8 @@ struct KashidaPosition sal_Int32 nIndex; }; -I18NUTIL_DLLPUBLIC std::optional GetWordKashidaPosition(const OUString& rWord); +I18NUTIL_DLLPUBLIC std::optional +GetWordKashidaPosition(const OUString& rWord, const std::vector& pValidPositions = {}); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit