Show how to rewrite a̅ as ¬a before calling dot, if needed.

Because some old version of libpango will render a̅ as a‾, without
combining.

* wrap/python/ajax/spot.in: Add the code as a comment.
This commit is contained in:
Alexandre Duret-Lutz 2012-05-01 14:31:15 +02:00
parent ec08e5dce1
commit 0f0ada825a

View file

@ -266,6 +266,12 @@ def render_dot_maybe(dotsrc, dont_run_dot):
# option that has no influence). # option that has no influence).
if sys.getdefaultencoding() != 'ascii': if sys.getdefaultencoding() != 'ascii':
dotsrc = dotsrc.encode('utf-8') dotsrc = dotsrc.encode('utf-8')
# If the text rendering engine (usually Pango) used by dot does
# not draw overlines correctly, uncomment the following two
# lines. Pango 1.28.4 seems not to support combining overline
# while 1.30 does.
#import re
#dotsrc = re.sub(r'(.)(̅|̄)', r'¬\1', dotsrc);
autprefix = (imgdir + '/' + hashlib.sha1(dotsrc).hexdigest()) autprefix = (imgdir + '/' + hashlib.sha1(dotsrc).hexdigest())
dotname = autprefix + '.txt' dotname = autprefix + '.txt'
if not os.access(dotname, os.F_OK): if not os.access(dotname, os.F_OK):