Skip to content

Commit ac0cf85

Browse files
Fix Python 2.x build
1 parent 1b03d30 commit ac0cf85

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/ft2font.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,9 +1905,13 @@ FT2Font::get_sfnt_table(const Py::Tuple & args)
19051905
pclt["typeFamily"] = Py::Int((short) t->TypeFamily);
19061906
pclt["capHeight"] = Py::Int((short) t->CapHeight);
19071907
pclt["symbolSet"] = Py::Int((short) t->SymbolSet);
1908+
#if PY3K
19081909
pclt["typeFace"] = Py::String((char *) t->TypeFace, 16, "latin-1");
1909-
pclt["characterComplement"] = Py::Bytes((char *)
1910-
t->CharacterComplement, 8);
1910+
pclt["characterComplement"] = Py::Bytes((char *) t->CharacterComplement, 8);
1911+
#else
1912+
pclt["typeFace"] = Py::String((char *) t->TypeFace, 16);
1913+
pclt["characterComplement"] = Py::String((char *) t->CharacterComplement, 8);
1914+
#endif
19111915
// pclt["filename"] = Py::String((char *) t->FileName, 6);
19121916
pclt["strokeWeight"] = Py::Int((int) t->StrokeWeight);
19131917
pclt["widthType"] = Py::Int((int) t->WidthType);

0 commit comments

Comments
 (0)