Open braunm opened 6 years ago
Thanks for the report. There seems to be some difficulty recognizing different font faces in a ttc file, so I would suggest using some conversion tools to unpack the ttc file first, for example https://transfonter.org/ttc-unpack.
Thanks for pointing me to transfonter. That does solve the problem as a workaround.
I have the same problem. How to access italic Chinese fonts. For example, I want italic Fangsong fonts. What should I do.
` library(showtext)
font_add("fangsong", "simfang.ttf")
showtext_auto()
pdf(file = "R001.pdf")
plot(1:10,1:10,type="n")
text(5,5, labels = "这应该是仿宋斜体",cex = 2, family="songti",font=3); # hould be italic, but they are not
dev.off() `
@TigerZhao007 As far as I know, the Fangsong font does not contain an italic font face.
I have not been able to use the bold or italic font faces included in .ttc files, where all faces are in the same file. There is no problem with using .ttf font files, where each face has a different file. I can also use the plain font face from the .ttc file. This problem occurs with pdf() and quartz() devices. I am on a Mac, with R 3.4.3 and showtext 0.5.1.
Below is an MWE, although I understand paths to fonts may be different on different systems. Just pick your favorite .ttc and .ttf fonts.
Any help would be greatly appreciated. Thanks for contributing showtext to the world.