File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Filter options
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)
1616
1616
_VERBOSE (" FT2Font::get_glyph_name" );
1617
1617
args.verify_length (1 );
1618
1618
1619
- if (!FT_HAS_GLYPH_NAMES (face))
1620
- {
1621
- throw Py::RuntimeError (" Face has no glyph names" );
1622
- }
1623
-
1624
1619
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 = Py::Int (args[0 ]);
1621
+
1622
+ if (!FT_HAS_GLYPH_NAMES (face))
1626
1623
{
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
+ }
1628
1630
}
1629
1631
return Py::String (buffer);
1630
1632
}
You can’t perform that action at this time.
0 commit comments