php / php/php-src

imagettftext() does not properly render combining chars

Đang mở
#17,352 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Bug Extension: gd Status: Needs Triage
Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

Description

I'm forwarding this from the ancient https://bugs.php.net/34670; I had reported that a couple of years ago upstream (https://github.com/libgd/libgd/issues/758), where the ticket had been closed as WONTFIX; however, that was a week after libgd 2.3.3 had been released, which has optional support for libraqm, which solves the issue, as I found out while investigating on https://github.com/libgd/libgd/issues/861.

The following code:

<?php
$im = imagecreatetruecolor(64, 32);
imagefilledrectangle($im, 0, 0, imagesx($im) - 1, imagesy($im) - 1, 0x000000);
imagettftext($im, 16, 0, 10, 20, 0xffffff, "Arial", hex2bin("c3a461cc88"));
imagegif($im, __DIR__ . "/out.gif");

Resulted in this output (bundled libgd):
gd861

But I expected this output instead (libgd 2.3.3 with libraqm):
gd861

So to solve this for our bundled libgd, we would need to add support for libraqm (probably that wouldn't be a big deal, if especially gdft.c hadn't been diverged between bundled and external libgd, and I believe there are a couple of important fixes only in bundled libgd). For Windows users, we would also need to build and ship libraqm and its dependencies (at least harfbuzz in this case).

PHP Version

any

Operating System

any

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với triển khai gdft.c đi kèm và tái hiện ví dụ PHP được cung cấp bằng một ký tự kết hợp. So sánh đầu ra của nó với libgd 2.3.3 được cấu hình với libraqm, sau đó xác định các yêu cầu về tích hợp và dependency trên Windows. Hoàn thành có nghĩa là imagettftext() kết xuất chính xác các ký tự kết hợp bằng libgd đi kèm trên tất cả các build được hỗ trợ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c, php
Lĩnh vực
computer-graphics
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.