You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The old formula (`*dst |= *src`) works fine when either dst or src is
full transparent or fully opaque, but not for compositing intermediate
values. Fix that (while keeping a fast-path for the common case of
writing on an empty buffer).
Example (note the more uniform gray zone between the two letters):
```
from matplotlib import pyplot as plt, ft2font as f, cbook
import numpy as np
font = f.FT2Font(str(cbook._get_data_path("fonts/ttf/DejaVuSans.ttf")))
font.set_size(24, 72)
im = f.FT2Image(30, 30)
ga = font.load_char(ord("A"))
gv = font.load_char(ord("V"))
font.draw_glyph_to_bitmap(im, 2, 2, ga)
font.draw_glyph_to_bitmap(im, 12, 2, gv)
(plt.figure(layout="constrained", figsize=(3, 3))
.add_subplot(xticks=[], yticks=[])
.imshow(np.asarray(im), cmap="gray"))
plt.show()
```
0 commit comments