__init__.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:glyphNameFormatter 作者: LettError 项目源码 文件源码
def lookup(self):
        # look up all the external references we need.
        if self.uniNumber is None:
            return
        try:
            self.uniLetter = unicodeToChar(self.uniNumber)
        except:
            print("GlyphName valueerror for %04X" % self.uniNumber)
            return
        if self.uniNumber in mathUniNumbers:
            self.isMath = True
        try:
            self.uniName = unicodelist.get(self.uniNumber)
            if self.uniName is None:
                self.uniNameProcessed = ""
            else:
                self.uniNameProcessed = self.uniName
            # NOTE: this is still a dependency on the unicodedata module.
            # Would be nice to extract this data directly from the unicode data
            # but the algotirhm is ot trivial..
            self.bidiType = unicodedata.bidirectional(self.uniLetter)
        except ValueError:
            self.uniName = None
            self.uniNameProcessed = ""
            self.uniLetter = None
            self.bidiType = None
        except:
            import traceback
            traceback.print_exc()
        self.uniRangeName = getRangeName(self.uniNumber)

    # these can be called by a range processor to set the status of a name.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号