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 - ttf2pt1.exe had status 1 #10

Closed
moritzpschwarz opened this issue Mar 8, 2021 · 11 comments · Fixed by #20
Closed

No FontName - ttf2pt1.exe had status 1 #10

moritzpschwarz opened this issue Mar 8, 2021 · 11 comments · Fixed by #20

Comments

@moritzpschwarz
Copy link

moritzpschwarz commented Mar 8, 2021

Hi there,

hoping you can help me!
I'm trying to install the attached Myriad Pro Regular.ttf (see zip file below) font using the extrafont package - but I'm getting the following error:

Scanning ttf files in C:/Users/.../AppData/Local/Microsoft/Windows/Fonts/ ...
Extracting .afm files from .ttf files...
C:\Users\...\AppData\Local\Microsoft\Windows\Fonts\Myriad Pro Bold.ttf : No FontName. Skipping.
C:\Users\...\AppData\Local\Microsoft\Windows\Fonts\Myriad Pro Regular.ttf : No FontName. Skipping.
Found FontName for 0 fonts.
Scanning afm files in C:/Users/\.../Documents/R/win-library/4.0/extrafontdb/metrics
Warning messages:
1: In system2(ttf2pt1, c(args, shQuote(ttfiles[i]), shQuote(tmpfiles[i])),  :
  running command '"C:/Users/.../Documents/R/win-library/4.0/Rttf2pt1/exec/ttf2pt1.exe" -a -G fAe "C:\Users\...\AppData\Local\Microsoft\Windows\Fonts\Myriad Pro Bold.ttf" "C:\Users\...\AppData\Local\Temp\RtmpGWMXXV/fonts/Myriad Pro Bold"' had status 1
2: In system2(ttf2pt1, c(args, shQuote(ttfiles[i]), shQuote(tmpfiles[i])),  :
  running command '"C:/Users/.../Documents/R/win-library/4.0/Rttf2pt1/exec/ttf2pt1.exe" -a -G fAe "C:\Users\...\AppData\Local\Microsoft\Windows\Fonts\Myriad Pro Regular.ttf" "C:\Users\...\AppData\Local\Temp\RtmpGWMXXV/fonts/Myriad Pro Regular"' had status 1

I traced the error and it always occurs when the extrafont function ttf_extract gets to line:

ret <- system2(ttf2pt1, c(args, shQuote(ttfiles[i]), shQuote(tmpfiles[i])), stdout = TRUE, stderr = TRUE)

I also tried running the ttf2pt1.exe -a -G fAe from the command line (with the correct path of course) and received the following error:

Auto-detected front-end parser 'ttf'
 (use ttf2pt1 -p? to get the full list of available front-ends)
Processing file C:\Users\...\AppData\Local\Microsoft\Windows\Fonts\Myriad Pro Regular.ttf
**** Unknown File Version number [4f54544f], or not a TrueType file

Any ideas on how to fix this?
Many thanks!!

@moritzpschwarz
Copy link
Author

font to replicate.zip

@leesbiology
Copy link

Had the same issue. Solved it by installing the older version of Rttf2pt1 by:

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

best,

@vankesteren
Copy link

It would be great if this were fixed at some point @wch. I would love to help but I'm really not familiar enough with the particularities. I looked around in the package if this could be an easy fix but I'm unsure.

In general, this package is used in the extrafont package only to convert ttfs to .afm files. Is there an easier to maintain alternative for that?
This seems way too simple to be true right?

pdfTex has ttf2afm. Depending on the license, that might be an alternative?
oh, nevermind, I just noticed this in the source of extrafont:

# Previously, I tried using ttf2afm to do the afm extraction,
# but the afm files created by ttf2afm didn't work with R.
# The command for ttf2afm was:
#   ttf2afm Impact.ttf -o Impact.afm

We could try to revisit this?

@wch
Copy link
Owner

wch commented Oct 27, 2021

@vankesteren Unfortunately I no longer have time to do maintenance on Rttf2pt1 or extrafont.

If someone out there would like to take over maintaining these packages, please contact me.

@fabiolexcastro
Copy link

@vankesteren Unfortunately I no longer have time to do maintenance on Rttf2pt1 or extrafont.

If someone out there would like to take over maintaining these packages, please contact me.

hi wch, I wonder how to solve this problem, I have follow these steps but it didn't work. I have this message

"No FontName. Skipping"

@sbibauw
Copy link

sbibauw commented Feb 4, 2022

@fabiolexcastro The current fix has been mentioned above:

Solved it by installing the older version of Rttf2pt1 by:
library(remotes) remotes::install_version("Rttf2pt1", version = "1.3.8")

@fabiolexcastro
Copy link

I have already done that. But it didn't solve the problem :(

@christophvw
Copy link

@wch

What about reverting:
e43996c

memory was allocated on the stack:

  •   double seg[2][2 /*X,Y*/],
    

Now uninitialized memory is used:

  • double** seg,

How should this work?

@wch
Copy link
Owner

wch commented Apr 28, 2022

I don't think the previous code allocated any memory on the stack, because seg is a parameter passed into the function.

@pmetzner
Copy link

The issue seems to be in wch/extrafont@483a125. Perhaps the enc2native call strips the information from the TTF file that is then missing?

@wch wch mentioned this issue Jan 18, 2023
@wch
Copy link
Owner

wch commented Jan 18, 2023

Hi all, I found some time and energy to look into this problem and I have a possible fix in #20.

To test it out, you can run:

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

For more information about the cause of the problem, see #19.

@wch wch closed this as completed in #20 Jan 18, 2023
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 a pull request may close this issue.

8 participants