Skip to content

Commit cd81547

Browse files
committed
fix ragg Pacifico font registering
1 parent abe0d57 commit cd81547

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

inst/apps/181-report-image/global.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ library(htmltools)
77
# Register font for use with showtext and ragg
88
# NOTE: these were downloaded via `gfonts::download_font("pacifico", "www/fonts")`
99
sysfonts::font_add("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10-
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10+
if (!"Pacifico" %in% systemfonts::system_fonts()$family) {
11+
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
12+
}
1113

1214
# Now enable showtext so that font can render with a non-ragg renderPlot()
1315
showtext::showtext_auto()

inst/apps/182-report-png/global.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ library(htmltools)
77
# Register font for use with showtext and ragg
88
# NOTE: these were downloaded via `gfonts::download_font("pacifico", "www/fonts")`
99
sysfonts::font_add("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10-
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10+
if (!"Pacifico" %in% systemfonts::system_fonts()$family) {
11+
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
12+
}
1113

1214
# Now enable showtext so that font can render with a non-ragg renderPlot()
1315
showtext::showtext_auto()

inst/apps/183-report-cairo/global.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ library(htmltools)
77
# Register font for use with showtext and ragg
88
# NOTE: these were downloaded via `gfonts::download_font("pacifico", "www/fonts")`
99
sysfonts::font_add("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10-
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10+
if (!"Pacifico" %in% systemfonts::system_fonts()$family) {
11+
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
12+
}
1113

1214
# Now enable showtext so that font can render with a non-ragg renderPlot()
1315
showtext::showtext_auto()

inst/apps/184-report-ragg/global.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ library(htmltools)
77
# Register font for use with showtext and ragg
88
# NOTE: these were downloaded via `gfonts::download_font("pacifico", "www/fonts")`
99
sysfonts::font_add("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10-
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10+
if (!"Pacifico" %in% systemfonts::system_fonts()$family) {
11+
systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
12+
}
1113

1214
# Now enable showtext so that font can render with a non-ragg renderPlot()
1315
showtext::showtext_auto()

inst/apps/185-report-theme/global.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ library(htmltools)
77
# Register font for use with showtext and ragg
88
# NOTE: these were downloaded via `gfonts::download_font("pacifico", "www/fonts")`
99
#sysfonts::font_add("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10-
#systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
10+
# if (!"Pacifico" %in% systemfonts::system_fonts()$family) {
11+
# systemfonts::register_font("Pacifico", "fonts/pacifico-v16-latin-regular.ttf")
12+
# }
1113

1214
# Now enable showtext so that font can render with a non-ragg renderPlot()
1315
#showtext::showtext_auto()

0 commit comments

Comments
 (0)