Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8729121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:46:39+00:00 2026-06-13T08:46:39+00:00

I have a problem with typefaces and PDF-Output in R. On this windows machine

  • 0

I have a problem with typefaces and PDF-Output in R. On this windows machine there is no Helvetica and the Font used by the device seems to be Arial as you can see below.
The simple problem is, that Arial is used (as I want it to be) but editing the PDF-File it says Helvetica is used. How can I get R to write the correct Name into the PDF-file. pdf(...,family="Arial") won’t work, as this family is not known (grDevices version 2.15.1).

Or can I substitude this font in the PDF afterwards, creating a file with the font I want?

R-PDF-Output
R Output: Arial Typeface

Comparision from this Article:Arial vs. Helvetica
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:46:40+00:00Added an answer on June 13, 2026 at 8:46 am

    You need to set a new font family for use with pdf(). This requires you to have Adobe Font Metric files (*.afm files) for the fonts you wish to use. You can convert the .tty files to .afm ones or find .afm files for Arial on the interweb if you don’t already have them.

    Arial <- Type1Font(family = "Arial",
                       metrics = c("ArialMT.afm",
                                   "arial-BoldMT.afm", 
                                   "Arial-ItalicMT.afm",
                                   "Arial-BoldItalicMT.afm"))
    

    where the character vector metrics contains the paths to the relevant .afm files, The files should be specified in this order:

    1. plain face
    2. bold face
    3. italic face
    4. bold-italic face

    The you use the pdfFonts() function to add a mapping to these new fonts

    pdfFonts(Arial = Arial)
    

    where Arial is the object produced by Type1Font() earlier.

    The final step is to use the family argument in pdf() which refers to one of the existing families as defined by pdfFonts():

    pdf("testArial.pdf", family = "Arial")
    plot(1:10, 1:10)
    dev.off()
    

    I haven’t tried this as I don’t have Arial on my system nor too many .afm files lying around, but I pieced this together from several sources:

    1. Paul Murrell and Brian Ripley (2006) Non-standard fonts in PostScript and PDF graphics. R News, 6(2):41-47. PDF
    2. A posting by David L. Carlson on the R mailing list from earlier this year.

    An alternative depending on how your system is set-up is to a Cairo-based PDF device as that will use the functions of your system to identify and load fonts based simply on their name. See ?cairo_pdf and then the Cairo Fonts section of ?X11 for details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with my query on C, I’m using the oci8 driver. This
I have a problem..I use a different font,and only 1 button actually shows the
I have this problem: Well, the words in the article are ClickableSpans that change
Have problem with this code var MAIN_LOCATION = http://www.bosscaffe.com/new/; $(#gallery_page).click(function() { $('#gallery_photos').show(); getPhotos(); return
I have a problem with my custom fonts. I change it like this: @Override
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with this method in NLog library: NLog.Targets.Wrappers.AsyncTargetWrapper.ProcessPendingEvents(object state) It consume too
I have problem with setting up own font for my ListView, I don't know
I have problem thinking this trough with PHP & Mysql . I have read
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.