Skip to content

How does subsetting work? #108

@keto33

Description

@keto33

I tried to create a simple subset by

require_once '/home/keto/vendor/autoload.php';
use FontLib\Font;
use FontLib\BinaryStream;

$subset = str_split("test");
$subset = array_unique($subset);
sort($subset);

$font = Font::load("Arial.ttf");
$font->parse();

$font->setSubset($subset);
$font->reduce();

$tmp_name = "ArialSub.ttf";
touch($tmp_name);
$font->open($tmp_name, BinaryStream::modeReadWrite);
$font->encode(["OS/2"]);
$font->close();

it creates the TTF file without error, but the resulting font has no glyph. What am I missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions