Description: If the text contains glyphs that use level 2 fallback layout, the glyphs will be missing and the text layout will mess up. The attached document contains two lines. Two lines are identical except their formatting. The lines contain rare used Chinese characters can be completely displayed with two different fonts, MingLiU and MingLiU-Extb, as in the second line. The first line is formatted with DFKAI-SB, so it uses up to two level fallback layout. The first line can be displayed properly with Impress, which does not use DrawTextArray of outdev, and can be fixed with [1], which disabled precomputed cache items for fallback layout. [1] https://gerrit.libreoffice.org/c/core/+/116134 Steps to Reproduce: 1.Open the attached file on Windows. Actual Results: The first line of the document can not be displayed properly. Expected Results: The first line of the document can be displayed properly. Reproducible: Always User Profile Reset: No Additional Info: Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community Build ID: 14e52313e4d350d9960cdd972e87b7f206ee4e2d CPU threads: 16; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win Locale: zh-TW (zh_TW); UI: en-US Calc: CL
Created attachment 172447 [details] sample document
Created attachment 172448 [details] screenshot
Hi Luboš, I think this issue is related t0 how pre-coumputed glyph items are handled for fallback layouts, which was introduced in 7439cabc643d. OutputDevice::ImplGlyphFallbackLayout does not generate level>1 fallback because those fallback glyph items have been removed. But even if I try to force it to use pre-computed glyph items, the layout still messes up. I guess it's because the glyph item cache are not valid, after adjustment. Do you have insight about how can this fixed?
I cannot reproduce this locally. My Windows has no 'MingLiU', only 'MingLiU-ExtB', 'MingLiU-HKSCS_ExtB' and 'PMingLiU-ExtB'. Also no DFKAI-SB. I've tried downloading those and installing, but then that doesn't show the same result as you have. But the general idea is that the result should be the same whether something is cached or not. It's possible there's a bug, but I do not see it just from looking at the code. Presumably the way to test this is to debug how the code executes with the caching enabled and disabled and find the difference.
(In reply to Luboš Luňák from comment #4) > I cannot reproduce this locally. My Windows has no 'MingLiU', only > 'MingLiU-ExtB', 'MingLiU-HKSCS_ExtB' and 'PMingLiU-ExtB'. Also no DFKAI-SB. > I've tried downloading those and installing, but then that doesn't show the > same result as you have. > OK. Maybe the fallbacks depend on system locale. > But the general idea is that the result should be the same whether something > is cached or not. It's possible there's a bug, but I do not see it just from > looking at the code. Presumably the way to test this is to debug how the > code executes with the caching enabled and disabled and find the difference. Thanks. I'll check if I can identify the cause.
Mark Hung committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/10ea27faec115d4cffd6f66cee8f688399e1e0b2 tdf#142560 handle cached glpyh items in ImplGlyphFallbackLayout It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mark Hung committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/f5e565eb0dcee2d7e42180b1fd0ad12555de2a22 tdf#142560 handle cached glpyh items in ImplGlyphFallbackLayout It will be available in 7.2.0.0.beta2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
A polite ping to Mark Hung: Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing? Thanks