8000 Clarify docstring of FT2Font.get_glyph_name. by anntzer · Pull Request #15078 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Clarify docstring of FT2Font.get_glyph_name. #15078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/ft2font_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,19 +945,20 @@ static PyObject *PyFT2Font_draw_glyph_to_bitmap(PyFT2Font *self, PyObject *args,
const char *PyFT2Font_get_glyph_name__doc__ =
"get_glyph_name(index)\n"
"\n"
"Retrieves the ASCII name of a given glyph in a face.\n";
"Retrieves the ASCII name of a given glyph in a face.\n"
"\n"
"Due to Matplotlib's internal design, for fonts that do not contain glyph \n"
"names (per FT_FACE_FLAG_GLYPH_NAMES), this returns a made-up name which \n"
"does *not* roundtrip through `.get_name_index`.\n";

static PyObject *PyFT2Font_get_glyph_name(PyFT2Font *self, PyObject *args, PyObject *kwds)
{
unsigned int glyph_number;
char buffer[128];

if (!PyArg_ParseTuple(args, "I:get_glyph_name", &glyph_number)) {
return NULL;
}

CALL_CPP("get_glyph_name", (self->x->get_glyph_name(glyph_number, buffer)));

return PyUnicode_FromString(buffer);
}

Expand Down
0