Log warning instead of raising an error when identical substitutions are added again
This commit is contained in:
parent
9d3b14dd5f
commit
9c6b7d2e7a
@ -914,10 +914,19 @@ class Builder(object):
|
|||||||
lookup = self.get_lookup_(location, SingleSubstBuilder)
|
lookup = self.get_lookup_(location, SingleSubstBuilder)
|
||||||
for (from_glyph, to_glyph) in mapping.items():
|
for (from_glyph, to_glyph) in mapping.items():
|
||||||
if from_glyph in lookup.mapping:
|
if from_glyph in lookup.mapping:
|
||||||
raise FeatureLibError(
|
if to_glyph == lookup.mapping[from_glyph]:
|
||||||
'Already defined rule for replacing glyph "%s" by "%s"' %
|
# log warning?
|
||||||
(from_glyph, lookup.mapping[from_glyph]),
|
# FDK logs "[NOTE] Removing duplicate single substitution in 'xxxx' feature: from_glyph, to_glyph" in this case
|
||||||
location)
|
log.info(FeatureLibError(
|
||||||
|
'Removing duplicate single substitution for glyph "%s" by "%s"' %
|
||||||
|
(from_glyph, to_glyph),
|
||||||
|
location
|
||||||
|
))
|
||||||
|
else:
|
||||||
|
raise FeatureLibError(
|
||||||
|
'Already defined rule for replacing glyph "%s" by "%s"' %
|
||||||
|
(from_glyph, lookup.mapping[from_glyph]),
|
||||||
|
location)
|
||||||
lookup.mapping[from_glyph] = to_glyph
|
lookup.mapping[from_glyph] = to_glyph
|
||||||
|
|
||||||
def add_single_subst_chained_(self, location, prefix, suffix, mapping):
|
def add_single_subst_chained_(self, location, prefix, suffix, mapping):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user