robofab.tools.toolsSVG
index
/code/projects/robofab/Lib/robofab/tools/toolsSVG.py

# -*- coding: utf-8 -*-

 
Modules
       
os
re

 
Classes
       
fontTools.pens.basePen.BasePen(fontTools.pens.basePen.AbstractPen)
FabToSVGPen
SVGFontReader
SVGPath

 
class FabToSVGPen(fontTools.pens.basePen.BasePen)
    A pen to create and draw the glyph as
a path object into a SVG document.
 
 
Method resolution order:
FabToSVGPen
fontTools.pens.basePen.BasePen
fontTools.pens.basePen.AbstractPen

Methods defined here:
__init__(self, glyphSet)
write(self)

Methods inherited from fontTools.pens.basePen.BasePen:
addComponent(self, glyphName, transformation)
This default implementation simply transforms the points
of the base glyph and draws it onto self.
closePath(self)
curveTo(self, *points)
endPath(self)
lineTo(self, pt)
moveTo(self, pt)
qCurveTo(self, *points)

 
class SVGFontReader
    Return a Fab Font object with the data found in the SVG font.
 
  Methods defined here:
__init__(self, path, font)
read(self)
readSVGTree(self, tree)

 
class SVGPath
    Path object for SVG vector paths. Return the data
in  compact format, ready for <path> or <glyph> tag.
 
  Methods defined here:
__init__(self, fillColor=None, strokeColor=None, strokeWidth=None)
closePath(self)
concatenate(self, cmd, *pts)
curveTo(self, (x1, y1, x2, y2, x3, y3))
lineTo(self, (x, y))
moveTo(self, (x, y))
qCurveTo(self, (x1, y1, x2, y2))
write(self)
        <path d="M200,300 L400,50 L600,300 
   L800,550 L1000,300"
fill="none" stroke="#888888" stroke-width="2" />

 
Functions
       
entitify(string)
Convert a string with possible unicode values to a string with entities.
makeSVGFont(fabFont, svgFontPath=None, exportKerning=True)
Convert a fab font to a SVG font tag.
http://www.w3.org/TR/SVG11/fonts.html
makeSVGGlyph(fabGlyph, glyphSet, glyphClass='glyph')
Convert a single fab glyph to a SVG glyph tag.

 
Data
        cmdSearch = <_sre.SRE_Pattern object at 0x1909200>
pathSearch = <_sre.SRE_Pattern object at 0x11746e0>
svgFontHeader = '<?xml version="1.0" standalone="no"?>\n<!DOCTYPE ...tp://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >'