Usage of Source Han Serif SC

Khaled Hosny khaled at libreoffice.org
Mon Jun 26 06:58:32 UTC 2023


Hi,

> On 25 Jun 2023, at 2:16 PM, Rene Engelhard <rene at debian.org> wrote:
> 
> [_RUN_____] testTdf129810::TestBody
> file:///home/rene/LibreOffice/git/libreoffice-7-6//sw/qa/core/text/data//tdf129810.odt:
> ./sw/qa/core/text/text.cxx:1387:testTdf129810::TestBody
> greater assertion failed
> - Expected greater than: 13
> - Actual  : 13
> [...]

There seem to be a thinko in the test, it was supposed to be CPPUNIT_ASSERT_EQUAL not CPPUNIT_ASSERT_GREATER. Can you try that and see if the test passes?

I wonder why it passes for me and Jenkins builds, different cppunittest versions? 

> This should work around it:
> 
> diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
> index a4d4540ab228..46d262f6f0b8 100644
> --- a/sw/qa/core/text/text.cxx
> +++ b/sw/qa/core/text/text.cxx
> @@ -9,6 +9,8 @@
> 
> #include <swmodeltestbase.hxx>
> 
> +#include <config_fonts.h>
> +
> #include <memory>
> 
> #include <com/sun/star/text/BibliographyDataField.hpp>
> @@ -1363,6 +1365,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testParaUpperMarginFlyIntersect)
>     CPPUNIT_ASSERT_EQUAL(521, nHeight);
> }
> 
> +/* needs Source Han Serif SC*/
> +#if HAVE_MORE_FONTS

FWIW, we don’t bundle any CJK fonts, so HAVE_MORE_FONTS should have no difference here.


> But the root question is here how this ever worked? On your system it might be thgere but on the Jenkins nodes?
> Since "standard" LibreOffice builds use the stuff downloaded, but download.lst neither contains any source fonts (anymore) nor that font specifically...

The test document embeds a (subset) version of the font (there is a comment that hints to this at the top of the test) so that the test passes even on systems without any CJK fonts (and be more reliable as well, since different fonts will have different widths and result different line breaks).

Regards,
Khaled


More information about the LibreOffice mailing list