[Libreoffice-commits] core.git: 2 commits - vcl/generic
Khaled Hosny
khaledhosny at eglug.org
Wed May 1 21:23:30 PDT 2013
vcl/generic/glyphs/gcach_layout.cxx | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
New commits:
commit 76abedd3bd1c91cac9b239f746243df00a58d060
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Thu May 2 06:19:38 2013 +0200
[harfbuzz] Fix shaping across text runs, take 2
The 3rd parameter of hb_buffer_add_utf() should be the length of the
whole text not the current run, so that HarfBuzz can take the context
into account when shaping.
Change-Id: I369deb27176cbb136de12872b8a70453d5721bea
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index d562d3b..ad93b9a 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -465,7 +465,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
hb_buffer_set_direction(pHbBuffer, bRightToLeft ? HB_DIRECTION_RTL: HB_DIRECTION_LTR);
hb_buffer_set_script(pHbBuffer, hb_icu_script_to_script(eScriptCode));
hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), -1));
- hb_buffer_add_utf16(pHbBuffer, rArgs.mpStr, nRunLen, nMinRunPos, nRunLen);
+ hb_buffer_add_utf16(pHbBuffer, rArgs.mpStr, rArgs.mnLength, nMinRunPos, nRunLen);
hb_shape(pHbFont, pHbBuffer, NULL, 0);
int nRunGlyphCount = hb_buffer_get_length(pHbBuffer);
@@ -480,15 +480,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
if (!nGlyphIndex)
{
if (nCharPos >= 0)
- {
rArgs.NeedFallback(nCharPos, bRightToLeft);
- // XXX: do we need this? HarfBuzz can take context into
- // account when shaping
- if ((nCharPos > 0) && needPreviousCode(rArgs.mpStr[nCharPos-1]))
- rArgs.NeedFallback(nCharPos-1, bRightToLeft);
- else if ((nCharPos + 1 < nEndRunPos) && needNextCode(rArgs.mpStr[nCharPos+1]))
- rArgs.NeedFallback(nCharPos+1, bRightToLeft);
- }
if (SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags)
continue;
commit 69a120ccc6a8afdb239912f9b4fbbc123e69d4ca
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Thu May 2 06:13:58 2013 +0200
Revert "[harfbuzz] Fix shaping across text runs"
This reverts commit ca0b580e2a21999d75bcd39ae5b6f81e9e42897b.
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index a849d9d..d562d3b 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -422,10 +422,8 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
((uint64_t) aFtFace->size->metrics.y_scale * (uint64_t) fUnitsPerEM) >> 16);
hb_font_set_ppem(pHbFont, aFtFace->size->metrics.x_ppem, aFtFace->size->metrics.y_ppem);
- int nTextLen = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
-
// allocate temporary arrays, note: round to even
- int nGlyphCapacity = (3 * nTextLen | 15) + 1;
+ int nGlyphCapacity = (3 * (rArgs.mnEndCharPos - rArgs.mnMinCharPos) | 15) + 1;
rLayout.Reserve(nGlyphCapacity);
@@ -467,7 +465,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
hb_buffer_set_direction(pHbBuffer, bRightToLeft ? HB_DIRECTION_RTL: HB_DIRECTION_LTR);
hb_buffer_set_script(pHbBuffer, hb_icu_script_to_script(eScriptCode));
hb_buffer_set_language(pHbBuffer, hb_language_from_string(sLanguage.getStr(), -1));
- hb_buffer_add_utf16(pHbBuffer, rArgs.mpStr, nTextLen, nMinRunPos, nRunLen);
+ hb_buffer_add_utf16(pHbBuffer, rArgs.mpStr, nRunLen, nMinRunPos, nRunLen);
hb_shape(pHbFont, pHbBuffer, NULL, 0);
int nRunGlyphCount = hb_buffer_get_length(pHbBuffer);
@@ -484,14 +482,12 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
if (nCharPos >= 0)
{
rArgs.NeedFallback(nCharPos, bRightToLeft);
-#if 0
// XXX: do we need this? HarfBuzz can take context into
// account when shaping
if ((nCharPos > 0) && needPreviousCode(rArgs.mpStr[nCharPos-1]))
rArgs.NeedFallback(nCharPos-1, bRightToLeft);
else if ((nCharPos + 1 < nEndRunPos) && needNextCode(rArgs.mpStr[nCharPos+1]))
rArgs.NeedFallback(nCharPos+1, bRightToLeft);
-#endif
}
if (SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags)
More information about the Libreoffice-commits
mailing list