Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certain fonts don't work in RMarkdown #3

Closed
bhaskarvk opened this issue Feb 10, 2017 · 3 comments
Closed

Certain fonts don't work in RMarkdown #3

bhaskarvk opened this issue Feb 10, 2017 · 3 comments
Assignees

Comments

@bhaskarvk
Copy link

e.g. theme_hrbrmstr_an, I get the following warning

In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font family 'ArialNarrow' not found in PostScript font database

I tried adding

library(extrafont)
loadfonts()

Output format is markdowntemplates::bulma

@hrbrmstr
Copy link
Owner

hrm. interesting issue. shld be "fun" debugging O_o

@hrbrmstr hrbrmstr self-assigned this Feb 10, 2017
@bhaskarvk
Copy link
Author

bhaskarvk commented Feb 11, 2017

How is 'ArialNarrow' mapped to the actual font installed ?
Could it be because element_text expects family and face in two diff. arguments, while you're passing the font name in the family argument and leaving our the face argument ?

extrafont::fonttable() %>% 
  dplyr::filter(FamilyName=='Arial Narrow') %>% 
  dplyr::select(FullName, FamilyName, FontName)

                  FullName   FamilyName               FontName
1             Arial Narrow Arial Narrow            ArialNarrow
2        Arial Narrow Bold Arial Narrow       ArialNarrow-Bold
3 Arial Narrow Bold Italic Arial Narrow ArialNarrow-BoldItalic
4      Arial Narrow Italic Arial Narrow     ArialNarrow-Italic
hrbrmisc::theme_hrbrmstr_an
function (...) 
{
    theme_hrbrmstr(base_family = "ArialNarrow", plot_title_family = "ArialNarrow-Bold", 
        subtitle_family = "ArialNarrow-Italic", caption_family = "ArialNarrow", 
        ...)
}

@hrbrmstr
Copy link
Owner

Aye, try the new hrbrthemes pkg ;-)

the default is Arial Narrow but avoids the FontName shortcut in favor of explicit setting of base family and face.

I may have this in a local copy of hrbrmisc that also has more stuff in it that I'm not sharing ;-)

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

No branches or pull requests

2 participants