Skip to content

Commit

Permalink
agd: support five-digit code points
Browse files Browse the repository at this point in the history
(fixes #1207)
  • Loading branch information
frankrolf authored and josh-hadley committed Aug 22, 2020
1 parent 7f61837 commit 442e5a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/afdko/agd.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def parse(self, intext):
for e in ee:
k, x = e # get key and its data
if k == 'uni':
self.uni = re.compile(r'[0-9A-F]{4}').search(x).group() # Unicode value
self.uni = re.compile(r'[0-9A-F]{4,5}').search(x).group() # Unicode value
elif k == 'fin': self.fin = re_name.search(x).group() # final name
elif k == 'ali':
for a in re_name.findall(x): self.ali.append(a) # name aliases
Expand All @@ -60,7 +60,7 @@ def parse(self, intext):
# Check a glyph for internal conflicts, problems, etc.
def check(self):
m = [] # holds reports of what was fixed
u = re.compile(r'uni([0-9A-F]{4})$') # Unicode value regexp
u = re.compile(r'u(ni)?([0-9A-F]{4,5})$') # Unicode value regexp
n = {}
# process aliases: remove duplicates, uninames, final names:
for a in self.ali:
Expand All @@ -82,12 +82,12 @@ def check(self):
if not self.uni:
if self.fin and u.match(self.fin):
m.append("Found Unicode value in final name '%s' of glyph '%s'." % (self.fin, self.name))
self.uni = u.match(self.fin).group(1) # Get Unicode from final name
self.uni = u.match(self.fin).group(2) # Get Unicode from final name
else:
for a in self.ali:
if u.match(a):
m.append("Found Unicode value in alias '%s' of glyph '%s'." % (a, self.name))
self.uni = u.match(a).group(1)
self.uni = u.match(a).group(2)
break
return m

Expand Down

0 comments on commit 442e5a4

Please sign in to comment.