Width determination is incorrect for certain strings

Bug #1906836 reported by Michał Krassowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
r-cran-freetypeharfbuzz (Ubuntu)
New
Undecided
Unassigned

Bug Description

On Ubuntu 20.10 the string "PA" gives an incorrect width of 13.85938 rather than 13.87500 as reported in https://github.com/r-lib/vdiffr/issues/97. The problem goes away after installing the same version (0.2.5) of the freetypeharfbuzz library directly from CRAN.

To reproduce run:

R -e "freetypeharfbuzz::str_width('PA', font_size = 11)"

I discovered that rather than using the specific Liberation font ttf file the Ubuntu version symlinks to shared version of this font, which is an issue in r-cran-fontliberation, however this is not the culprit for this specific problem, because when using the correct font file the issue persist.

It seems likely that a different version of FreeType or harfbuzz may have been linked during compilation of the Ubuntu packages. This is important because:

> Unlike other tools that dynamically link to the 'Cairo' stack, 'freetypeharfbuzz' is statically linked to specific versions of the 'FreeType' and 'harfbuzz' libraries (2.9 and 1.7.6 respectively). This ensures deterministic computation of text box extents for situations where reproducible results are crucial (for instance unit tests of graphics).

Package installation details:

apt-cache policy r-cran-freetypeharfbuzz
r-cran-freetypeharfbuzz:
  Installed: 0.2.5+dfsg-2build1
  Candidate: 0.2.5+dfsg-2build1
  Version table:
 *** 0.2.5+dfsg-2build1 500
        500 http://gb.archive.ubuntu.com/ubuntu groovy/universe amd64 Packages
        100 /var/lib/dpkg/status

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.