找回密码
 注册
查看: 3346|回复: 0

R语言:Hershey()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 20:15:18 | 显示全部楼层 |阅读模式
Hershey(grDevices)
Hershey()所属R语言包:grDevices

                                        Hershey Vector Fonts in R
                                         赫尔希研发的矢量字体

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

If the family graphical parameter (see par) has been set to one of the Hershey fonts (see "Details") Hershey vector fonts are used to render text.
如果family图形参数(见par)已设置为Hershey字体(见“详细资料”),赫尔希矢量字体是用于渲染文本。

When using the text and contour functions Hershey fonts may be selected via the vfont argument, which is a character vector of length 2 (see "Details" for valid values).  This allows Cyrillic to be selected, which is not available via the font families.
当使用text和contour功能Hershey字体可通过vfont的说法,这是一个长度为2的特征向量(有效值看到“详细资料”)的选择。这使得西里尔被选中,这是不通过字体家庭。


用法----------Usage----------


Hershey



Details

详情----------Details----------

The Hershey fonts have two advantages:<br>
Hershey字体有两个好处:参考

vector fonts describe each character in terms of a set of points;  R renders the character by joining up the points with straight lines.  This intimate knowledge of the outline of each character means that R can arbitrarily transform the characters, which can mean that the vector fonts look better for rotated text.
矢量字体描述了每个字符中的一组点,R呈现加入点与直线的字符。这成竹在胸意味着每个字符的轮廓,R可以随意变换的字符,这可能意味着旋转的文本,矢量字体看起来更好。

this implementation was adapted from the GNU libplot library which provides support for non-ASCII and non-English fonts.  This means that it is possible, for example, to produce weird plotting symbols and Japanese characters.
实施适应从的GNU libplot库提供支持非ASCII和非英文字体。这意味着,这是可能的,例如,产生怪异的策划符号和日文字符。

Drawback:<br> You cannot use mathematical expressions (plotmath) with Hershey fonts.
缺点:参考不能使用数学表达式(plotmath)与Hershey字体。

The Hershey characters are organised into a set of fonts.  A particular font is selected by specifying one of the following font families via par(family) and specifying the desired font face (plain, bold, italic, bold-italic) via par(font).
赫尔希字符被组织成一套字体。通过par(family)指定下面的字体家族之一,并指定所需的字体(普通,粗体,斜体,粗体斜体)通过par(font)选择一个特定的字体。

In the vfont specification for the text and contour functions, the Hershey font is specified by a typeface (e.g., serif or sans serif) and a fontindex or "style" (e.g., plain or italic). The first element of vfont specifies the typeface and the second element specifies the fontindex.  The first table produced by demo(Hershey) shows the character a produced by each of the different fonts.
vfont和text功能规范contour,赫尔希字体(例如,serif或sans serif)和fontindex,或指定一个字体“风格”(例如,plain或italic)。 vfont的第一个元素指定的字体和第二个元素指定fontindex。 demo(Hershey)生产的第一个表显示的字符a每一个不同的字体制作。

The available typeface and fontindex values are available as list components of the variable Hershey. The allowed pairs for (typeface, fontindex) are:  
可用typeface和fontindex值作为变量Hershey列表组件。 (typeface, fontindex)允许对是:

and the indices of these are available as Hershey$allowed.
这些指数是可用Hershey$allowed。




Escape sequences: The string to be drawn can include escape sequences, which all begin with a \.   When R encounters a \, rather than drawing the \, it treats the subsequent character(s) as a coded description of what to draw.
转义序列:要绘制的字符串可以包含转义序列,这一切开始\。当R遇到\,而不是绘制\,它把编码描述了要画什么,随后的字符(S)。

One useful escape sequence (in the current context) is of the form: \123.  The three digits following the \ specify an octal code for a character.  For example, the octal code for p is 160 so the strings "p" and "\160" are equivalent. This is useful for producing characters when there is not an appropriate key on your keyboard.
一个有用的转义序列(在目前情况下)的形式是:\123。 \指定字符的八进制代码的后三位数字。例如,p八进制代码是160,所以字符串"p"和"\160"是等价的。这是有用的生产字符时,没有适当的键在键盘上。

The other useful escape sequences all begin with \\. These are described below.  Remember that backslashes have to be doubled in R character strings, so they need to be entered with four backslashes.
其他有用的转义序列都开始用\\。这些都说明如下。请记住,反斜杠必须在R字符串一倍,所以他们需要输入四个反斜杠。




Symbols: an entire string of Greek symbols can be produced by selecting the HersheySymbol or HersheySansSymbol family or the Serif Symbol or Sans Serif Symbol typeface.  To allow Greek symbols to be embedded in a string which uses a non-symbol typeface, there are a set of symbol escape sequences of the form \\ab. For example, the escape sequence \\*a produces a Greek alpha.  The second table in demo(Hershey) shows all of the symbol escape sequences and the symbols that they produce.
符号:希腊符号的整个字符串可以由选择HersheySymbol或HersheySansSymbol的家人或衬线符号或sans serif符号字体制作。为了让希腊符号被嵌入在一个字符串,它使用一个非符号字体,有一组符号转义序列形式\\ab。例如,转义序列\\*a产生一个希腊字母。在demo(Hershey)第二个表显示所有的符号转义序列和它们产生的符号。




