Specifying fonts
-2023-10-06
+2023-10-11
Source:vignettes/fonts.Rmd
fonts.Rmd
Debugging font matchingmatch_font() and font_info()
functions from
systemfonts:
-systemfonts::match_font("Helvetica")
+systemfonts::match_font("Helvetica")
#> $path
#> [1] "/usr/share/fonts/opentype/urw-base35/NimbusSans-Regular.otf"
#>
@@ -264,7 +264,7 @@ Debugging font matching#>
#> $features
#> NULL
-systemfonts::font_info("Helvetica", bold = TRUE)
+systemfonts::font_info("Helvetica", bold = TRUE)
#> path index
#> 1 /usr/share/fonts/opentype/urw-base35/NimbusSans-Bold.otf 0
#> family style italic bold monospace weight width kerning color
diff --git a/articles/scaling.html b/articles/scaling.html
index 6a1aff3..b1ef62a 100644
--- a/articles/scaling.html
+++ b/articles/scaling.html
@@ -89,7 +89,7 @@ Releases
Scaling Issues
- 2023-10-06
+ 2023-10-11
Source: vignettes/scaling.Rmd
scaling.Rmd
diff --git a/index.html b/index.html
index 94dc666..28cb358 100644
--- a/index.html
+++ b/index.html
@@ -166,7 +166,7 @@ Editability
Font support
-svglite uses systemfonts for font discovery which means that all installed fonts on your system is available to use. The systemfonts foundation means that fonts registered with register_font()
or register_variant()
will also be available. If any of these contains non-standard weights or OpenType features (e.g. ligatures or tabular numerics) this will be correctly encoded in the style block. systemfonts also allows you to embed webfont @imports
in your file to ensure that the file looks as expected even on systems without the used font installed.
+svglite uses systemfonts for font discovery which means that all installed fonts on your system is available to use. The systemfonts foundation means that fonts registered with register_font()
or register_variant()
will also be available. If any of these contains non-standard weights or OpenType features (e.g. ligatures or tabular numerics) this will be correctly encoded in the style block. systemfonts also allows you to embed webfont @imports
in your file to ensure that the file looks as expected even on systems without the used font installed.
diff --git a/pkgdown.yml b/pkgdown.yml
index f5bc937..d32d1a4 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -4,7 +4,7 @@ pkgdown_sha: ~
articles:
fonts: fonts.html
scaling: scaling.html
-last_built: 2023-10-06T12:52Z
+last_built: 2023-10-11T07:13Z
urls:
reference: https://svglite.r-lib.org/reference
article: https://svglite.r-lib.org/articles
diff --git a/reference/reexports.html b/reference/reexports.html
index 12b43b8..26ffe12 100644
--- a/reference/reexports.html
+++ b/reference/reexports.html
@@ -76,7 +76,7 @@ Releases
These objects are imported from other packages. Follow the links
below to see their documentation.
- systemfonts
-
+
diff --git a/reference/svglite.html b/reference/svglite.html
index 8831fce..d0d5cc2 100644
--- a/reference/svglite.html
+++ b/reference/svglite.html
@@ -110,16 +110,16 @@ Arguments Consider using
-systemfonts::register_font()
instead. Named list of font
+systemfonts::register_font()
instead. Named list of font
names to be aliased with fonts installed on your system. If unspecified,
the R default families sans
, serif
, mono
and
symbol
are aliased to the family returned by
-font_info()
.
+font_info()
.
user_fonts
Consider using
-systemfonts::register_font()
instead. Named list of fonts to
+systemfonts::register_font()
instead. Named list of fonts to
be aliased with font files provided by the user rather than fonts properly
installed on the system. The aliases can be fonts from the fontquiver
package, strings containing a path to a font file, or a list containing
diff --git a/reference/svgstring.html b/reference/svgstring.html
index eeed7b2..e8f8c68 100644
--- a/reference/svgstring.html
+++ b/reference/svgstring.html
@@ -103,16 +103,16 @@
Arguments Consider using
-systemfonts::register_font()
instead. Named list of font
+systemfonts::register_font()
instead. Named list of font
names to be aliased with fonts installed on your system. If unspecified,
the R default families sans
, serif
, mono
and
symbol
are aliased to the family returned by
-font_info()
.
+font_info()
.
user_fonts
Consider using
-systemfonts::register_font()
instead. Named list of fonts to
+systemfonts::register_font()
instead. Named list of fonts to
be aliased with font files provided by the user rather than fonts properly
installed on the system. The aliases can be fonts from the fontquiver
package, strings containing a path to a font file, or a list containing
@@ -269,37 +269,37 @@
Examples#> </clipPath>
#> </defs>
#> <g clip-path='url(#cpNTkuMDR8Njg5Ljc2fDU5LjA0fDUwMi41Ng==)'>
-#> <circle cx='82.40' cy='486.13' r='2.70' style='stroke-width: 0.75;' />
-#> <circle cx='666.40' cy='75.47' r='2.70' style='stroke-width: 0.75;' />
-#> <circle cx='582.14' cy='256.63' r='2.70' style='stroke-width: 0.75;' />
-#> <circle cx='376.75' cy='209.20' r='2.70' style='stroke-width: 0.75;' />
-#> <circle cx='494.07' cy='383.39' r='2.70' style='stroke-width: 0.75;' />
+#> <circle cx='666.40' cy='219.56' r='2.70' style='stroke-width: 0.75;' />
+#> <circle cx='82.40' cy='412.97' r='2.70' style='stroke-width: 0.75;' />
+#> <circle cx='589.79' cy='486.13' r='2.70' style='stroke-width: 0.75;' />
+#> <circle cx='285.75' cy='75.47' r='2.70' style='stroke-width: 0.75;' />
+#> <circle cx='450.27' cy='339.97' r='2.70' style='stroke-width: 0.75;' />
#> </g>
#> <g clip-path='url(#cpMC4wMHw3MjAuMDB8MC4wMHw1NzYuMDA=)'>
-#> <line x1='102.77' y1='502.56' x2='678.58' y2='502.56' style='stroke-width: 0.75;' />
-#> <line x1='102.77' y1='502.56' x2='102.77' y2='509.76' style='stroke-width: 0.75;' />
-#> <line x1='217.93' y1='502.56' x2='217.93' y2='509.76' style='stroke-width: 0.75;' />
-#> <line x1='333.09' y1='502.56' x2='333.09' y2='509.76' style='stroke-width: 0.75;' />
-#> <line x1='448.25' y1='502.56' x2='448.25' y2='509.76' style='stroke-width: 0.75;' />
-#> <line x1='563.41' y1='502.56' x2='563.41' y2='509.76' style='stroke-width: 0.75;' />
-#> <line x1='678.58' y1='502.56' x2='678.58' y2='509.76' style='stroke-width: 0.75;' />
-#> <text x='102.77' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-1.0</text>
-#> <text x='217.93' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-0.5</text>
-#> <text x='333.09' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>0.0</text>
-#> <text x='448.25' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>0.5</text>
-#> <text x='563.41' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>1.0</text>
-#> <text x='678.58' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>1.5</text>
-#> <line x1='59.04' y1='420.84' x2='59.04' y2='85.80' style='stroke-width: 0.75;' />
-#> <line x1='59.04' y1='420.84' x2='51.84' y2='420.84' style='stroke-width: 0.75;' />
-#> <line x1='59.04' y1='337.08' x2='51.84' y2='337.08' style='stroke-width: 0.75;' />
-#> <line x1='59.04' y1='253.32' x2='51.84' y2='253.32' style='stroke-width: 0.75;' />
-#> <line x1='59.04' y1='169.56' x2='51.84' y2='169.56' style='stroke-width: 0.75;' />
-#> <line x1='59.04' y1='85.80' x2='51.84' y2='85.80' style='stroke-width: 0.75;' />
-#> <text transform='translate(41.76,420.84) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-0.5</text>
-#> <text transform='translate(41.76,337.08) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>0.0</text>
-#> <text transform='translate(41.76,253.32) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>0.5</text>
-#> <text transform='translate(41.76,169.56) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>1.0</text>
-#> <text transform='translate(41.76,85.80) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>1.5</text>
+#> <line x1='169.19' y1='502.56' x2='610.86' y2='502.56' style='stroke-width: 0.75;' />
+#> <line x1='169.19' y1='502.56' x2='169.19' y2='509.76' style='stroke-width: 0.75;' />
+#> <line x1='279.61' y1='502.56' x2='279.61' y2='509.76' style='stroke-width: 0.75;' />
+#> <line x1='390.02' y1='502.56' x2='390.02' y2='509.76' style='stroke-width: 0.75;' />
+#> <line x1='500.44' y1='502.56' x2='500.44' y2='509.76' style='stroke-width: 0.75;' />
+#> <line x1='610.86' y1='502.56' x2='610.86' y2='509.76' style='stroke-width: 0.75;' />
+#> <text x='169.19' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-2.0</text>
+#> <text x='279.61' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-1.5</text>
+#> <text x='390.02' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-1.0</text>
+#> <text x='500.44' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-0.5</text>
+#> <text x='610.86' y='528.48' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>0.0</text>
+#> <line x1='59.04' y1='474.36' x2='59.04' y2='107.50' style='stroke-width: 0.75;' />
+#> <line x1='59.04' y1='474.36' x2='51.84' y2='474.36' style='stroke-width: 0.75;' />
+#> <line x1='59.04' y1='400.99' x2='51.84' y2='400.99' style='stroke-width: 0.75;' />
+#> <line x1='59.04' y1='327.61' x2='51.84' y2='327.61' style='stroke-width: 0.75;' />
+#> <line x1='59.04' y1='254.24' x2='51.84' y2='254.24' style='stroke-width: 0.75;' />
+#> <line x1='59.04' y1='180.87' x2='51.84' y2='180.87' style='stroke-width: 0.75;' />
+#> <line x1='59.04' y1='107.50' x2='51.84' y2='107.50' style='stroke-width: 0.75;' />
+#> <text transform='translate(41.76,474.36) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-1.0</text>
+#> <text transform='translate(41.76,400.99) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='23.43px' lengthAdjust='spacingAndGlyphs'>-0.5</text>
+#> <text transform='translate(41.76,327.61) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>0.0</text>
+#> <text transform='translate(41.76,254.24) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>0.5</text>
+#> <text transform='translate(41.76,180.87) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>1.0</text>
+#> <text transform='translate(41.76,107.50) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='19.09px' lengthAdjust='spacingAndGlyphs'>1.5</text>
#> <polygon points='59.04,502.56 689.76,502.56 689.76,59.04 59.04,59.04 ' style='stroke-width: 0.75;' />
#> <text x='374.40' y='557.28' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='53.09px' lengthAdjust='spacingAndGlyphs'>rnorm(5)</text>
#> <text transform='translate(12.96,280.80) rotate(-90)' text-anchor='middle' style='font-size: 12.00px; font-family: "Liberation Sans";' textLength='53.09px' lengthAdjust='spacingAndGlyphs'>rnorm(5)</text>
diff --git a/search.json b/search.json
index 870241a..9e0f54f 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement codeofconduct@posit.co. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://svglite.r-lib.org/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://svglite.r-lib.org/articles/fonts.html","id":"system-font-aliases","dir":"Articles","previous_headings":"","what":"System font aliases","title":"Specifying fonts","text":"system_fonts takes named list font families argument. names typically correspond standard R faces can also alias non-standard families (though less useful): need support non-latin characters, choose fonts good Unicode coverage. “Arial Unicode MS” sans serif font good coverage available macOS Windows systems (latter, MS Office installed). Note font support kerning bold italic faces. Noto fontset provided Google well Han Sans family Adobe excellent coverage may available time rendering. can concern distribute SVG files Internet.","code":"fonts <- list( sans = \"Helvetica\", mono = \"Consolas\", `Times New Roman` = \"DejaVu Serif\" ) ss <- svgstring(system_fonts = fonts) plot(1:10) text(0.8, 0.8, \"Some text\", family = \"mono\") text(0.2, 0.2, \"Other text\", family = \"Times New Roman\") dev.off() ss() svglite(\"Rplots.svg\", system_fonts = list(sans = \"Arial Unicode MS\")) plot.new() text(0.5, 0.5, \"正規分布\") dev.off()"},{"path":"https://svglite.r-lib.org/articles/fonts.html","id":"user-font-aliases","dir":"Articles","previous_headings":"","what":"User font aliases","title":"Specifying fonts","text":"addition system fonts, can also provide fonts necessarily installed system (.e., fonts live user space). main reason generate reproducible SVG files different platforms can different versions font thus produce different text metrics. user_fonts arguments takes either paths font files, fonts fontquiver package, list specifies alias. Whereas system_fonts gets named list families argument, user_fonts takes named tree lists families (sans, serif, mono symbol) faces (plain, italic, bold, bolditalic, symbol): can also control font gets written font-family fields SVGs supplying list containing alias file elements: fontquiver fonts particularly useful creating reproducible SVG files. vdiffr package uses svglite fontquiver fonts create visual unit tests reliably across platforms. Liberation fontset appropriate usage features 12 combinations standard R families faces. addition fontquiver provides Symbola symbol font. function fontquiver::font_families() produces list appropriate structure can directly supplied svglite:","code":"# Using ttf files from fontquiver here, but it could be any ttf some_file <- fontquiver::font(\"Liberation\", \"Sans\", \"Regular\")$ttf other_file <- fontquiver::font(\"Liberation\", \"Sans\", \"Italic\")$ttf serif_file <- fontquiver::font(\"Liberation\", \"serif\", \"Italic\")$ttf # The outer named list contains families while the inner named list # contains faces: fonts <- list( sans = list( plain = some_file, italic = other_file ), serif = list(plain = serif_file) ) ss <- svglite(\"plot.svg\", user_fonts = fonts) plot.new() text(0.5, 0.5, \"Sans Plain text\") text(0.2, 0.2, \"Sans Italic text\", font = 3) text(0.8, 0.8, \"Serif text\", family = \"serif\") dev.off() file_with_alias <- list(alias = \"Foobar Font\", file = other_file) fonts <- list(sans = list(plain = file_with_alias)) ss <- svgstring(user_fonts = fonts) plot(1:10) text(0.5, 0.5, \"Sans text\") dev.off() ss() fonts <- fontquiver::font_families(\"Liberation\") fonts$symbol$symbol <- fontquiver::font_symbol(\"Symbola\") str(fonts, 2) svglite(\"reproducible.svg\", user_fonts = fonts) plot(1:10) dev.off()"},{"path":"https://svglite.r-lib.org/articles/fonts.html","id":"debugging-font-matching","dir":"Articles","previous_headings":"","what":"Debugging font matching","title":"Specifying fonts","text":"systemfonts package used match font family names fonts installed system. systemfonts always return valid font, requested font badly misspelled missing, default returned. test expected font matched can use match_font() font_info() functions systemfonts:","code":"systemfonts::match_font(\"Helvetica\") #> $path #> [1] \"/usr/share/fonts/opentype/urw-base35/NimbusSans-Regular.otf\" #> #> $index #> [1] 0 #> #> $features #> NULL systemfonts::font_info(\"Helvetica\", bold = TRUE) #> path index #> 1 /usr/share/fonts/opentype/urw-base35/NimbusSans-Bold.otf 0 #> family style italic bold monospace weight width kerning color #> 1 Nimbus Sans Bold FALSE TRUE FALSE bold normal FALSE FALSE #> scalable vertical n_glyphs n_sizes n_charmaps #> 1 TRUE FALSE 855 0 4 #> bbox max_ascend max_descend #> 1 -2.25000, 12.82812, -3.68750, 12.84375 8.75 -3.25 #> max_advance_width max_advance_height lineheight underline_pos #> 1 13.48438 14.40625 14.40625 -1.859375 #> underline_size #> 1 0.828125"},{"path":"https://svglite.r-lib.org/articles/scaling.html","id":"scaling-svg-outputs","dir":"Articles","previous_headings":"","what":"Scaling SVG outputs","title":"Scaling Issues","text":"SVG files produced svglite include width height properties. deliberate choice intended make easier fit fluidly SVG figure enclosing container. scaling straightforward requires understanding viewBox SVG attribute included SVGs produced svglite. property defines aspect ratio plot (well user coordinate system, see next section).","code":""},{"path":"https://svglite.r-lib.org/articles/scaling.html","id":"fluid-scaling","dir":"Articles","previous_headings":"Scaling SVG outputs","what":"Fluid scaling","title":"Scaling Issues","text":"viewBox determined width height arguments svglite’s device functions (10’’ x 8’’ default). Although dimensions supplied inches, viewBox’s user coordinate system completely unit agnostic. main effect thus determine aspect ratio. Since dimensions provided, dimensions enclosing container used instead SVG rescaled fit container (although Internet Explorer currently requires CSS tricks get behaviour, see https://tympanus.net/codrops/2014/08/19/making-svgs-responsive--css/). Aspect ratio preserved default figure scaled . details aspect ratio preserved can adjusted multiple ways via preserveAspectRatio attribute. See https://www.sarasoueidan.com/blog/svg-coordinate-systems/ information property. useful resource: https://css-tricks.com/scale-svg/","code":""},{"path":"https://svglite.r-lib.org/articles/scaling.html","id":"natural-scaling","dir":"Articles","previous_headings":"Scaling SVG outputs","what":"Natural scaling","title":"Scaling Issues","text":"Another strategy needed order scale figure make text within SVG consistent text surrounding web page. useful, instance, create consistent appearance HTML presentation. Since user coordinate system defined viewBox unitless, need map figure natural dimensions. ensure correspondence scale figure web page. mentioned , natural scale svglite’s figures points determined width height arguments supply device functions (10’’ x 8’’ default). Although dimensions specified inches, coordinate system scaled points. Counting 72 points per inch, default SVG surface thus 720 x 576 pt. Note CSS standard defines 12pt equal 16px, default size text browsers. Since 12pt default text size svglite well, SVG scaled natural dimensions appear seamless web text 16px. text web page another size, compute scale factor adjust dimensions SVG accordingly. sum , displaying plot according natural dimensions requires providing user agent information lengths defined within SVG actually mean. several ways achieve . First can edit SVG enclose another pair
-systemfonts::match_font("Helvetica")
+systemfonts::match_font("Helvetica")
#> $path
#> [1] "/usr/share/fonts/opentype/urw-base35/NimbusSans-Regular.otf"
#>
@@ -264,7 +264,7 @@ Debugging font matching#>
#> $features
#> NULL
-systemfonts::font_info("Helvetica", bold = TRUE)
+systemfonts::font_info("Helvetica", bold = TRUE)
#> path index
#> 1 /usr/share/fonts/opentype/urw-base35/NimbusSans-Bold.otf 0
#> family style italic bold monospace weight width kerning color
diff --git a/articles/scaling.html b/articles/scaling.html
index 6a1aff3..b1ef62a 100644
--- a/articles/scaling.html
+++ b/articles/scaling.html
@@ -89,7 +89,7 @@ Releases
Scaling Issues
- 2023-10-06
+ 2023-10-11
Source: vignettes/scaling.Rmd
scaling.Rmd
diff --git a/index.html b/index.html
index 94dc666..28cb358 100644
--- a/index.html
+++ b/index.html
@@ -166,7 +166,7 @@ Editability
Font support
-svglite uses systemfonts for font discovery which means that all installed fonts on your system is available to use. The systemfonts foundation means that fonts registered with register_font()
or register_variant()
will also be available. If any of these contains non-standard weights or OpenType features (e.g. ligatures or tabular numerics) this will be correctly encoded in the style block. systemfonts also allows you to embed webfont @imports
in your file to ensure that the file looks as expected even on systems without the used font installed.
+svglite uses systemfonts for font discovery which means that all installed fonts on your system is available to use. The systemfonts foundation means that fonts registered with register_font()
or register_variant()
will also be available. If any of these contains non-standard weights or OpenType features (e.g. ligatures or tabular numerics) this will be correctly encoded in the style block. systemfonts also allows you to embed webfont @imports
in your file to ensure that the file looks as expected even on systems without the used font installed.
Releases
These objects are imported from other packages. Follow the links below to see their documentation.
- systemfonts -
- +
systemfonts::register_font()
instead. Named list of font
+systemfonts::register_font()
instead. Named list of font
names to be aliased with fonts installed on your system. If unspecified,
the R default families sans
, serif
, mono
and
symbol
are aliased to the family returned by
-font_info()
.
+font_info()
.
Consider using
-systemfonts::register_font()
instead. Named list of fonts to
+systemfonts::register_font()
instead. Named list of fonts to
be aliased with font files provided by the user rather than fonts properly
installed on the system. The aliases can be fonts from the fontquiver
package, strings containing a path to a font file, or a list containing
diff --git a/reference/svgstring.html b/reference/svgstring.html
index eeed7b2..e8f8c68 100644
--- a/reference/svgstring.html
+++ b/reference/svgstring.html
@@ -103,16 +103,16 @@
Arguments Consider using
-systemfonts::register_font()
instead. Named list of font
+systemfonts::register_font()
instead. Named list of font
names to be aliased with fonts installed on your system. If unspecified,
the R default families sans
, serif
, mono
and
symbol
are aliased to the family returned by
-font_info()
.
font_info()
.
Consider using
-systemfonts::register_font()
instead. Named list of fonts to
+systemfonts::register_font()
instead. Named list of fonts to
be aliased with font files provided by the user rather than fonts properly
installed on the system. The aliases can be fonts from the fontquiver
package, strings containing a path to a font file, or a list containing
@@ -269,37 +269,37 @@