Skip to content
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

Unimplemented feature when converting emojis to image #7854

Open
BenjaminOddou opened this issue Mar 3, 2024 · 27 comments
Open

Unimplemented feature when converting emojis to image #7854

BenjaminOddou opened this issue Mar 3, 2024 · 27 comments

Comments

@BenjaminOddou
Copy link

What did you do?

Converting emoji text using Apple Color Emoji.ttc font to png file using pillow. The behavior is different between two macs. On one configuration (see below) the script is correctly generating images from all emoji and on the other hand, for another configuration, the script is returning an error for some emojis.

What did you expect to happen?

309490886-557c029a-ed98-45d5-aed2-4990dbd1366b

What actually happened?

With the second cofiguration, the script returns

❯ python3 test.py
unimplemented feature

Note that it seems to be a problem only for emojis from 15.1 version, see this issue.

What are your OS, Python and Pillow versions?

Configuration where the script is working:

  • OS: macOS 14.4
  • Python: 3.12.2
  • Pillow: 10.2.0
  • Intel Core i7

Configuration where the script returns an error:

  • OS: macOS 14.4
  • Python: 3.12.2
  • Pillow: 10.2.0
  • Apple M1 Max
from PIL import Image, ImageDraw, ImageFont

def convert_emoji_to_png(emoji):
    image_size = (74 , 74) # set image size
    image = Image.new("RGBA", image_size, (0, 0, 0, 0))  # Set transparent background
    font_size = 64  # Adjusted font size
    font_path = "/System/Library/Fonts/Apple Color Emoji.ttc"
    font = ImageFont.truetype(font_path, font_size, encoding='unic')
    draw_position = (int((image_size[0] - font_size) / 2), int((image_size[1] - font_size) / 2))
    draw = ImageDraw.Draw(image)
    draw.text(draw_position, emoji, font=font, embedded_color=True)
    image.show()

try:
    convert_emoji_to_png("🚶‍➡️")
except Exception as e:
    print(e)
@nulano
Copy link
Contributor

nulano commented Mar 3, 2024

unimplemented feature

This sounds like it might be a message from FreeType, the library used by Pillow to render text:

except OSError as e: # pragma: no cover
assert str(e) in ("unimplemented feature", "unknown file format")
pytest.skip("freetype compiled without libpng or SBIX support")


How did you install Pillow (on both systems)?

What is the output of python3 -m PIL (please paste the first 26 lines of output from each system)?

@radarhere
Copy link
Member

If it's helpful information, I'm on an M1 with macOS 14.3.1, and I don't see the error.

Investigating, https://stackoverflow.com/questions/63742055/freetype-colour-rendering-ft-load-glyph-returns-unimplemented-feature suggests that FreeType being built without FT_CONFIG_OPTION_USE_PNG would raise this error when you're using embedded_color=True.

@BenjaminOddou
Copy link
Author

Hello,

for my system (intel mac chip) I installed pillow using brew.

> python3 -m PIL     
--------------------------------------------------------------------
Pillow 10.2.0
Python 3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
--------------------------------------------------------------------
Python modules loaded from /usr/local/lib/python3.12/site-packages/PIL
Binary modules loaded from /usr/local/lib/python3.12/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 10.2.0
*** TKINTER support not installed
--- FREETYPE2 support ok, loaded 2.13.2
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.3.2
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok, compiled for libjpeg-turbo 3.0.1
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.0
--- ZLIB (PNG/ZIP) support ok, loaded 1.2.12
--- LIBTIFF support ok, loaded 4.6.0
--- RAQM (Bidirectional Text) support ok, loaded 0.10.1
--- LIBIMAGEQUANT (Quantization method) support ok, loaded 4.2.2
--- XCB (X protocol) support ok
--------------------------------------------------------------------
BLP
Extensions: .blp
Features: open, save, encode
--------------------------------------------------------------------

@garymh could you share the results from your mac ?

