File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1588,10 +1588,12 @@ void GraphicsContextRenderer::draw_text(
1588
1588
next_glyphs_pos = glyphs_pos + cluster.num_glyphs ;
1589
1589
for (auto j = glyphs_pos; j < next_glyphs_pos; ++j) {
1590
1590
if (!gac.glyphs [j].index ) {
1591
- auto missing =
1592
- py::cast (s.substr (bytes_pos, cluster.num_bytes ))
1593
- .attr (" encode" )(" ascii" , " namereplace" );
1594
- warn_on_missing_glyph (missing.cast <std::string>());
1591
+ auto missing = py::cast (s.substr (bytes_pos, cluster.num_bytes ));
1592
+ warn_on_missing_glyph ( // Format forced by test_mathtext_ticks.
1593
+ " {} ({})" _format (
1594
+ py::module::import (" builtins" ).attr (" ord" )(missing),
1595
+ missing.attr (" encode" )(" ascii" , " namereplace" ).attr (" decode" )())
1596
+ .cast <std::string>());
1595
1597
}
1596
1598
}
1597
1599
bytes_pos = next_bytes_pos;
Original file line number Diff line number Diff line change @@ -903,8 +903,8 @@ void warn_on_missing_glyph(std::string s)
903
903
{
904
904
PY_CHECK (
905
905
PyErr_WarnEx,
906
- nullptr ,
907
- " Requested glyph ({}) missing from current font." _format (s)
906
+ PyExc_UserWarning ,
907
+ " Glyph {} missing from current font." _format (s)
908
908
.cast <std::string>().c_str (),
909
909
1 );
910
910
}
You can’t perform that action at this time.
0 commit comments