Skip to content

Conversation

@sgratzl
Copy link
Member

@sgratzl sgratzl commented Nov 30, 2020

closes #110

by using the mscorefonts anaconda package

before (on my machine)

image

after: (on my machine)

image

@sgratzl sgratzl requested a review from tildechris November 30, 2020 15:22
@sgratzl sgratzl self-assigned this Nov 30, 2020
@netlify
Copy link

netlify bot commented Nov 30, 2020

Deploy preview for cmu-delphi-main ready!

Built with commit a26a8b1

https://deploy-preview-125--cmu-delphi-main.netlify.app

Copy link
Contributor

@tildechris tildechris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good on desktop and mobile. Question - how does one configure which font the svgs use? Will it just default to Arial in the future or do blog authors have to specify?

@sgratzl
Copy link
Member Author

sgratzl commented Nov 30, 2020

I haven't found a way to proper configure/specify with font to use, R seems to use https://www.rdocumentation.org/packages/gdtools/versions/0.1.1/topics/match_family to determine which font family to use depending on availability. The mscorefonts ensures that Arial is available.

@tildechris
Copy link
Contributor

So in this case, you've made sure that Arial is available and when you regenerated the svgs, match_family decided that Arial is a better choice than Dejavu sans?

@sgratzl
Copy link
Member Author

sgratzl commented Nov 30, 2020

The problem is that there are several layers on top of each other, blogdown -> R -> svglite device and I don't know a way to specify options for the lowest one. It seems like Arial is the default sans font (see also https://svglite.r-lib.org/articles/fonts.html). It wasn't used before since in a docker environment there are no fonts at all installed by default. The Anaconda environment ensures that we have the Arial font now.

Copy link
Contributor

@tildechris tildechris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the background. LGTM.

@sgratzl sgratzl merged commit 2e0be15 into dev Nov 30, 2020
@sgratzl sgratzl deleted the sgratzl/fonts branch November 30, 2020 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants