Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Mixing Arial with mathtext on Windows 8 fails #1710

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 2 commits into from
Jan 29, 2013
Merged
Changes from 1 commit
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
Next Next commit
Fix #1710. When a font doesn't have glyph names, we should synthesize…
… them.
  • Loading branch information
mdboom committed Jan 28, 2013
commit be1d7dd70c14f60ceb56147b5036059b4b29fcec
16 changes: 9 additions & 7 deletions 16 src/ft2font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,15 +1616,17 @@ FT2Font::get_glyph_name(const Py::Tuple & args)
_VERBOSE("FT2Font::get_glyph_name");
args.verify_length(1);

if (!FT_HAS_GLYPH_NAMES(face))
{
throw Py::RuntimeError("Face has no glyph names");
}

char buffer[128];
if (FT_Get_Glyph_Name(face, (FT_UInt) (unsigned long)Py::Int(args[0]), buffer, 128))
FT_UInt glyph_number = Py::Int(args[0]);

if (!FT_HAS_GLYPH_NAMES(face))
{
throw Py::RuntimeError("Could not get glyph names.");
snprintf(buffer, 128, "uni%04x", glyph_number);
} else {
if (FT_Get_Glyph_Name(face, glyph_number, buffer, 128))
{
throw Py::RuntimeError("Could not get glyph names.");
}
}
return Py::String(buffer);
}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.