svgsync2.py 文件源码

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

项目:inter 作者: rsms 项目源码 文件源码
def glyphUpdateFromSVG(g, svgCode):
  doc = xmlparseString(svgCode)
  svg = doc.documentElement
  paths = findPathNodes(svg)
  if len(paths) == 0:
    raise Exception('no <path> found in SVG')
  path = paths[0]
  if len(paths) != 1:
    for p in paths:
      id = p.getAttribute('id')
      if id is not None and id.find('stroke') == -1:
        path = p
        break

  tr = nodeTranslation(path)
  d = path.getAttribute('d')
  g.clearContours()
  drawSVGPath(g, d, tr)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号