@garymh
Copy link

garymh commented Mar 6, 2024

Sure:

❯ python3 -m PIL
--------------------------------------------------------------------
Pillow 10.2.0
Python 3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
--------------------------------------------------------------------
Python modules loaded from /opt/homebrew/lib/python3.12/site-packages/PIL
Binary modules loaded from /opt/homebrew/lib/python3.12/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 10.2.0
*** TKINTER support not installed
--- FREETYPE2 support ok, loaded 2.13.2
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.3.2
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok, compiled for libjpeg-turbo 3.0.1
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.1
--- ZLIB (PNG/ZIP) support ok, loaded 1.2.12
--- LIBTIFF support ok, loaded 4.6.0
--- RAQM (Bidirectional Text) support ok, loaded 0.10.1
--- LIBIMAGEQUANT (Quantization method) support ok, loaded 4.2.2
--- XCB (X protocol) support ok
--------------------------------------------------------------------
BLP
Extensions: .blp
Features: open, save, encode

This is with an Apple M1 Max

@radarhere
Copy link
Member

So @garymh is the environment with the error? How did he install Pillow?

@nulano
Copy link
Contributor

nulano commented Mar 6, 2024

@garymh I'm assuming you also installed Pillow using brew?

Could you please provide the output of brew list --versions?

@garymh
Copy link

garymh commented Mar 7, 2024

Could you please provide the output of brew list --versions?

Sure, any relevant parts you're looking for though? I'm a dev so I have quite a few things installed 🙃

Here are python related things:

pillow 10.2.0_1
python-certifi 2024.2.2
python-setuptools 69.1.1
[email protected] 3.11.8
[email protected] 3.12.2_1
pyyaml 6.0.1_1

@nulano
Copy link
Contributor

nulano commented Mar 7, 2024

Everything related to the font stack. Unless I'm forgetting something, that should be freetype, harfbuzz, fribidi, libraqm, libpng.

@garymh
Copy link

garymh commented Mar 7, 2024

Got it!

- freetype 2.13.2
- fribidi 1.0.13
- harfbuzz 8.3.0_1
- libpng 1.6.43
- libraqm 0.10.1

@radarhere
Copy link
Member

Could you run the script without embedded_color=True? I expect that difference will allow it to run successfully.

@garymh
Copy link

garymh commented Mar 7, 2024

Nope :(

I tried both:

draw.text(draw_position, emoji, font=font)

and

draw.text(draw_position, emoji, font=font, embedded_color=False)

Both gave me unimplemented feature

@radarhere
Copy link
Member

It may or may not be helpful, but could we get the full traceback, not just the error string?

So the output of

convert_emoji_to_png("🚶‍➡️")

not just

try:
    convert_emoji_to_png("🚶‍➡️")
except Exception as e:
    print(e)

@garymh
Copy link

garymh commented Mar 7, 2024

Sure:

❯ python3 emoji_test.py
Traceback (most recent call last):
  File "/Users/gary/Desktop/emoji_test.py", line 14, in <module>
    convert_emoji_to_png("🚶‍➡️")
  File "/Users/gary/Desktop/emoji_test.py", line 11, in convert_emoji_to_png
    draw.text(draw_position, emoji, font=font, embedded_color=False)
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageDraw.py", line 568, in text
    draw_text(ink)
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageDraw.py", line 510, in draw_text
    mask, offset = font.getmask2(
                   ^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageFont.py", line 602, in getmask2
    offset = self.font.render(
             ^^^^^^^^^^^^^^^^^
OSError: unimplemented feature

radarhere added a commit to radarhere/Pillow that referenced this issue Mar 8, 2024
radarhere added a commit to radarhere/Pillow that referenced this issue Mar 8, 2024
radarhere added a commit to radarhere/Pillow that referenced this issue Mar 8, 2024
radarhere added a commit to radarhere/Pillow that referenced this issue Mar 8, 2024
@radarhere
Copy link
Member

I attempted to replicate in macOS 14 arm64 on GitHub Actions, with

brew update
brew install [email protected] pillow freetype fribidi harfbuzz libpng libraqm

but it passed.

@radarhere
Copy link
Member

radarhere commented Mar 8, 2024

If you install Pillow from this PyPI wheel, does the problem still occur?
https://files.pythonhosted.org/packages/9d/a0/28756da34d6b58c3c5f6c1d5589e4e8f4e73472b55875524ae9d6e7e98fe/pillow-10.2.0-cp312-cp312-macosx_11_0_arm64.whl

I don't expect it to fix it, but if the error still occurs with this, that means I could potentially put together a wheel with better logging for you to run. If it doesn't, are you open to building Pillow from source?

Copy link

Closing this issue as no feedback has been received.

@github-actions github-actions bot added the Stale label Mar 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2024
@BenjaminOddou
Copy link
Author

The problem still persist on Pillow 10.3.0 @radarhere.

--------------------------------------------------------------------
Pillow 10.3.0
Python 3.12.3 (main, Apr  9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)]
--------------------------------------------------------------------
Python executable is /opt/homebrew/opt/[email protected]/bin/python3.12
System Python files loaded from /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12
--------------------------------------------------------------------
Python Pillow modules loaded from /opt/homebrew/lib/python3.12/site-packages/PIL
Binary Pillow modules loaded from /opt/homebrew/lib/python3.12/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 10.3.0
*** TKINTER support not installed
--- FREETYPE2 support ok, loaded 2.13.2
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.4.0
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok, compiled for libjpeg-turbo 3.0.2
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.2
--- ZLIB (PNG/ZIP) support ok, loaded 1.2.12
--- LIBTIFF support ok, loaded 4.6.0
--- RAQM (Bidirectional Text) support ok, loaded 0.10.1
--- LIBIMAGEQUANT (Quantization method) support ok, loaded 4.2.2
--- XCB (X protocol) support ok

using a test.py script :

from PIL import Image, ImageDraw, ImageFont

def convert_emoji_to_png(emoji, name):
    image_size = (64, 64) # set image size
    image = Image.new("RGBA", image_size, (0, 0, 0, 0))  # Set transparent background
    font_size = 64  # Adjusted font size
    font_path = "/System/Library/Fonts/Apple Color Emoji.ttc"
    font = ImageFont.truetype(font_path, font_size, encoding='unic')
    draw_position = (int((image_size[0] - font_size) / 2), int((image_size[1] - font_size) / 2))
    draw = ImageDraw.Draw(image)
    draw.text(draw_position, emoji, font=font, embedded_color=True)
    image.save(f"{name.replace(':', '')}.png", "PNG")

convert_emoji_to_png("👩‍🦽‍➡️", 'test')

outputs :

python3 test.py
Traceback (most recent call last):
  File "/Users/user/Documents/GitHub/alfred-emoji-wine/test.py", line 14, in <module>
    convert_emoji_to_png("👩‍🦽‍➡️", 'test')
  File "/Users/user/Documents/GitHub/alfred-emoji-wine/test.py", line 11, in convert_emoji_to_png
    draw.text(draw_position, emoji, font=font, embedded_color=True)
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageDraw.py", line 590, in text
    draw_text(ink)
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageDraw.py", line 529, in draw_text
    mask, offset = font.getmask2(
                   ^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageFont.py", line 592, in getmask2
    return self.font.render(
           ^^^^^^^^^^^^^^^^^
OSError: unimplemented feature

I tried the following without any positive result

brew update
brew install [email protected] pillow freetype fribidi harfbuzz libpng libraqm

radarhere added a commit to radarhere/Pillow that referenced this issue May 23, 2024
@radarhere
Copy link
Member

Could you describe in words what you're expecting? The sequence of unicode characters being requested is - woman, zero width joiner, manual wheelchair, zero width joiner, black rightwards arrow, variation selector-16.

If I trim the last two characters from the string, then it renders fine on my machine.

test

@BenjaminOddou
Copy link
Author

I was trying to create an image from emoji using the native emoji font on macOS. What character did you trim exactly ? Is my emoji sequence not correct 🤨 ? FYI I am using this list as my emoji source

@nulano
Copy link
Contributor

nulano commented May 24, 2024

--- RAQM (Bidirectional Text) support ok, loaded 0.10.1

It seems you are still using brew to install Pillow.

If you are using a wheel from PyPI (e.g. the one linked by @radarhere above), you should see the following:

--- RAQM (Bidirectional Text) support ok, loaded 0.10.1, fribidi 1.0.13, harfbuzz 8.3.0

Could you please test with Pillow installed from PyPI?

This one should work: https://files.pythonhosted.org/packages/5e/77/4cf407e7b033b4d8e5fcaac295b6e159cf1c70fa105d769f01ea2e1e5eca/pillow-10.3.0-cp312-cp312-macosx_11_0_arm64.whl

This would at least let us know if the issue is specific to the brew build of Pillow (or other used libraries).

@nulano nulano reopened this May 24, 2024
@BenjaminOddou
Copy link
Author

BenjaminOddou commented May 24, 2024

@nulano now

Pillow 10.3.0
Python 3.12.3 (main, Apr  9 2024, 08:09:14) [Clang 15.0.0 (clang-1500.3.9.4)]
--------------------------------------------------------------------
Python executable is /opt/homebrew/opt/[email protected]/bin/python3.12
System Python files loaded from /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.12
--------------------------------------------------------------------
Python Pillow modules loaded from /opt/homebrew/lib/python3.12/site-packages/PIL
Binary Pillow modules loaded from /opt/homebrew/lib/python3.12/site-packages/PIL
--------------------------------------------------------------------
--- PIL CORE support ok, compiled for 10.3.0
*** TKINTER support not installed
--- FREETYPE2 support ok, loaded 2.13.2
--- LITTLECMS2 support ok, loaded 2.16
--- WEBP support ok, loaded 1.3.2
--- WEBP Transparency support ok
--- WEBPMUX support ok
--- WEBP Animation support ok
--- JPEG support ok, compiled for libjpeg-turbo 3.0.2
--- OPENJPEG (JPEG2000) support ok, loaded 2.5.2
--- ZLIB (PNG/ZIP) support ok, loaded 1.3.1
--- LIBTIFF support ok, loaded 4.6.0
--- RAQM (Bidirectional Text) support ok, loaded 0.10.1, fribidi 1.0.14, harfbuzz 8.4.0
*** LIBIMAGEQUANT (Quantization method) support not installed
--- XCB (X protocol) support ok
python3 test.py
Traceback (most recent call last):
  File "/Users/user/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.AE55F6CA-27EF-4215-979B-D0CE54F501D7/test.py", line 14, in <module>
    convert_emoji_to_png("👩‍🦽‍➡️", 'test')
  File "/Users/user/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.AE55F6CA-27EF-4215-979B-D0CE54F501D7/test.py", line 11, in convert_emoji_to_png
    draw.text(draw_position, emoji, font=font, embedded_color=True)
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageDraw.py", line 590, in text
    draw_text(ink)
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageDraw.py", line 529, in draw_text
    mask, offset = font.getmask2(
                   ^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/PIL/ImageFont.py", line 592, in getmask2
    return self.font.render(
           ^^^^^^^^^^^^^^^^^
OSError: unimplemented feature

@radarhere
Copy link
Member

What character did you trim exactly ?

I find that running

convert_emoji_to_png("👩‍🦽‍➡️"[:-2], 'test')

works. So from your emoji source, I find that 'woman in manual wheelchair', works, but 'woman in manual wheelchair facing right' doesn't.

@BenjaminOddou
Copy link
Author

BenjaminOddou commented May 24, 2024

@radarhere I think the problem comes from the right arrow modifier then. All the following emojis have this modifier, here is an example

here are the emojis causing problems :

2024-05-24 22:01:22,360 - ERROR - 🚶‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,361 - ERROR - 🚶🏻‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,362 - ERROR - 🚶🏼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,362 - ERROR - 🚶🏽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,363 - ERROR - 🚶🏾‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,364 - ERROR - 🚶🏿‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,365 - ERROR - 🚶‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,366 - ERROR - 🚶🏻‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,366 - ERROR - 🚶🏼‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,367 - ERROR - 🚶🏽‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,368 - ERROR - 🚶🏾‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,369 - ERROR - 🚶🏿‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,369 - ERROR - 🚶‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,370 - ERROR - 🚶🏻‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,371 - ERROR - 🚶🏼‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,372 - ERROR - 🚶🏽‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,373 - ERROR - 🚶🏾‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,373 - ERROR - 🚶🏿‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,417 - ERROR - 🧎‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,418 - ERROR - 🧎🏻‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,419 - ERROR - 🧎🏼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,419 - ERROR - 🧎🏽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,420 - ERROR - 🧎🏾‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,421 - ERROR - 🧎🏿‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,422 - ERROR - 🧎‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,423 - ERROR - 🧎🏻‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,423 - ERROR - 🧎🏼‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,424 - ERROR - 🧎🏽‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,425 - ERROR - 🧎🏾‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,426 - ERROR - 🧎🏿‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,426 - ERROR - 🧎‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,427 - ERROR - 🧎🏻‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,428 - ERROR - 🧎🏼‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,429 - ERROR - 🧎🏽‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,430 - ERROR - 🧎🏾‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,430 - ERROR - 🧎🏿‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,439 - ERROR - 🧑‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,439 - ERROR - 🧑🏻‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,440 - ERROR - 🧑🏼‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,441 - ERROR - 🧑🏽‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,442 - ERROR - 🧑🏾‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,443 - ERROR - 🧑🏿‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,451 - ERROR - 👨‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,452 - ERROR - 👨🏻‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,453 - ERROR - 👨🏼‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,453 - ERROR - 👨🏽‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,454 - ERROR - 👨🏾‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,455 - ERROR - 👨🏿‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,464 - ERROR - 👩‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,465 - ERROR - 👩🏻‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,465 - ERROR - 👩🏼‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,466 - ERROR - 👩🏽‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,467 - ERROR - 👩🏾‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,468 - ERROR - 👩🏿‍🦯‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,477 - ERROR - 🧑‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,477 - ERROR - 🧑🏻‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,478 - ERROR - 🧑🏼‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,479 - ERROR - 🧑🏽‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,480 - ERROR - 🧑🏾‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,481 - ERROR - 🧑🏿‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,489 - ERROR - 👨‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,490 - ERROR - 👨🏻‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,491 - ERROR - 👨🏼‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,492 - ERROR - 👨🏽‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,493 - ERROR - 👨🏾‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,493 - ERROR - 👨🏿‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,502 - ERROR - 👩‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,503 - ERROR - 👩🏻‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,504 - ERROR - 👩🏼‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,505 - ERROR - 👩🏽‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,506 - ERROR - 👩🏾‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,506 - ERROR - 👩🏿‍🦼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,520 - ERROR - 🧑‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,521 - ERROR - 🧑🏻‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,521 - ERROR - 🧑🏼‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,522 - ERROR - 🧑🏽‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,523 - ERROR - 🧑🏾‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,524 - ERROR - 🧑🏿‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,532 - ERROR - 👨‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,533 - ERROR - 👨🏻‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,534 - ERROR - 👨🏼‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,535 - ERROR - 👨🏽‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,536 - ERROR - 👨🏾‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,536 - ERROR - 👨🏿‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,546 - ERROR - 👩‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,547 - ERROR - 👩🏻‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,548 - ERROR - 👩🏼‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,548 - ERROR - 👩🏽‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,549 - ERROR - 👩🏾‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,550 - ERROR - 👩🏿‍🦽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,574 - ERROR - 🏃‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,575 - ERROR - 🏃🏻‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,576 - ERROR - 🏃🏼‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,577 - ERROR - 🏃🏽‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,578 - ERROR - 🏃🏾‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,578 - ERROR - 🏃🏿‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,579 - ERROR - 🏃‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,580 - ERROR - 🏃🏻‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,581 - ERROR - 🏃🏼‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,582 - ERROR - 🏃🏽‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,583 - ERROR - 🏃🏾‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,583 - ERROR - 🏃🏿‍♀️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,584 - ERROR - 🏃‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,585 - ERROR - 🏃🏻‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,586 - ERROR - 🏃🏼‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,587 - ERROR - 🏃🏽‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,587 - ERROR - 🏃🏾‍♂️‍➡️ cannot be transform into an image, unimplemented feature
2024-05-24 22:01:22,588 - ERROR - 🏃🏿‍♂️‍➡️ cannot be transform into an image, unimplemented feature

@radarhere radarhere removed the Stale label May 25, 2024
@radarhere
Copy link
Member

I've sent an e-mail to FreeType asking them if they have any thoughts.

Hi,

Over at Python Pillow, a user has tried to render an emoji with macOS’ Apple Color Emoji.ttc - #7854 (comment). The emoji is the combination of ‘woman’ U+1F469, 'zero width joiner’ U+200D, 'manual wheelchair’ U+1F9BD, 'zero width joiner’ U+200D, 'black rightwards arrow’ U+27A1, 'variation selector-16’ U+FE0F, with the intention of being a woman in a manual wheelchair facing right.

However, FreeType returns an Unimplemented_Feature error. Interesting, it only doesn’t do this for just a woman in a manual wheelchair. To demonstrate, the following code attempts to use woman in a manual wheelchair, and then woman in a manual wheelchair facing right. The error only occurs in the second instance.

FT_Library library;
FT_Init_FreeType(&library);
FT_Face face = NULL;
FT_New_Face(library, "/System/Library/Fonts/Apple Color Emoji.ttc", 0, &face);
FT_Set_Pixel_Sizes(face, 0, 64);
int error = FT_Load_Glyph(face, 1507, FT_LOAD_DEFAULT);
if (error) {
	printf("1507: error %d\n", error);
}
error = FT_Load_Glyph(face, 1508, FT_LOAD_DEFAULT);
if (error) {
	printf("1508: error %d\n", error);
}

I’ve attached images that, as far as I can see, show that both indexes are present in the font.

Any thoughts as to why one should fail but not the other would be appreciated. Thanks.
1507
1508

@radarhere
Copy link
Member

I still need to continue the conversation with FreeType, but here is part of the initial response.

Looking at this report it seems that somehow the image should be mirrored horizontally – I guess this is the problem with FreeType.

Please remember that color emoji rendering support within FreeType is very limited and only partially implemented – it is not intended as a general solution but rather as a last resort for people who won't do the color bitmap blitting by themselves.

Rendering support of Emojis is a border case, since FreeType is decidedly not a graphics library.

@BenjaminOddou
Copy link
Author

@radarhere Thanks for the update ! I look forward to get a solution. Please, tell me if you need any other information / tests.

@radarhere
Copy link
Member

Ok, after some further investigation, I found that the graphic type 'flip' is being used. This is a new feature from Apple (I can't even find documentation about it), and something that FreeType doesn't support yet.

In my e-mails with FreeType, they have said that supporting this feature would be nice, and so I've created https://gitlab.freedesktop.org/freetype/freetype/-/issues/1282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants