https://bugs.documentfoundation.org/show_bug.cgi?id=103403
Khaled Hosny <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]
--- Comment #7 from Khaled Hosny <[email protected]> ---
This seems to be either a bug in Graphite or its HarfBuzz integration. It seems
that on Windows we sometimes get the same advance widths despite the current
font scale. This patch should print the advance widths we are getting from
HarfBuzz:
diff --git a/vcl/source/gdi/CommonSalLayout.cxx
b/vcl/source/gdi/CommonSalLayout.cxx
index 239486e..03d08eb 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -496,6 +496,22 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs)
hb_glyph_info_t *pHbGlyphInfos =
hb_buffer_get_glyph_infos(pHbBuffer, nullptr);
hb_glyph_position_t *pHbPositions =
hb_buffer_get_glyph_positions(pHbBuffer, nullptr);
+ if (strcmp(hb_shape_plan_get_shaper(pHbPlan), "graphite2") == 0)
+ {
+#define NUM 200
+ char buf[NUM];
+ hb_buffer_serialize_glyphs(pHbBuffer, 0, std::min(2,
nRunGlyphCount),
+ buf, NUM, nullptr,
+ mpHbFont,
+ HB_BUFFER_SERIALIZE_FORMAT_JSON,
+
hb_buffer_serialize_flags_t(HB_BUFFER_SERIALIZE_FLAG_DEFAULT |
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS)
+ );
+ int nX, nY;
+ hb_font_get_scale(mpHbFont, &nX, &nY);
+ SAL_DEBUG(mrFontSelData.GetFamilyName() << "@" << nX << "x" <<
nY << " : " << buf);
+#undef NUM
+ }
+
for (int i = 0; i < nRunGlyphCount; ++i) {
int32_t nGlyphIndex = pHbGlyphInfos[i].codepoint;
int32_t nCharPos = pHbGlyphInfos[i].cluster;
There is a difference in the values we get on Windows and on Linux.
@Martin: Do you have any idea what is going on here, would it be related to the
fact that we cache the HarfBuzz font and reuse it with different scales?
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs