R에서 pdf를 만들고 open sans로 작성된 텍스트 (예 : text () 호출로 만든)를 선택할 수 있도록하고 싶습니다.
일반적으로 pdf로 만든 텍스트를 선택할 수 있습니다.
pdf(file="NiceLFile.pdf",width=8,height=8, pointsize=10)
plot(x=c(0,1),y=c(0,1),type="n")
text(x=0.5, y=0.5, adj=c(0.5,0.5), labels="lower case l text")
dev.off()
그러나 이것은 내가 open sans를 사용하는 경우가 아닙니다.
library(showtext)
dest2 <- file.path(tempdir(), "open-sans.light.ttf")
download.file("http://ff.static.1001fonts.net/o/p/open-sans.light.ttf", dest2, mode = "wb")
font.add("light", regular = dest2)
showtext.auto()
pdf(file="ChunkyLFile.pdf",width=8,height=8, pointsize=10)
plot(x=c(0,1),y=c(0,1),type="n")
text(x=0.5, y=0.5, adj=c(0.5,0.5), family="light", labels="lower case l text")
dev.off()
텍스트를 선택 가능하게하려면 어떻게해야합니까?
Windows에서 이렇게하려면 :
그럼 당신은 할 수 있습니다
require(extrafont)
pdf(file="SelectableFile.pdf",width=8,height=8, pointsize=10, fonts=c("Open Sans Light"))
plot(x=c(0,1),y=c(0,1),type="n")
text(x=0.5, y=0.5, adj=c(0.5,0.5), family="Open Sans Light", labels="lower case l text")
dev.off()
PDF에 글꼴을 포함해야 할 수도 있습니다.
embed_fonts(file="SelectableFile.pdf",outfile ="SelectableFile.pdf")
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다