From 1eee3b2704dc377437a31a9f17c4ef25649384d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Mon, 24 Nov 2008 20:25:15 +0000 Subject: [PATCH] fix "<" token handling in mapping file parser (thanks to Matthew West) git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@3004 069f4177-920e-0410-937b-c2a4a81bcd90 --- CHANGES | 3 ++- pyx/dvi/mapfile.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 1cfca1c1..9ed502b3 100644 --- a/CHANGES +++ b/CHANGES @@ -122,7 +122,8 @@ TODO: - config option for format warnings - text module: - fix two bugs in the read pipe of the texrunner (thanks to - Laurence Tratt and Eric Faurot) + Laurence Tratt and Eric Faurot) + - fix "<" token handling in mapping file parser (thanks to Matthew West) - style module: - implement style.fillrule - bitmap module: diff --git a/pyx/dvi/mapfile.py b/pyx/dvi/mapfile.py index 5474b7f1..7e2b90a3 100644 --- a/pyx/dvi/mapfile.py +++ b/pyx/dvi/mapfile.py @@ -42,9 +42,15 @@ class MAPline: else: raise RuntimeError("Cannot tokenize string '%s'" % s) + next_token_is_encfile = False for token in tokens: - if token.startswith("<"): - if token.startswith("<<"): + if next_token_is_encfile: + self.encodingfilename = token + next_token_is_encfile = False + elif token.startswith("<"): + if token == "<": + next_token_is_encfile = True + elif token.startswith("<<"): # XXX: support non-partial download here self.fontfilename = token[2:] elif token.startswith("<["): -- 2.11.4.GIT