diff options
author | Jonathan Clark <jonathan@libreoffice.org> | 2024-09-25 16:07:06 -0600 |
---|---|---|
committer | Jonathan Clark <jonathan@libreoffice.org> | 2024-09-26 22:44:03 +0200 |
commit | d8f430e4bef414616fd80bbf4ea16d767991b5b9 (patch) | |
tree | c12ef8a2dbb0cf69c66e1166e5c1bfaf04575d56 /include | |
parent | 348efa75b992fe863bf85b39e5d0e71eb7ba8aba (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')
-rw-r--r-- | include/i18nutil/kashida.hxx | 4 | ||||
-rw-r--r-- | include/vcl/outdev.hxx | 3 |
2 files changed, 6 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: */ diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 8d0d0c0bf5a9..3f534c50b29a 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1171,6 +1171,9 @@ public: std::vector<sal_Int32>* pKashidaPosDropped // invalid kashida positions (out) ) const; + // tdf#163105: Get map of valid kashida positions for a single word + void GetWordKashidaPositions(const OUString& rText, std::vector<bool>* pOutMap) const; + static void BeginFontSubstitution(); static void EndFontSubstitution(); static void AddFontSubstitute( const OUString& rFontName, |