Skip to content

Imagick::queryFontMetrics() appears unsupported in Playground due to missing font stack #3603

@evrpress

Description

@evrpress

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

Summary

Imagick::queryFontMetrics() appears not to work in WordPress Playground.

This looks related to the Imagick/ImageMagick support added in commit 9db2812 where ImageMagick was added to Node.js PHP.wasm builds, but built without font support:

  • --without-fontconfig
  • --without-freetype

Because queryFontMetrics() depends on font handling, this seems unsupported or incomplete in Playground.

Request

Can you confirm whether Imagick::queryFontMetrics() is expected to work in WordPress Playground?

If not, it would help to document that text metric APIs are currently not supported because the build does not include the required font stack.

Expected behavior

queryFontMetrics() works in Playground

Actual behavior

Calling Imagick::queryFontMetrics() in Playground causes an error / failure in my plugin.

Playground Link

Steps to reproduce

$imagick = new Imagick();
$draw = new ImagickDraw();

$draw->setFontSize(24);
$draw->setTextEncoding('UTF-8');

$metrics = $imagick->queryFontMetrics($draw, 'Hello World');

var_dump($metrics);

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only this plugin is active.
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions