{"id":13722263,"url":"https://github.com/dompdf/php-font-lib","last_synced_at":"2026-04-08T13:31:07.208Z","repository":{"id":2956182,"uuid":"3970295","full_name":"dompdf/php-font-lib","owner":"dompdf","description":"A library to read, parse, export and make subsets of different types of font files.","archived":false,"fork":false,"pushed_at":"2026-01-20T14:14:46.000Z","size":9675,"stargazers_count":1792,"open_issues_count":23,"forks_count":257,"subscribers_count":25,"default_branch":"master","last_synced_at":"2026-04-01T02:44:55.368Z","etag":null,"topics":["extract","font","font-files","php","truetype","ttf","woff"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dompdf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2012-04-09T08:46:55.000Z","updated_at":"2026-03-26T14:34:15.000Z","dependencies_parsed_at":"2024-01-12T22:18:28.006Z","dependency_job_id":"c7c5f0ae-26db-406f-a134-f4a3701ea4f1","html_url":"https://github.com/dompdf/php-font-lib","commit_stats":{"total_commits":177,"total_committers":34,"mean_commits":5.205882352941177,"dds":0.7627118644067796,"last_synced_commit":"991d6a954f6bbd7e41022198f00586b230731441"},"previous_names":["phenx/php-font-lib"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/dompdf/php-font-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dompdf%2Fphp-font-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dompdf%2Fphp-font-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dompdf%2Fphp-font-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dompdf%2Fphp-font-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dompdf","download_url":"https://codeload.github.com/dompdf/php-font-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dompdf%2Fphp-font-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31528751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extract","font","font-files","php","truetype","ttf","woff"],"created_at":"2024-08-03T01:01:26.597Z","updated_at":"2026-04-08T13:31:07.011Z","avatar_url":"https://github.com/dompdf.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"[![PHPUnit tests](https://github.com/dompdf/php-font-lib/actions/workflows/phpunit.yml/badge.svg)](https://github.com/dompdf/php-font-lib/actions/workflows/phpunit.yml)\n\n# PHP Font Lib\n\nThis library can be used to:\n * Read TrueType, OpenType (with TrueType glyphs), WOFF font files\n * Extract basic info (name, style, etc)\n * Extract advanced info (horizontal metrics, glyph names, glyph shapes, etc)\n * Make an Adobe Font Metrics (AFM) file from a font\n\nThis project was initiated by the need to read font files in the [DOMPDF project](https://github.com/dompdf/dompdf).\n\nUsage Example\n-------------\n\n### Base font information\n\n```php\n$font = \\FontLib\\Font::load('fontfile.ttf');\n$font-\u003eparse();  // for getFontWeight() to work this call must be done first!\necho $font-\u003egetFontName() .'\u003cbr\u003e';\necho $font-\u003egetFontSubfamily() .'\u003cbr\u003e';\necho $font-\u003egetFontSubfamilyID() .'\u003cbr\u003e';\necho $font-\u003egetFontFullName() .'\u003cbr\u003e';\necho $font-\u003egetFontVersion() .'\u003cbr\u003e';\necho $font-\u003egetFontWeight() .'\u003cbr\u003e';\necho $font-\u003egetFontPostscriptName() .'\u003cbr\u003e';\n$font-\u003eclose();\n```\n\n### Font Metrics Generation\n\n```php\n$font = FontLib\\Font::load('fontfile.ttf');\n$font-\u003eparse();\n$font-\u003esaveAdobeFontMetrics('fontfile.ufm');\n```\n\n### Create a font subset\n\n```php\n$font = FontLib\\Font::load('fontfile.ttf');\n$font-\u003eparse();\n$font-\u003esetSubset(\"abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ.:,;' (!?)+-*/== 1234567890\"); // characters to include\n$font-\u003ereduce();\ntouch('fontfile.subset.ttf');\n$font-\u003eopen('fontfile.subset.ttf', FontLib\\BinaryStream::modeReadWrite);\n$font-\u003eencode(array(\"OS/2\"));\n$font-\u003eclose();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdompdf%2Fphp-font-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdompdf%2Fphp-font-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdompdf%2Fphp-font-lib/lists"}