Skip to content

Commit

Permalink
Add weight, cross reference in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 11, 2024
1 parent 4a10caf commit 4a3cd5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion R/paint.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ image_fill <- function(image, color, point = "+1+1", fuzz = 0, refcolor = NULL){
#' for background color that annotation text is rendered on.
#' @param font string with font family such as `"sans"`, `"mono"`, `"serif"`,
#' `"Times"`, `"Helvetica"`, `"Trebuchet"`, `"Georgia"`, `"Palatino"` or `"Comic Sans"`.
#' See [magick_fonts()] for what is available.
#' @param style value of [style_types][style_types] for example `"italic"`
#' @param weight thickness of the font, 400 is normal and 700 is bold.
#' @param weight thickness of the font, 400 is normal and 700 is bold, see [magick_fonts()].
#' @param kerning increases or decreases whitespace between letters
#' @param decoration value of [decoration_types][decoration_types] for example `"underline"`
#' @examples # Add some text to an image
Expand Down
5 changes: 3 additions & 2 deletions man/painting.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,22 @@ Rcpp::DataFrame list_font_info(){
Rcpp::CharacterVector name(number_fonts);
Rcpp::CharacterVector family(number_fonts);
Rcpp::CharacterVector glyphs(number_fonts);
Rcpp::IntegerVector weight(number_fonts);
for (int i = 0; i < number_fonts; i++){
if(type_info[i]->name)
name[i] = type_info[i]->name;
if(type_info[i]->family)
family[i] = type_info[i]->family;
if(type_info[i]->glyphs)
glyphs[i] = type_info[i]->glyphs;
if(type_info[i]->weight)
weight[i] = type_info[i]->weight;
}
MagickCore::RelinquishMagickMemory((void *) type_info);
return Rcpp::DataFrame::create(
Rcpp::_["name"] = name,
Rcpp::_["family"] = family,
Rcpp::_["weight"] = weight,
Rcpp::_["glyphs"] = glyphs,
Rcpp::_["stringsAsFactors"] = false
);
Expand Down

0 comments on commit 4a3cd5c

Please sign in to comment.