php / php/php-src

imagettftext() does not properly render combining chars

未关闭
#17,352 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Extension: gd Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.2k
平均合并
2 天 13 小时
30 天内合并 PR
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从捆绑的 gdft.c 实现开始,使用组合字符复现所提供的 PHP 示例。将其输出与配置了 libraqm 的 libgd 2.3.3 进行比较,然后确定集成和 Windows 依赖项要求。当 imagettftext() 能够在所有受支持的构建中使用捆绑的 libgd 正确渲染组合字符时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
computer-graphics
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。