Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8ac3aa

Browse files
author
Paul Barret
committed
Minor changes to two methods: one new method now returns an exception when an error is encountered, the other method returns None when no table is found.
svn path=/trunk/matplotlib/; revision=390
1 parent 431d383 commit d8ac3aa

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/ft2font.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,10 @@ FT2Font::get_ps_font_info(const Py::Tuple & args)
811811
PS_FontInfoRec fontinfo;
812812

813813
FT_Error error = FT_Get_PS_Font_Info(face, &fontinfo);
814-
if (error)
814+
if (error) {
815815
Py::RuntimeError("Could not get PS font info");
816+
return Py::Object();
817+
}
816818

817819
Py::Tuple info(9);
818820
info[0] = Py::String(fontinfo.version);
@@ -849,7 +851,8 @@ FT2Font::get_sfnt_table(const Py::Tuple & args) {
849851

850852
void *table = FT_Get_Sfnt_Table(face, (FT_Sfnt_Tag) tag);
851853
if (!table)
852-
throw Py::RuntimeError("Could not get SFNT table");
854+
return Py::Object();
855+
//throw Py::RuntimeError("Could not get SFNT table");
853856

854857
switch (tag) {
855858
case 0:

0 commit comments

Comments
 (0)