Commit c5efd9d8 authored by Andrey Golovizin's avatar Andrey Golovizin

Use six.unichr()

parent 0d7012a5
......@@ -27,6 +27,8 @@ from __future__ import print_function, unicode_literals
from functools import update_wrapper
import six
import pybtex.io
from pybtex.bibtex import utils
from pybtex.bibtex.exceptions import BibTeXError
......@@ -206,7 +208,7 @@ def if_(i):
def int_to_chr(i):
n = i.pop()
try:
char = unichr(n)
char = six.unichr(n)
except ValueError:
raise BibTeXError('%i passed to int.to.chr$', n)
i.push(char)
......
......@@ -25,8 +25,11 @@
"""
Make a table of character widths to use with bibtex width$ function.
"""
from __future__ import print_function, unicode_literals
import six
def make_table(font_filename, output):
import sys
......@@ -74,7 +77,7 @@ def iter_charwidths(font_face):
charcode, gindex = font_face.get_first_char()
while gindex:
font_face.load_glyph(gindex, FT_LOAD_NO_SCALE)
yield unichr(charcode), font_face.glyph.metrics.horiAdvance
yield six.unichr(charcode), font_face.glyph.metrics.horiAdvance
charcode, gindex = font_face.get_next_char(charcode, gindex)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment