From 772ca2ee6d9b9a0ffdef2772437dc2d17edd186d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Sat, 7 May 2016 21:48:20 +0000 Subject: [PATCH] add support for virtual fonts in virtual fonts git-svn-id: http://svn.code.sf.net/p/pyx/code/trunk/pyx@3678 a4f5e268-e194-4f32-bce1-d30804cbbcc5 --- CHANGES | 1 + pyx/dvi/vffile.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index d8f885f8..987ded86 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 0.15 (2016/xx/xx): - text module: - improve error handling when input cannot be encoded by texenc + - add support for virtual fonts in virtual fonts 0.14.1 (2015/11/02): - distribution: diff --git a/pyx/dvi/vffile.py b/pyx/dvi/vffile.py index 04cdb56c..79f8c71e 100644 --- a/pyx/dvi/vffile.py +++ b/pyx/dvi/vffile.py @@ -79,9 +79,13 @@ class vffile: # (fontname, self.scale, self.ds, s, reals) # ) - # XXX allow for virtual fonts here too + from pyx import config from . import texfont - self.fonts[num] = texfont.TeXfont(fontname, c, reals, d, self.tfmconv, self.pyxconv, self.debug > 1) + try: + with config.open(fontname, [config.format.vf]) as fontfile: + self.fonts[num] = texfont.virtualfont(fontname, fontfile, c, reals, d, self.tfmconv, self.pyxconv, self.debug>1) + except EnvironmentError: + self.fonts[num] = texfont.TeXfont(fontname, c, reals, d, self.tfmconv, self.pyxconv, self.debug>1) elif cmd == _VF_LONG_CHAR: # character packet (long form) pl = afile.readuint32() # packet length -- 2.11.4.GIT