Public bug reported:

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

** Affects: r-cran-freetypeharfbuzz (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1906836

Title:
  Width determination is incorrect for certain strings

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/r-cran-freetypeharfbuzz/+bug/1906836/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to