summaryrefslogtreecommitdiff
path: root/vcl/generic/glyphs/gcach_layout.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2014-02-04 10:04:03 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2014-02-05 01:31:36 +0200
commite3a41d57e46e85656ba3fec56de541274da9ec91 (patch)
tree4aadc4dd05305633e9c59cc84f9d4d35e03dced3 /vcl/generic/glyphs/gcach_layout.cxx
parent186b4ebc99a2e80740fee51f9d0276886a003617 (diff)
Set HarfBuzz buffer flags for text boundaries
If the run is the start and/or end of the whole text string being laid out, set corresponding HarfBuzz buffer flags as it will help HarfBuzz e.g. place a stray combining at the beginning of a paragraph on a dotted circle. Change-Id: I05c9fa46b251a2ce4e716da33fb6edda680d2dd1
Diffstat (limited to 'vcl/generic/glyphs/gcach_layout.cxx')
-rw-r--r--vcl/generic/glyphs/gcach_layout.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index 7f4266abdafb..9c119bb1b2fc 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -438,11 +438,18 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
if (pHbUnicodeFuncs == NULL)
pHbUnicodeFuncs = getUnicodeFuncs();
+ int nHbFlags = HB_BUFFER_FLAG_DEFAULT;
+ if (nMinRunPos == 0)
+ nHbFlags |= HB_BUFFER_FLAG_BOT; /* Beginning-of-text */
+ if (nEndRunPos == rArgs.mnLength)
+ nHbFlags |= HB_BUFFER_FLAG_EOT; /* End-of-text */
+
hb_buffer_t *pHbBuffer = hb_buffer_create();
hb_buffer_set_unicode_funcs(pHbBuffer, pHbUnicodeFuncs);
hb_buffer_set_direction(pHbBuffer, bRightToLeft ? HB_DIRECTION_RTL: HB_DIRECTION_LTR);
hb_buffer_set_script(pHbBuffer, maHbScript);
hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), -1));
+ hb_buffer_set_flags(pHbBuffer, (hb_buffer_flags_t) nHbFlags);
hb_buffer_add_utf16(pHbBuffer, rArgs.mpStr, rArgs.mnLength, nMinRunPos, nRunLen);
hb_shape(pHbFont, pHbBuffer, NULL, 0);