From 50da689835aa315a75c69e67e0accace13672a56 Mon Sep 17 00:00:00 2001 From: Benjamin Root Date: Fri, 19 Jun 2020 20:31:15 -0400 Subject: [PATCH] Backport PR #17680: MNT: migrate away from deprecated c-api --- src/ft2font_wrapper.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ft2font_wrapper.cpp b/src/ft2font_wrapper.cpp index 102cfbda3dac..98e9ff74f77a 100644 --- a/src/ft2font_wrapper.cpp +++ b/src/ft2font_wrapper.cpp @@ -635,11 +635,10 @@ static PyObject *PyFT2Font_set_text(PyFT2Font *self, PyObject *args, PyObject *k size_t size; if (PyUnicode_Check(textobj)) { - size = PyUnicode_GET_SIZE(textobj); + size = PyUnicode_GET_LENGTH(textobj); codepoints.resize(size); - Py_UNICODE *unistr = PyUnicode_AsUnicode(textobj); for (size_t i = 0; i < size; ++i) { - codepoints[i] = unistr[i]; + codepoints[i] = PyUnicode_ReadChar(textobj, i); } } else if (PyBytes_Check(textobj)) { size = PyBytes_Size(textobj); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy