<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://typophile.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Typophile - how to select a unicode range using python - Comments</title>
 <link>http://typophile.com/node/45222</link>
 <description>Comments for &quot;how to select a unicode range using python&quot;</description>
 <language>en</language>
<item>
 <title>Here are a few lines from</title>
 <link>http://typophile.com/node/45222#comment-278242</link>
 <description>&lt;p&gt;Here are a few lines from &lt;a href=&quot;http://www.unicode.org/Public/UNIDATA/NamesList.txt&quot; target=&quot;_blank&quot;&gt;Unicode&amp;#8217;s name list&lt;/a&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
Code    Name&lt;br /&gt;
0030	DIGIT ZERO  ...&lt;br /&gt;
0039	DIGIT NINE&lt;/p&gt;
&lt;p&gt;0041	LATIN CAPITAL LETTER A ...&lt;br /&gt;
005A	LATIN CAPITAL LETTER Z&lt;/p&gt;
&lt;p&gt;0061	LATIN SMALL LETTER A ...&lt;br /&gt;
007A	LATIN SMALL LETTER Z&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That means that &amp;#8217;LATIN SMALL LETTER A&amp;#8217; is &lt;code&gt;Uni(0x0061)&lt;/code&gt; or equivalently &lt;code&gt;Uni(0x61)&lt;/code&gt; etc. since we may always remove zeros between &lt;code&gt;0x&lt;/code&gt; and the first non zero digit. Thus&lt;/p&gt;
&lt;p&gt;&lt;code&gt;range(0x0030,0x0039+1)&lt;/code&gt; gives  0123456789&lt;br /&gt;
&lt;code&gt;range(0x0041,0x005A+1)&lt;/code&gt; gives  ABCDEFGHIJKLMNOPQRSTUVWXYZ&lt;br /&gt;
&lt;code&gt;range(0x0061,0x007A+1)&lt;/code&gt; gives  abcdefghijklmnopqrstuvwxyz&lt;/p&gt;
&lt;p&gt;Your code above does not select all alphanumerical characters;  it selects digits, capitals letters and small letters of only the English alphabet. It could have been written&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
fl.Unselect()&lt;br /&gt;
for i in range(0x0030,0x0039+1) + range(0x0041,0x005A+1) + range(0x0061,0x007A+1):&lt;br /&gt;
&amp;nbsp;&amp;nbsp; fl.Select(Uni(i))&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;From Adobe&amp;#8217;s file &lt;a href=&quot;http://www.adobe.com/devnet/opentype/archives/glyphlist.txt&quot; title=&quot;http://www.adobe.com/devnet/opentype/archives/glyphlist.txt&quot;&gt;http://www.adobe.com/devnet/opentype/archives/glyphlist.txt&lt;/a&gt; &lt;code&gt;Amacron&lt;/code&gt; is &lt;code&gt;0100&lt;/code&gt; and &lt;code&gt;Gdotaccent&lt;/code&gt; is &lt;code&gt;0120&lt;/code&gt;; &lt;code&gt;range(0x0100,0x0120+1)&lt;/code&gt; is used to select that range.&lt;/p&gt;
&lt;p&gt;Michel&lt;/p&gt;
</description>
 <pubDate>Tue, 13 May 2008 16:55:10 -0700</pubDate>
 <dc:creator>Michel Boyer</dc:creator>
 <guid isPermaLink="false">comment 278242 at http://typophile.com</guid>
</item>
<item>
 <title>how to select a unicode range using python</title>
 <link>http://typophile.com/node/45222</link>
 <description>&lt;p&gt;hey guys am a newbie in fontlab could you help me how to select a unicode range using macro?&lt;br /&gt;
like the &amp;#8220;select alphanumeric&amp;#8221;, I can&amp;#8217;t figure out how it selects by unicode range.&lt;br /&gt;
here is the select alphanumeric codes:&lt;/p&gt;
&lt;p&gt;fl.Unselect()&lt;/p&gt;
&lt;p&gt;for i in range(0x41, 0x5b):&lt;br /&gt;
  fl.Select(Uni(i))&lt;/p&gt;
&lt;p&gt;for i in range(0x61, 0x7b):&lt;br /&gt;
  fl.Select(Uni(i))&lt;/p&gt;
&lt;p&gt;for i in range(0x30, 0x3A):&lt;br /&gt;
  fl.Select(Uni(i))&lt;/p&gt;
&lt;p&gt;fl.iglyph = 20&lt;/p&gt;
&lt;p&gt;now how do I change this to select unicode range from Amacron to Gdotaccent?&lt;/p&gt;
</description>
 <comments>http://typophile.com/node/45222#comments</comments>
 <category domain="http://typophile.com/taxonomy/term/6">Build</category>
 <pubDate>Sun, 11 May 2008 20:47:00 -0700</pubDate>
 <dc:creator>markzman</dc:creator>
 <guid isPermaLink="false">45222 at http://typophile.com</guid>
</item>
</channel>
</rss>
