fonttools/Documentation/robofabDocs/robofab.gString.html
Erik van Blokland 3646055ea2 initial import
git-svn-id: http://svn.robofab.com/trunk@1 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
2008-01-07 17:40:34 +00:00

99 lines
12 KiB
HTML

<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module robofab.gString</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="robofab.html"><font color="#ffffff">robofab</font></a>.gString</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/code/projects/robofab/Lib/robofab/gString.py">/code/projects/robofab/Lib/robofab/gString.py</a></font></td></tr></table>
<p><tt>A&nbsp;bunch&nbsp;of&nbsp;stuff&nbsp;useful&nbsp;for&nbsp;glyph&nbsp;name&nbsp;comparisons&nbsp;and&nbsp;such.<br>
&nbsp;<br>
1.&nbsp;A&nbsp;group&nbsp;of&nbsp;sorted&nbsp;glyph&nbsp;name&nbsp;lists&nbsp;that&nbsp;can&nbsp;be&nbsp;called&nbsp;directly:<br>
2.&nbsp;Some&nbsp;tools&nbsp;to&nbsp;work&nbsp;with&nbsp;glyph&nbsp;names&nbsp;to&nbsp;do&nbsp;things&nbsp;like&nbsp;build&nbsp;control&nbsp;strings.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="string.html">string</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-breakSuffix"><strong>breakSuffix</strong></a>(glyphname)</dt><dd><tt>Breaks&nbsp;the&nbsp;glyphname&nbsp;into&nbsp;a&nbsp;two&nbsp;item&nbsp;list<br>
0:&nbsp;glyphname<br>
1:&nbsp;suffix<br>
&nbsp;<br>
if&nbsp;a&nbsp;suffix&nbsp;is&nbsp;not&nbsp;found&nbsp;it&nbsp;returns&nbsp;None</tt></dd></dl>
<dl><dt><a name="-controls"><strong>controls</strong></a>(glyphname)</dt><dd><tt>Send&nbsp;this&nbsp;a&nbsp;glyph&nbsp;name&nbsp;and&nbsp;get&nbsp;a&nbsp;control&nbsp;string<br>
with&nbsp;all&nbsp;glyphs&nbsp;separated&nbsp;by&nbsp;slashes.</tt></dd></dl>
<dl><dt><a name="-findAccentBase"><strong>findAccentBase</strong></a>(accentglyph)</dt><dd><tt>Return&nbsp;the&nbsp;base&nbsp;glyph&nbsp;of&nbsp;an&nbsp;accented&nbsp;glyph<br>
for&nbsp;example:&nbsp;Ugrave.sc&nbsp;returns&nbsp;U.sc</tt></dd></dl>
<dl><dt><a name="-kernControls"><strong>kernControls</strong></a>(leftglyphname, rightglyphname)</dt><dd><tt>build&nbsp;a&nbsp;control&nbsp;string&nbsp;based&nbsp;on&nbsp;the&nbsp;left&nbsp;glyph&nbsp;and&nbsp;right&nbsp;glyph</tt></dd></dl>
<dl><dt><a name="-lower"><strong>lower</strong></a>(glyphstring)</dt><dd><tt>Convert&nbsp;all&nbsp;possible&nbsp;characters&nbsp;to&nbsp;lowercase&nbsp;in&nbsp;a&nbsp;glyph&nbsp;string.</tt></dd></dl>
<dl><dt><a name="-small"><strong>small</strong></a>(glyphstring)</dt><dd><tt>Convert&nbsp;all&nbsp;possible&nbsp;characters&nbsp;to&nbsp;smallcaps&nbsp;in&nbsp;a&nbsp;glyph&nbsp;string.</tt></dd></dl>
<dl><dt><a name="-sortControlList"><strong>sortControlList</strong></a>(list)</dt><dd><tt>Roughly&nbsp;sort&nbsp;a&nbsp;list&nbsp;of&nbsp;control&nbsp;strings.</tt></dd></dl>
<dl><dt><a name="-splitAccent"><strong>splitAccent</strong></a>(accentglyph)</dt><dd><tt>Split&nbsp;an&nbsp;accented&nbsp;glyph&nbsp;into&nbsp;a&nbsp;two&nbsp;items<br>
0:&nbsp;base&nbsp;glyph<br>
1:&nbsp;accent&nbsp;list<br>
&nbsp;<br>
for&nbsp;example:&nbsp;Yacute.scalt45&nbsp;returns:&nbsp;(Y.scalt45,&nbsp;[acute])<br>
and:&nbsp;aacutetilde.alt45&nbsp;returns&nbsp;(a.alt45,&nbsp;[acute,&nbsp;tilde])</tt></dd></dl>
<dl><dt><a name="-upper"><strong>upper</strong></a>(glyphstring)</dt><dd><tt>Convert&nbsp;all&nbsp;possible&nbsp;characters&nbsp;to&nbsp;uppercase&nbsp;in&nbsp;a&nbsp;glyph&nbsp;string.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>accents</strong> = ['acute', 'acutecomb', 'breve', 'caron', 'cedilla', 'circumflex', 'commaaccent', 'dblgrave', 'dieresis', 'dieresisacute', 'dieresisacute', 'dieresisgrave', 'dieresisgrave', 'dotaccent', 'grave', 'dblgrave', 'gravecomb', 'hungarumlaut', 'macron', 'ogonek', ...]<br>
<strong>all_accents</strong> = ['Aacute', 'Abreve', 'Acaron', 'Acircumflex', 'Adblgrave', 'Adieresis', 'Agrave', 'Amacron', 'Aogonek', 'Aring', 'Aringacute', 'Atilde', 'Bdotaccent', 'Cacute', 'Ccaron', 'Ccircumflex', 'Cdotaccent', 'Dcaron', 'Dcedilla', 'Ddotaccent', ...]<br>
<strong>casedict</strong> = {'ae': 'AE', 'aeacute': 'AEacute', 'dotlessi': 'I', 'dotlessj': 'J', 'germandbls': 'S/S', 'll': 'LL', 'oe': 'OE'}<br>
<strong>casedictflip</strong> = {}<br>
<strong>controldict</strong> = {'DIGITS': ['/one/one', '/one/zero/one/zero', '/zero/zero'], 'LC': ['/n/n', '/n/o/n/o', '/o/o'], 'SC': ['/H.sc/H.sc', '/H.sc/O.sc/H.sc/O.sc', '/O.sc/O.sc'], 'UC': ['/H/H', '/H/O/H/O', '/O/O']}<br>
<strong>currency</strong> = ['dollar', 'cent', 'currency', 'Euro', 'sterling', 'yen', 'florin', 'franc', 'lira']<br>
<strong>currency_inferior</strong> = ['cent.inferior', 'dollar.inferior']<br>
<strong>currency_oldstyle</strong> = ['cent.oldstyle', 'dollar.oldstyle']<br>
<strong>currency_superior</strong> = ['cent.superior', 'dollar.superior']<br>
<strong>dashes</strong> = ['hyphen', 'endash', 'emdash', 'threequartersemdash', 'underscore', 'underscoredbl', 'figuredash']<br>
<strong>dependencies</strong> = {'A': ['Aacute', 'Abreve', 'Acaron', 'Acircumflex', 'Adblgrave', 'Adieresis', 'Agrave', 'Amacron', 'Aogonek', 'Aring', 'Aringacute', 'Atilde'], 'AE': ['AEacute'], 'B': ['Bdotaccent'], 'C': ['Cacute', 'Ccaron', 'Ccircumflex', 'Cdotaccent', 'Ccedilla'], 'D': ['Dcaron', 'Dcedilla', 'Ddotaccent'], 'E': ['Eacute', 'Ebreve', 'Ecaron', 'Ecircumflex', 'Edblgrave', 'Edieresis', 'Edotaccent', 'Egrave', 'Emacron', 'Eogonek', 'Etilde'], 'F': ['Fdotaccent'], 'G': ['Gacute', 'Gbreve', 'Gcaron', 'Gcedilla', 'Gcircumflex', 'Gcommaaccent', 'Gdotaccent', 'Gmacron'], 'H': ['Hcedilla', 'Hcircumflex', 'Hdieresis', 'Hdotaccent'], 'I': ['Iacute', 'Ibreve', 'Icaron', 'Icircumflex', 'Idblgrave', 'Idieresis', 'Idieresisacute', 'Idieresisacute', 'Idotaccent', 'Igrave', 'Imacron', 'Iogonek', 'Itilde'], ...}<br>
<strong>digits</strong> = ['one', 'onefitted', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'zero']<br>
<strong>digits_inferior</strong> = ['eight.inferior', 'five.inferior', 'four.inferior', 'nine.inferior', 'one.inferior', 'seven.inferior', 'three.inferior', 'two.inferior', 'zero.inferior']<br>
<strong>digits_oldstyle</strong> = ['eight.oldstyle', 'five.oldstyle', 'four.oldstyle', 'nine.oldstyle', 'one.oldstyle', 'seven.oldstyle', 'six.oldstyle', 'three.oldstyle', 'two.oldstyle', 'zero.oldstyle']<br>
<strong>digits_superior</strong> = ['eight.superior', 'five.superior', 'four.superior', 'nine.superior', 'one.superior', 'seven.superior', 'six.superior', 'three.superior', 'two.superior', 'zero.superior']<br>
<strong>fractions</strong> = ['oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onequarter', 'threequarters', 'onethird', 'twothirds', 'onehalf']<br>
<strong>inferior</strong> = ['eight.inferior', 'five.inferior', 'four.inferior', 'nine.inferior', 'one.inferior', 'seven.inferior', 'three.inferior', 'two.inferior', 'zero.inferior', 'cent.inferior', 'dollar.inferior', 'comma.inferior', 'hyphen.inferior', 'parenleft.inferior', 'parenright.inferior', 'period.inferior']<br>
<strong>kerncontroldict</strong> = {'DIGITS/DIGITS': ['/H/H', '/H/O/H/O/O'], 'DIGITS/SORTS': ['/H/H', '/H/O/H/O/O'], 'LC/DIGITS': ['', '/n/n/o/n/e/r/s'], 'LC/LC': ['/n/n', '/n/o/n/o/o'], 'LC/SORTS': ['/n/n', '/n/o/n/o/o'], 'SC/DIGITS': ['', '/H.sc/H.sc/O.sc/H.sc/O.sc/O.sc'], 'SC/SC': ['/H.sc/H.sc', '/H.sc/O.sc/H.sc/O.sc/O.sc'], 'SC/SORTS': ['/H.sc/H.sc', '/H.sc/O.sc/H.sc/O.sc/O.sc'], 'SORTS/SORTS': ['/H/H', '/H/O/H/O/O'], 'UC/DIGITS': ['/H/H', '/H/O/H/O/O'], ...}<br>
<strong>legal</strong> = ['trademark', 'trademarksans', 'trademarkserif', 'copyright', 'copyrightsans', 'copyrightserif', 'registered', 'registersans', 'registerserif']<br>
<strong>ligatures</strong> = ['fi', 'fl', 'ff', 'ffi', 'ffl', 'ij', 'IJ']<br>
<strong>lowercase</strong> = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', ...]<br>
<strong>lowercase_accents</strong> = ['aacute', 'abreve', 'acaron', 'acircumflex', 'adblgrave', 'adieresis', 'agrave', 'amacron', 'aogonek', 'aring', 'aringacute', 'atilde', 'bdotaccent', 'cacute', 'ccaron', 'ccircumflex', 'cdotaccent', 'dcaron', 'dcedilla', 'ddotaccent', ...]<br>
<strong>lowercase_ligatures</strong> = ['fi', 'fl', 'ff', 'ffi', 'ffl', 'ij']<br>
<strong>lowercase_plain</strong> = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', ...]<br>
<strong>lowercase_special_accents</strong> = ['dcroat', 'lslash', 'hbar', 'tbar', 'kgreenlandic', 'longs', 'll', 'eng']<br>
<strong>numerical</strong> = ['percent', 'perthousand', 'infinity', 'numbersign', 'degree', 'colonmonetary', 'dotmath']<br>
<strong>punctuation</strong> = ['period', 'periodcentered', 'comma', 'colon', 'semicolon', 'ellipsis', 'exclam', 'exclamdown', 'exclamdbl', 'question', 'questiondown']<br>
<strong>slashes</strong> = ['slash', 'backslash', 'bar', 'brokenbar', 'fraction']<br>
<strong>smallcaps</strong> = ['A.sc', 'B.sc', 'C.sc', 'D.sc', 'E.sc', 'F.sc', 'G.sc', 'H.sc', 'I.sc', 'J.sc', 'K.sc', 'L.sc', 'M.sc', 'N.sc', 'O.sc', 'P.sc', 'Q.sc', 'R.sc', 'S.sc', 'T.sc', ...]<br>
<strong>smallcaps_accents</strong> = ['Aacute.sc', 'Acircumflex.sc', 'Adieresis.sc', 'Agrave.sc', 'Aring.sc', 'Atilde.sc', 'Ccedilla.sc', 'Eacute.sc', 'Ecircumflex.sc', 'Edieresis.sc', 'Egrave.sc', 'Iacute.sc', 'Icircumflex.sc', 'Idieresis.sc', 'Igrave.sc', 'Ntilde.sc', 'Oacute.sc', 'Ocircumflex.sc', 'Odieresis.sc', 'Ograve.sc', ...]<br>
<strong>smallcaps_ligatures</strong> = ['IJ.sc']<br>
<strong>smallcaps_plain</strong> = ['A.sc', 'B.sc', 'C.sc', 'D.sc', 'E.sc', 'F.sc', 'G.sc', 'H.sc', 'I.sc', 'J.sc', 'K.sc', 'L.sc', 'M.sc', 'N.sc', 'O.sc', 'P.sc', 'Q.sc', 'R.sc', 'S.sc', 'T.sc', ...]<br>
<strong>smallcaps_special_accents</strong> = ['Dcroat.sc', 'Lslash.sc', 'Hbar.sc', 'Tbar.sc', 'LL.sc', 'Eng.sc']<br>
<strong>smallcapscasedict</strong> = {'ampersand': 'ampersand.sc', 'exclam': 'exclam.sc', 'exclamdown': 'exclamdown.sc', 'germandbls': 'S.sc/S.sc', 'question': 'question.sc', 'questiondown': 'questiondown.sc'}<br>
<strong>special</strong> = ['ampersand', 'paragraph', 'section', 'bullet', 'dagger', 'daggerdbl', 'asterisk', 'at', 'asciicircum', 'asciitilde']<br>
<strong>superior</strong> = ['eight.superior', 'five.superior', 'four.superior', 'nine.superior', 'one.superior', 'seven.superior', 'six.superior', 'three.superior', 'two.superior', 'zero.superior', 'cent.superior', 'dollar.superior', 'Rsmallinverted.superior', 'a.superior', 'b.superior', 'comma.superior', 'd.superior', 'equal.superior', 'e.superior', 'glottalstopreversed.superior', ...]<br>
<strong>uppercase</strong> = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', ...]<br>
<strong>uppercase_accents</strong> = ['Aacute', 'Abreve', 'Acaron', 'Acircumflex', 'Adblgrave', 'Adieresis', 'Agrave', 'Amacron', 'Aogonek', 'Aring', 'Aringacute', 'Atilde', 'Bdotaccent', 'Cacute', 'Ccaron', 'Ccircumflex', 'Cdotaccent', 'Dcaron', 'Dcedilla', 'Ddotaccent', ...]<br>
<strong>uppercase_ligatures</strong> = ['IJ']<br>
<strong>uppercase_plain</strong> = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', ...]<br>
<strong>uppercase_special_accents</strong> = ['Dcroat', 'Lslash', 'Hbar', 'Tbar', 'LL', 'Eng']</td></tr></table>
</body></html>