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

"No FontName. Skipping" during font_import() #32

Open
amackey opened this issue Oct 18, 2013 · 22 comments
Open

"No FontName. Skipping" during font_import() #32

amackey opened this issue Oct 18, 2013 · 22 comments

Comments

@amackey
Copy link

amackey commented Oct 18, 2013

e.g.:

/Library/Fonts/BigCaslon.ttf : No FontName. Skipping.

and (more spectacularly):

/Library/Fonts/Chalkduster.ttfsh: line 1: 86587 Abort trap: 6
'/Library/Frameworks/R.framework/Versions/3.0/Resources/library/Rttf2pt1/exec//ttf2pt1' -a -GfAe '/Library/Fonts/Chalkduster.ttf' '/var/folders/jd/hrv5pvps34lflzkmt6q1czsc0000gp/T//RtmpAT3LLx/fonts/Chalkduster' 2>&1
 : No FontName. Skipping.

I also received a number of warnings (this is an excerpt):

38: In readLines(fd, 30) : seek on a gzfile connection returned an internal error
39: In readLines(fd, 30) : seek on a gzfile connection returned an internal error
40: In grepl("^FamilyName", text) : input string 4 is invalid in this locale
41: In grepl("^FontName", text) : input string 4 is invalid in this locale
42: In grepl("^FullName", text) : input string 4 is invalid in this locale
43: In grepl("^Weight", text) : input string 4 is invalid in this locale

Mac OS X 10.7.5, R 3.0.1
R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] splines stats graphics grDevices utils datasets methods base

other attached packages:
[1] extrafont_0.15 devtools_1.3 NADA_1.5-5 survival_2.37-4

loaded via a namespace (and not attached):
[1] colorspace_1.2-3 dichromat_2.0-0 digest_0.6.3 evaluate_0.4.7 extrafontdb_1.0
[6] ggplot2_0.9.3.1.99 grid_3.0.1 gtable_0.1.2 httr_0.2 labeling_0.2
[11] MASS_7.3-29 memoise_0.1 munsell_0.4.2 parallel_3.0.1 plyr_1.8
[16] proto_0.3-10 RColorBrewer_1.0-5 RCurl_1.95-4.1 reshape2_1.2.2 Rttf2pt1_1.2
[21] scales_0.2.3 stringr_0.6.2 tools_3.0.1 whisker_0.3-2

@wch
Copy link
Owner

wch commented Oct 18, 2013

