how to select a unicode range using python
hey guys am a newbie in fontlab could you help me how to select a unicode range using macro?
like the “select alphanumeric”, I can’t figure out how it selects by unicode range.
here is the select alphanumeric codes:
fl.Unselect()
for i in range(0x41, 0x5b):
fl.Select(Uni(i))
for i in range(0x61, 0x7b):
fl.Select(Uni(i))
for i in range(0x30, 0x3A):
fl.Select(Uni(i))
fl.iglyph = 20
now how do I change this to select unicode range from Amacron to Gdotaccent?
















13.May.2008 4.55pm
Here are a few lines from Unicode’s name list
Code Name
0030 DIGIT ZERO ...
0039 DIGIT NINE
0041 LATIN CAPITAL LETTER A ...
005A LATIN CAPITAL LETTER Z
0061 LATIN SMALL LETTER A ...
007A LATIN SMALL LETTER Z
That means that ’LATIN SMALL LETTER A’ is
Uni(0x0061)or equivalentlyUni(0x61)etc. since we may always remove zeros between0xand the first non zero digit. Thusrange(0x0030,0x0039+1)gives 0123456789range(0x0041,0x005A+1)gives ABCDEFGHIJKLMNOPQRSTUVWXYZrange(0x0061,0x007A+1)gives abcdefghijklmnopqrstuvwxyzYour 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
fl.Unselect()
for i in range(0x0030,0x0039+1) + range(0x0041,0x005A+1) + range(0x0061,0x007A+1):
fl.Select(Uni(i))
From Adobe’s file http://www.adobe.com/devnet/opentype/archives/glyphlist.txt
Amacronis0100andGdotaccentis0120;range(0x0100,0x0120+1)is used to select that range.Michel