Ejemplo n.º 1
0
 def getfontmap(self):
     if self._fontmap is None:
         # late import due to cyclic dependency
         from pyx.dvi import mapfile
         fontmapfiles = config.getlist("text", "psfontmaps", ["psfonts.map"])
         self._fontmap = mapfile.readfontmap(fontmapfiles)
     return self._fontmap
Ejemplo n.º 2
0
 def getfontmap(self):
     if self._fontmap is None:
         # late import due to cyclic dependency
         from pyx.dvi import mapfile
         fontmapfiles = config.getlist("text", "psfontmaps", ["psfonts.map"])
         self._fontmap = mapfile.readfontmap(fontmapfiles)
     return self._fontmap
Ejemplo n.º 3
0
c.stroke(c.text(1, 2, r"Hello, world!").path())

# test a virtual font with encoding
c.text(0, 8, r"\sffamily VF test: \"o\ss ffl \char0\char0")
c.text(0, 9, r"\sffamily \fontsize{30}{35}\selectfont VF test: \"o\ss ffl \char0\char0")

# scaling test
unit.set(xscale=2)
t = c.text(0, 11, r"scale test", [color.rgb.green])
unit.set(xscale=1)
t = c.text(0, 11, r"scale test", [color.rgb.red])

# test font stripping (proper usedchar selection)
from pyx.dvi import mapfile
fontmap = mapfile.readfontmap(["download35.map"])
c.text(0, 12, r"usechar test (``fl'' should be typed):")
myrunner = text.texrunner()
myrunner.preamble(r"\font\pyxfont=phvr8t\pyxfont")
c.insert(myrunner.text(5.5, 12, r"\char'035", fontmap=fontmap))

myrunner2 = text.texrunner()
myrunner2.preamble(r"\font\pyxfont=ptmr8t\pyxfont")
c.insert(myrunner2.text(6.5, 12, r"\char'035", fontmap=fontmap))

# test for ligatures/kerning in virtual fonts
c.text(0, 13, r"usechar test (``affa'' should be typed):")
myrunner = text.texrunner()
myrunner.preamble(r"\font\pyxfont=ptmr7t\pyxfont")
c.insert(myrunner.text(6.0, 13, r"affa", fontmap=fontmap))
Ejemplo n.º 4
0
# test a virtual font with encoding
c.text(0, 8, r"\sffamily VF test: \"o\ss ffl \char0\char0")
c.text(
    0, 9,
    r"\sffamily \fontsize{30}{35}\selectfont VF test: \"o\ss ffl \char0\char0")

# scaling test
unit.set(xscale=2)
t = c.text(0, 11, r"scale test", [color.rgb.green])
unit.set(xscale=1)
t = c.text(0, 11, r"scale test", [color.rgb.red])

# test font stripping (proper usedchar selection)
from pyx.dvi import mapfile
fontmap = mapfile.readfontmap(["download35.map"])
c.text(0, 12, r"usechar test (``fl'' should be typed):")
myrunner = text.texrunner()
myrunner.preamble(r"\font\pyxfont=phvr8t\pyxfont")
c.insert(myrunner.text(5.5, 12, r"\char'035", fontmap=fontmap))

myrunner2 = text.texrunner()
myrunner2.preamble(r"\font\pyxfont=ptmr8t\pyxfont")
c.insert(myrunner2.text(6.5, 12, r"\char'035", fontmap=fontmap))

# test for ligatures/kerning in virtual fonts
c.text(0, 13, r"usechar test (``affa'' should be typed):")
myrunner = text.texrunner()
myrunner.preamble(r"\font\pyxfont=ptmr7t\pyxfont")
c.insert(myrunner.text(6.0, 13, r"affa", fontmap=fontmap))