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

Integrate with Unicode’s text rendering tests #17

Open
brawer opened this issue May 2, 2017 · 2 comments
Open

Integrate with Unicode’s text rendering tests #17

brawer opened this issue May 2, 2017 · 2 comments

Comments

@brawer
Copy link

brawer commented May 2, 2017

Would you be interested in testing font.rs through Unicode text rendering tests?

I’d volunteer to do the integration into the test suite on the Unicode side, if somebody familiar with Rust writes a command-line tool that can be called like this:

path/to/some-command --font=fonts/TestCMAP14.otf --testcase=Foo-5/6 --render=≩≩

writing an SVG file to stdout like this:

<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    viewBox="0 -120 1446 1200">
  <symbol id="Foo-5/6.uni2269" overflow="visible"><path d="M100,334 L623,563 L623,619 L100,880 L100,793 L518,594 L100,420 Z M100,208 L622,208 L622,287 L100,287 Z M100,38 L622,38 L622,117 L100,117 Z M282,-93 L508,379 L436,413 L211,-59 Z"/></symbol>
  <use xlink:href="#Foo-5/6.uni2269" x="0" y="0"/>
  <use xlink:href="#Foo-5/6.uni2269" x="723" y="0"/>
</svg>

For test cases on variable fonts, your tool would be called with an additional argument for the variation settings, such as --variation=wght:481.3;wdth:70. Initially, you could ignore this.

The test fonts are here. If you write a command-line tool that can be called as described, the generated test report will look like this, this, this, or this.

@cbreeden
Copy link

cc me.

@cbreeden
Copy link

cbreeden commented Sep 6, 2017

Referencing https://github.com/unicode-org/text-rendering-tests:

With --engine=FreeStack, the tests are run on the free/libre open-source text rendering stack with FreeType, HarfBuzz, FriBidi, and Raqm. These libraries are used by Linux, Android, ChromeOS, and many other systems. — Test report for FreeStack.

I think font-rs would be best to focus only on the FreeType part of this stack. To handle this, we would need to add the proper FriBidi and HarfBuzz plumbing to get these tests to work.

simonwuelker added a commit to simonwuelker/Stormlicht that referenced this issue Mar 24, 2023
Previously, the SVG's would not actually render in the browser.

The SVG format is now compatible with the one required by
https://github.com/unicode-org/text-rendering-tests
as described in
raphlinus/font-rs#17
except for the fact that we don't take the test case name into account.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants