Skip to content

Commit

Permalink
Add setData function
Browse files Browse the repository at this point in the history
  • Loading branch information
lslqtz committed Feb 14, 2024
1 parent 0de9cce commit 19ed8a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/FontLib/EOT/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ public function readUInt32() {
return $uint32 >> 16 & 0x0000FFFF | $uint32 << 16 & 0xFFFF0000;
}


function setData($name, $key, $value) {
if (!$key) {
$this->header->data = $value;
} else {
$this->header->data[$key] = $value;
}
}

/**
* Get font copyright
*
Expand Down
8 changes: 8 additions & 0 deletions src/FontLib/TrueType/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ public function getData($name, $key = null) {
}
}

public function setData($name, $key, $value) {
if (!$key) {
$this->data[$name]->data = $value;
} else {
$this->data[$name]->data[$key] = $value;
}
}

function addDirectoryEntry(DirectoryEntry $entry) {
$this->directory[$entry->tag] = $entry;
}
Expand Down

0 comments on commit 19ed8a1

Please sign in to comment.