From e3a41d57e46e85656ba3fec56de541274da9ec91 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 4 Feb 2014 10:04:03 +0200 Subject: 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 --- vcl/generic/glyphs/gcach_layout.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vcl/generic') 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); -- cgit