mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-29 02:03:25 +03:00
Fix code example
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
18d34b287f
commit
81af72bb89
|
@ -79,10 +79,11 @@ TrueType fonts may now be pickled and unpickled. For example:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
import pickle
|
||||
from PIL import ImageFont
|
||||
|
||||
font = ImageFont.truetype("arial.ttf", size=30)
|
||||
pickled_font = pickle.dumps(font1, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
pickled_font = pickle.dumps(font, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
|
||||
# Later...
|
||||
unpickled_font = pickle.loads(pickled_font)
|
||||
|
|
Loading…
Reference in New Issue
Block a user