Skip to content

Commit 4a3cd5c

Browse files
committed
Add weight, cross reference in docs
1 parent 4a10caf commit 4a3cd5c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

R/paint.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ image_fill <- function(image, color, point = "+1+1", fuzz = 0, refcolor = NULL){
5555
#' for background color that annotation text is rendered on.
5656
#' @param font string with font family such as `"sans"`, `"mono"`, `"serif"`,
5757
#' `"Times"`, `"Helvetica"`, `"Trebuchet"`, `"Georgia"`, `"Palatino"` or `"Comic Sans"`.
58+
#' See [magick_fonts()] for what is available.
5859
#' @param style value of [style_types][style_types] for example `"italic"`
59-
#' @param weight thickness of the font, 400 is normal and 700 is bold.
60+
#' @param weight thickness of the font, 400 is normal and 700 is bold, see [magick_fonts()].
6061
#' @param kerning increases or decreases whitespace between letters
6162
#' @param decoration value of [decoration_types][decoration_types] for example `"underline"`
6263
#' @examples # Add some text to an image

man/painting.Rd

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/options.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,22 @@ Rcpp::DataFrame list_font_info(){
3333
Rcpp::CharacterVector name(number_fonts);
3434
Rcpp::CharacterVector family(number_fonts);
3535
Rcpp::CharacterVector glyphs(number_fonts);
36+
Rcpp::IntegerVector weight(number_fonts);
3637
for (int i = 0; i < number_fonts; i++){
3738
if(type_info[i]->name)
3839
name[i] = type_info[i]->name;
3940
if(type_info[i]->family)
4041
family[i] = type_info[i]->family;
4142
if(type_info[i]->glyphs)
4243
glyphs[i] = type_info[i]->glyphs;
44+
if(type_info[i]->weight)
45+
weight[i] = type_info[i]->weight;
4346
}
4447
MagickCore::RelinquishMagickMemory((void *) type_info);
4548
return Rcpp::DataFrame::create(
4649
Rcpp::_["name"] = name,
4750
Rcpp::_["family"] = family,
51+
Rcpp::_["weight"] = weight,
4852
Rcpp::_["glyphs"] = glyphs,
4953
Rcpp::_["stringsAsFactors"] = false
5054
);

0 commit comments

Comments
 (0)