ISO Latin-1: further escape sequences of the form \\ab are provided for producing ISO Latin-1 characters. Another option is to use the appropriate octal code.  The (non-ASCII) ISO Latin-1 characters are in the range 241...377. For example, \366 produces the character o with an umlaut. The third table in demo(Hershey) shows all of the ISO Latin-1 escape sequences.
ISO Latin-1的形式\\ab生产ISO Latin-1字符提供进一步的转义序列。另一种选择是使用适当的八进制代码。 (非ASCII)的ISO Latin-1字符,范围在241 ... 377。例如,\366生产与元音变音字元O。在demo(Hershey)第三个表显示所有的ISO Latin-1的转义序列。

These characters can be used directly.  (Characters not in Latin-1 are replaced by a dot.)
可以直接使用这些字符。 (不Latin-1字符被替换为一个点。)

Several characters are missing, c-cedilla has no cedilla and "sharp s" (U+00DF, also known as "esszett") is rendered as ss.
几个字符丢失,C-变音符号有没有变音符号和的sharp s(U+00DF,也esszett)ss呈现。




Special Characters: a set of characters are provided which do not fall into any standard font.  These can only be accessed by escape sequence.  For example, \\LI produces the zodiac sign for Libra, and \\JU produces the astronomical sign for Jupiter. The fourth table in demo(Hershey) shows all of the special character escape sequences.
特殊字符:字符集提供不属于任何标准字体。这些只能访问转义序列。例如,\\LI生产星座为天秤座,\\JU生产为木星的天文符号。第四表中的demo(Hershey)显示所有的特殊字符转义序列。




Cyrillic Characters: cyrillic characters are implemented according to the K018-R encoding, and can be used directly in such a locale using the Serif typeface and Cyrillic (or Oblique Cyrillic) fontindex.  Alternatively they can be specified via an octal code in the range 300 to 337 for lower case characters or 340 to 377 for upper case characters.  The fifth table in demo(Hershey) shows the octal codes for the available Cyrillic characters.
西里尔字符:西里尔字符是根据K018-R的编码实现,可用于直接在这样一个语言环境中使用衬线字体和西里尔(或斜西里尔)fontindex。另外,他们可以指定通过一个范围内的300进制代码为小写字符或大写字母340 377 337。第五表中的demo(Hershey)显示可用西里尔字符的八进制代码。

Cyrillic has to be selected via a ("serif", fontindex) pair rather than via a font family.
西里尔必须通过("serif", fontindex)对,而不是通过一个字体家族。




Japanese Characters: 83 Hiragana, 86 Katakana, and 603 Kanji characters are implemented according to the EUC-JP (Extended Unix Code) encoding. Each character is identified by a unique hexadecimal code. The Hiragana characters are in the range 0x2421 to 0x2473, Katakana are in the range 0x2521 to 0x2576, and Kanji are (scattered about) in the range 0x3021 to 0x6d55.
日本汉字:83平假名片假名86,603汉字字符根据EUC-JP的(扩展UNIX编码)编码实现。每个字符都确定了一个独特的十六进制代码。平假名字符范围0x2421到0x2473,片假名的范围0x2521到0x2576,汉字范围内(错落)0x3021 0x6d55。

When using the Serif typeface and EUC fontindex, these characters can be produced by a pair of octal codes.  Given the hexadecimal code (e.g., 0x2421), take the first two digits and add 0x80 and do the same to the second two digits (e.g., 0x21 and 0x24 become 0xa4 and 0xa1), then convert both to octal (e.g., 0xa4 and 0xa1 become 244 and 241).  For example, the first Hiragana character is produced by \244\241.
使用衬线字体和EUC fontindex时,这些字符可以产生一对八进制代码。由于十六进制代码(例如,0x2421),前两位和添加0x80的,做同样的第二个数字(例如,双线,0x21和0X24成为0xa4和0xA1),然后将其转换既八进制数字(例如,0xa4和0xA1成为244和241)。例如,第一平假名字符产生\244\241。

It is also possible to use the hexadecimal code directly.  This works for all non-EUC fonts by specifying an escape sequence of the form \\#J1234.  For example, the first Hiragana character is produced by \\#J2421.
它也可以直接使用的十六进制代码。这是通过指定一个转义序列形式\\#J1234所有非EUC字体。例如,第一平假名字符产生\\#J2421。

The Kanji characters may be specified in a third way, using the so-called &quot;Nelson Index&quot;, by specifying an escape sequence of the form \\#N1234.  For example, the (obsolete) Kanji for "one" is produced by \\#N0001.
在第三条道路可指定汉字字符,使用所谓的“尼尔森指数”,通过指定的形式\\#N1234转义序列。例如,一(过时)汉字是由\\#N0001。

demo(Japanese) shows the available Japanese characters.
demo(Japanese)显示日文字符。




Raw Hershey Glyphs: all of the characters in the Hershey fonts are stored in a large array.  Some characters are not accessible in any of the Hershey fonts.  These characters can only be accessed via an escape sequence of the form \\#H1234. For example, the fleur-de-lys is produced by \\#H0746. The sixth and seventh tables of demo(Hershey) shows all of the available raw glyphs.
原料赫尔希字形:在Hershey字体的所有字符都储存在一个大数组。有些字符不是任何Hershey字体访问。这些字符只能通过访问的形式\\#H1234转义序列。例如,芙蓉-DE-赖氨酸生产\\#H0746。 demo(Hershey)第六届和第七届表显示所有可用的原始字形。


参考文献----------References----------



参见----------See Also----------

demo(Hershey), par, text, contour.
demo(Hershey),par,text,contour。

Japanese for the Japanese characters in the Hershey fonts.
JapaneseHershey字体的日文字符。


举例----------Examples----------


Hershey

## for tables of examples, see demo(Hershey)[#表的例子,演示(贺喜)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-24 16:30 , Processed in 0.029983 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表