Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e68a474
Showing
28 changed files
with
14,032 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.Rproj.user | ||
.Rhistory | ||
.RData |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Package: showtext | ||
Type: Package | ||
Title: Enable (any) R graphics devices to show text using (almost) any fonts | ||
Version: 0.1 | ||
Date: 2013-12-07 | ||
Author: Yixuan Qiu and authors/contributors of the | ||
WenQuanYi Micro Hei font. See file AUTHORS for details. | ||
Maintainer: Yixuan Qiu <yixuan.qiu@cos.name> | ||
Description: This package can override text drawing functions of many | ||
R graphics devices (such as png(), pdf(), etc.), so that texts | ||
will be converted to pure curves and thus device independent. | ||
This will be helpful in situations where the device doesn't | ||
(well) support drawing Unicode characters (Chinese characters in | ||
pdf device, for example). | ||
Depends: R2SWF (>= 0.7) | ||
SystemRequirements: zlib, libpng, FreeType | ||
URL: https://github.com/yixuan/showtext | ||
BugReports: https://github.com/yixuan/showtext/issues | ||
License: Apache License (>= 2.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export(showtext.begin, showtext.end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CHANGES IN showtext VERSION 0.1 | ||
|
||
NEW FEATURES | ||
|
||
o Initial release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# environment to store several important variables | ||
.pkg.env = new.env(); | ||
|
||
# use font.add() to add default font | ||
.add.default.font = function() | ||
{ | ||
lib.loc = if("showtext" %in% loadedNamespaces()) | ||
dirname(getNamespaceInfo("showtext", "path")) | ||
else NULL; | ||
|
||
wqy.r = system.file("fonts", "wqy-microhei.ttc", | ||
package = "showtext", lib.loc = lib.loc); | ||
|
||
if("R2SWF" %in% loadedNamespaces()) | ||
{ | ||
font.add("wqy", wqy.r); | ||
} else { | ||
stop("package R2SWF is not loaded"); | ||
} | ||
|
||
invisible(NULL); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
showtext.begin = function(nseg = 10L) | ||
{ | ||
if(dev.cur() == 1) stop("no active graphics device"); | ||
if(nseg <= 0) stop("nseg must be positive"); | ||
if(nseg > 100) stop("nseg too large"); | ||
|
||
.pkg.env$.nseg = as.integer(nseg); | ||
.Call("showtextBegin", PACKAGE = "showtext"); | ||
invisible(NULL); | ||
} | ||
|
||
showtext.end = function() | ||
{ | ||
if(dev.cur() == 1) stop("no active graphics device"); | ||
|
||
.Call("showtextEnd", PACKAGE = "showtext"); | ||
invisible(NULL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.onLoad <- function(libname, pkgname) { | ||
library.dynam("showtext", pkgname, libname); | ||
.add.default.font(); | ||
.pkg.env$.outline.funs = .Call("showtextLoadOutlineFuns", | ||
PACKAGE = "showtext"); | ||
.pkg.env$.nseg = 10L; | ||
.pkg.env$.gdd.save = .Call("showtextReturnNullPointer", | ||
PACKAGE = "showtext"); | ||
.pkg.env$.dd.save = .Call("showtextLoadDevDesc", | ||
PACKAGE = "showtext"); | ||
} | ||
|
||
.onUnload <- function(libpath) { | ||
.Call("showtextCleanOutlineFuns", .pkg.env$.outline.funs, | ||
PACKAGE = "showtext"); | ||
.Call("showtextCleanDevDesc", .pkg.env$.dd.save, | ||
PACKAGE = "showtext"); | ||
library.dynam.unload("showtext", libpath); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
The WenQuanYi Micro Hei font included in the fonts/ subdirectory | ||
is maintained by Qianqian Fang, and contributed by many other users. | ||
See fonts/AUTHORS.txt for a detailed contributed list. | ||
|
||
Other part of this package is written by Yixuan Qiu. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
showtext includes the WenQuanYi Micro Hei font file, with copyrights: | ||
Digitized data copyright © 2007, Google Corporation. | ||
|
||
Copyright © 2008-2009, WenQuanYi Project Board of | ||
Trustees, All rights reserved. | ||
|
||
Droid Sans Fallback extension interface | ||
( http://wenq.org/index.cgi?Fontopia(cn) ), | ||
copyright © 2008-2009 mozbug and Qianqian Fang | ||
|
Oops, something went wrong.