gdtools

R utilities for graphical rendering

https://github.com/davidgohel/gdtools

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.9%) to scientific vocabulary

Keywords from Contributors

visualisation latex missing-data imputation multiple-imputation xlsx arrow parquet unit-testing rcpp
Last synced: 11 months ago · JSON representation

Repository

R utilities for graphical rendering

Basic Info
Statistics
  • Stars: 26
  • Watchers: 5
  • Forks: 15
  • Open Issues: 3
  • Releases: 0
Created almost 11 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# gdtools


[![CRAN status](https://www.r-pkg.org/badges/version/gdtools)](https://CRAN.R-project.org/package=gdtools)
[![R build status](https://github.com/davidgohel/gdtools/workflows/R-CMD-check/badge.svg)](https://github.com/davidgohel/gdtools/actions)
[![codecov test coverage](https://codecov.io/gh/davidgohel/gdtools/branch/master/graph/badge.svg)](https://app.codecov.io/gh/davidgohel/gdtools)


## Font metrics calculation

The package `gdtools` provides functionalities to get
font metrics and to generate base64 encoded string from 
raster matrix. It is used by package 'flextable' and 'rvg'
to allow font metric calculation but can also be used 
to compute the exact size a text would have with 
specific font options (size, bold, italic).

```{r}
library(gdtools)
str_extents(c("a string", "a longer string"), 
  fontsize = 24, bold = TRUE, italic = TRUE)
```

## Font management

Another set of functions is provided to support the collection 
of fonts from 'Google Fonts' in a cache. Their use is simple within 
'R Markdown' documents and 'shiny' applications but also with graphic 
productions generated with the 'ggiraph', 'ragg' and 'svglite' packages 
or with tabular productions from the 'flextable' package.

Function `register_gfont()` is used to register a font with the system.

```{r results='hide'}
# Download to a user cache and register the font with systemfonts
# no need to download the font again
register_gfont(family = "Open Sans")
```

Function `addGFontHtmlDependency()` is used to add a font to a
'html' document.

### Utility to install a font

If you need a 'Google Font' to be installed on your machine, you can use
`install_gfont_script()`. This is a rare use case but can be useful in some
specific situations, e.g. when you need to install a font on a server and make
it available to all users. It can also be useful when you are working with 
a docker image and want to install a font when the image is built.

```{r eval=FALSE}
install_gfont_script("Fira Sans", file = "firafont.sh")
```

You then have to run `./firafont.sh`.

### Font 'Liberation Sans'

If you don't have web access, you can use font 'Liberation Sans' that is
available when using this package. That can be useful when you are working
with visual tests and don't want to rely on an internet connection or when
you need a font for a 'shiny' application and or graphics produced with 
packages 'ggiraph', 'ragg' or 'svglite'.

## Installation

You can install the released version of gdtools from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("gdtools")
```

And the development version from [GitHub](https://github.com/davidgohel/gdtools) with:

``` r
# install.packages("remotes")
remotes::install_github("davidgohel/gdtools")
```

Owner

  • Name: David Gohel
  • Login: davidgohel
  • Kind: user
  • Location: Paris
  • Company: ArData

GitHub Events

Total
  • Issues event: 4
  • Delete event: 1
  • Issue comment event: 7
  • Push event: 11
  • Pull request event: 2
  • Create event: 1
Last Year
  • Issues event: 4
  • Delete event: 1
  • Issue comment event: 7
  • Push event: 11
  • Pull request event: 2
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 265
  • Total Committers: 10
  • Avg Commits per committer: 26.5
  • Development Distribution Score (DDS): 0.464
Past Year
  • Commits: 21
  • Committers: 4
  • Avg Commits per committer: 5.25
  • Development Distribution Score (DDS): 0.19
Top Committers
Name Email Commits
David Gohel d****l@a****r 142
Jeroen Ooms j****s@g****m 45
Lionel Henry l****y@g****m 40
hadley h****m@g****m 24
AshesITR r****t@y****e 4
Yixuan Qiu y****u@c****e 3
David Gohel d****l@g****m 2
Paul Murrell p****l@s****z 2
Michael Chirico c****m@g****m 2
Jeroen j****n@J****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 46
  • Total pull requests: 28
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 2 days
  • Total issue authors: 34
  • Total pull request authors: 8
  • Average comments per issue: 3.67
  • Average comments per pull request: 2.04
  • Merged pull requests: 27
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 3
  • Average time to close issues: about 15 hours
  • Average time to close pull requests: about 3 hours
  • Issue authors: 4
  • Pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jeroen (5)
  • hadley (4)
  • davidgohel (3)
  • timelyportfolio (2)
  • kdalenberg (2)
  • slyrus (2)
  • vitallish (1)
  • swvanderlaan (1)
  • Melkiades (1)
  • benmadin (1)
  • jolespin (1)
  • yixuan (1)
  • CameronNemo (1)
  • Alesja (1)
  • jhk0530 (1)
Pull Request Authors
  • jeroen (13)
  • hadley (5)
  • lionel- (4)
  • Melkiades (2)
  • MichaelChirico (2)
  • yixuan (1)
  • pmur002 (1)
  • AshesITR (1)
Top Labels
Issue Labels
bug (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 70,985 last-month
  • Total docker downloads: 213,997
  • Total dependent packages: 23
    (may contain duplicates)
  • Total dependent repositories: 39
    (may contain duplicates)
  • Total versions: 40
  • Total maintainers: 1
cran.r-project.org: gdtools

Utilities for Graphical Rendering and Fonts Management

  • Versions: 31
  • Dependent Packages: 15
  • Dependent Repositories: 31
  • Downloads: 70,985 Last month
  • Docker Downloads: 213,997
Rankings
Downloads: 1.5%
Dependent packages count: 3.9%
Dependent repos count: 4.8%
Forks count: 5.3%
Average: 7.2%
Stargazers count: 10.3%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: r-gdtools
  • Versions: 9
  • Dependent Packages: 8
  • Dependent Repositories: 8
Rankings
Dependent packages count: 7.1%
Dependent repos count: 12.2%
Average: 26.8%
Forks count: 41.0%
Stargazers count: 46.8%
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • Rcpp >= 0.12.12 imports
  • systemfonts >= 0.1.1 imports
  • curl * suggests
  • fontquiver >= 0.2.0 suggests
  • htmltools * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite