Commit c5efd9d8 authored by Andrey Golovizin's avatar Andrey Golovizin
Browse files

Use six.unichr()

parent 0d7012a5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)
+4 −1
Original line number Diff line number Diff line
@@ -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)