Unfortunately, these warnings are due to limitations in the ttf2pt1 program (the program hasn't been updated in many years) which extrafont uses via the Rttf2pt1 package.

@amackey
Copy link
Author

amackey commented Oct 18, 2013

Unfortunately, it also means I can't import the font I want using
ttf_import(), it seems to gets skipped

On Fri, Oct 18, 2013 at 12:07 PM, Winston Chang notifications@git.luolix.topwrote:

Unfortunately, these warnings are due to limitations in the ttf2pt1
program (the program hasn't been updated in many years) which extrafont
uses via the Rttf2pt1 package.


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-26608070
.

@don-reba
Copy link

Ran into the same problem. Ttf2pt1 seemed to have encoding issues. Fixed it by renaming the font with the freeware CR8 Type Light: I left all the names as they were, saved a copy of the font in a folder, and installed it with font_import(paths=<folder>).

@Jim89
Copy link

Jim89 commented Mar 31, 2017

Realise this issue is now over 3 years old, but I encountered a similar problem with a font with 'No FontName'.

Turned out the .tff file permissions were different from the other fonts on my system (Mac, for reference). Setting the font file to be rwx for the 'other' user with $ chmod +orwx [font file] fixed the issue for me.

@davidmetzlaff
Copy link

I have encountered the same issue on Windows, is there any solution to this? The file permissions are in order.

I provided further details on a Stackoverflow post

@moritzpschwarz
Copy link

I have encountered the same issue on Windows, is there any solution to this? The file permissions are in order.

I provided further details on a Stackoverflow post

I have tried to provide a workaround in the Stackoverflow post. I'm guessing that the issue is connected to a faulty .ttf file. Using the open-source software FontForge to re-save the .ttf file did the trick for me.

@beanumber
Copy link
Contributor

@moritzpschwarz I have this problem for all font files, using Ubuntu 20.04. I don't think the problem is the files themselves, as they were working with extrafont on previous version of Ubuntu and R.

@wch What are the limitations of ttf2pt1 and how could this problem resurface if the ttf2pt1 hasn't changed?

@pteridin
Copy link

Problem occuring in Windows as well. All fonts are affected as well.

@Bustami
Copy link

Bustami commented Aug 28, 2021

I was dealing with this issue on Windows 10 until yesterday.
I found this solution and now the package {extrafont} works fine.
Problem with function "font_import()" was solved this way:

library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
library(extrafont)
loadfonts(device = "win")
fonts()

@DavidZenz
Copy link

I was dealing with this issue on Windows 10 until yesterday.
I found this solution and now the package {extrafont} works fine.
Problem with function "font_import()" was solved this way:

library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
library(extrafont)
loadfonts(device = "win")
fonts()

worked for me too, but you will have to add

import_fonts() before loadfonts(device = "win")

@Romain-B
Copy link

Romain-B commented Sep 15, 2021

library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")

worked fine for me as well, on Unix (R v4.1.1).

Thanks for the fix @Bustami !

@Stan1778
Copy link

I was dealing with this issue on Windows 10 until yesterday.
I found this solution and now the package {extrafont} works fine.
Problem with function "font_import()" was solved this way:
library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
library(extrafont)
loadfonts(device = "win")
fonts()

worked for me too, but you will have to add

import_fonts() before loadfonts(device = "win")

I tried these recommendations on a mac (iOS 10.15.7). Didn't work for me.

@psychtek
Copy link

I was dealing with this issue on Windows 10 until yesterday.
I found this solution and now the package {extrafont} works fine.
Problem with function "font_import()" was solved this way:
library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
library(extrafont)
loadfonts(device = "win")
fonts()

worked for me too, but you will have to add
import_fonts() before loadfonts(device = "win")

I tried these recommendations on a mac (iOS 10.15.7). Didn't work for me.

Having same issue today:

R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.5.2

@michaellatter
Copy link

Try the showtext package for adding fonts to r, its an alternative to extrafont that I have had a lot more success with.

https://cran.rstudio.com/web/packages/showtext/vignettes/introduction.html

@mabuimo
Copy link

mabuimo commented Sep 28, 2021

I have the same problems in Windows.

require(extrafontdb)
require(Rttf2pt1)
library(extrafont)
font_import()

And I always get this message for all fonts:
C:\Windows\Fonts\ARIALNBI.TTF : No FontName. Skipping.

@clairerichardsRN
Copy link

clairerichardsRN commented Sep 30, 2021

I'm having the same problems and I had to install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/ first
And I followed the above recs and it worked. Thanks so much

@kkulbir
Copy link

kkulbir commented Oct 22, 2021

I was dealing with this issue on Windows 10 until yesterday.
I found this solution and now the package {extrafont} works fine.
Problem with function "font_import()" was solved this way:
library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
library(extrafont)
loadfonts(device = "win")
fonts()

worked for me too, but you will have to add
import_fonts() before loadfonts(device = "win")

I tried these recommendations on a mac (iOS 10.15.7). Didn't work for me.

Having same issue today:

R version 4.1.1 (2021-08-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.5.2

@psychtek Were you able to figure out a solution, I have the same issue and work on macOS Big Sur

@mvuorre
Copy link

mvuorre commented Nov 16, 2021

For those of you who have problems with this on a mac, try installing the xcode command line tools (and approve):

xcode-select --install
sudo xcodebuild -license accept

This works with extrafont 0.17 on macOS 12.0.1.

@arunktiit
Copy link

Try the showtext package for adding fonts to r, its an alternative to extrafont that I have had a lot more success with.

https://cran.rstudio.com/web/packages/showtext/vignettes/introduction.html

The suggestion above by @michaellatter works seamlessly! I work with Mac OS Monterey 12.0.1. Thank you.

@robbienukes
Copy link

robbienukes commented Sep 28, 2022

I was dealing with this issue on Windows 10 until yesterday.
I found this solution and now the package {extrafont} works fine.
Problem with function "font_import()" was solved this way:
library(remotes)
remotes::install_version("Rttf2pt1", version = "1.3.8")
library(extrafont)
loadfonts(device = "win")
fonts()

worked for me too, but you will have to add

import_fonts() before loadfonts(device = "win")

This worked for me but I had to use font_import() before loadfonts(device = "win") instead of import_fonts()

Using Windows 11

@wch
Copy link
Owner

wch commented Jan 18, 2023

I have a possible fix in the Rttf2pt1 package (wch/Rttf2pt1#20). If you would like to try it out, please install this build of Rttf2pt1 the following and let me know how it goes:

library(remotes)
remotes::install_github("wch/Rttf2pt1#20")

@sjewo
Copy link

sjewo commented Jan 18, 2023

Thank you very much for fixing this issue!

The fix works for me on
R version 4.2.2 (2022-10-31)
MacOS 13.1, Apple M1

A strange observation for a pdf export: The "preview" application on Mac OS X does not use the correct fonts, while Inkscape (and poppler) display the plot correctly.

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