summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-05-01 10:36:55 -0700
committerjamesgk <jamesgk19@gmail.com>2015-05-01 10:36:55 -0700
commit0ffd3c7a0d399fdc7fd5a1b89aff75b5438043e7 (patch)
tree6837565bc2867e18c5acca1d06ebb85fb2e3ad4b
parent41516707549dc5ccc029bcb250149f8433669cb0 (diff)
Infer composite glyphs' unicode values from names.
-rw-r--r--scripts/lib/fontbuild/generateGlyph.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/lib/fontbuild/generateGlyph.py b/scripts/lib/fontbuild/generateGlyph.py
index 7de9c13..ce381ec 100644
--- a/scripts/lib/fontbuild/generateGlyph.py
+++ b/scripts/lib/fontbuild/generateGlyph.py
@@ -13,6 +13,7 @@
# limitations under the License.
+import re
from anchors import alignComponentsToAnchors
@@ -93,3 +94,7 @@ def setUnicodeValue(glyph, glyphList):
if glyph.name in glyphList:
glyph.unicode = int(glyphList[glyph.name], 16)
+ else:
+ uvNameMatch = re.match("uni([\dA-F]{4})$", glyph.name)
+ if uvNameMatch:
+ glyph.unicode = int(uvNameMatch.group(1), 16)