php / php/php-src

imagettftext() does not properly render combining chars

オープン
#17,352 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Extension: gd Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.2k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

付属の gdft.c 実装から始め、結合文字を使って提供された PHP の例を再現します。出力を libraqm で構成した libgd 2.3.3 と比較し、その後、統合および Windows の依存関係の要件を特定します。サポートされているすべてのビルドで、バンドルされた libgd を使用して imagettftext() が結合文字を正しくレンダリングできれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
computer-graphics
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。