Learn R Programming

⚠️There's a newer version (1.0.5) of this package.Take me there.

textshaping

This package is a low level package that provides advanced text shaping capabilities to graphic devices. It is based on the FriBidi and HarfBuzz libraries and provides full support for correctly shaping left-to-right, right-to-left, and bidirectional text with full support for all OpenType features such as ligatures, stylistic glyph substitutions, etc.

For an example of a package that uses textshaping to support advanced text layout see ragg.

A big thanks to Behdad Esfahbod who is the main author of both FriBidi and HarfBuzz and has been very helpful answering questions during the cause of development.

Installation

You can install textshaping from CRAN with install.packages("textshaping"). For the development version you can install it from Github with devtools:

devtools::install_github("r-lib/textshaping")

Note that you will need both the development versions of FriBidi and HarfBuzz to successfully compile it.

Code of Conduct

Please note that the textshaping project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('textshaping')

Monthly Downloads

897,553

Version

0.3.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Thomas Lin Pedersen

Last Published

June 9th, 2021

Functions in textshaping (0.3.5)

shape_text

Calculate glyph positions for strings
get_font_features

Get available OpenType features in a font
text_width

Calculate the width of a string, ignoring new-lines
textshaping-package

textshaping: Bindings to the 'HarfBuzz' and 'Fribidi' Libraries for Text Shaping