File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1616,15 +1616,17 @@ FT2Font::get_glyph_name(const Py::Tuple & args)
16161616 _VERBOSE (" FT2Font::get_glyph_name" );
16171617 args.verify_length (1 );
16181618
1619- if (!FT_HAS_GLYPH_NAMES (face))
1620- {
1621- throw Py::RuntimeError (" Face has no glyph names" );
1622- }
1623-
16241619 char buffer[128 ];
1625- if (FT_Get_Glyph_Name (face, (FT_UInt) (unsigned long )Py::Int (args[0 ]), buffer, 128 ))
1620+ FT_UInt glyph_number = (FT_UInt)(unsigned long long )Py::Int (args[0 ]);
1621+
1622+ if (!FT_HAS_GLYPH_NAMES (face))
16261623 {
1627- throw Py::RuntimeError (" Could not get glyph names." );
1624+ snprintf (buffer, 128 , " uni%04x" , glyph_number);
1625+ } else {
1626+ if (FT_Get_Glyph_Name (face, glyph_number, buffer, 128 ))
1627+ {
1628+ throw Py::RuntimeError (" Could not get glyph names." );
1629+ }
16281630 }
16291631 return Py::String (buffer);
16301632}
You can’t perform that action at this time.
0 commit comments