{"id":35879506,"url":"https://github.com/apsonex/font","last_synced_at":"2026-04-14T15:01:05.296Z","repository":{"id":295634360,"uuid":"990732222","full_name":"apsonex/font","owner":"apsonex","description":"Font","archived":false,"fork":false,"pushed_at":"2025-05-26T15:29:06.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-19T10:14:55.225Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apsonex.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-26T14:46:52.000Z","updated_at":"2025-05-26T15:28:25.000Z","dependencies_parsed_at":"2025-05-26T16:08:43.086Z","dependency_job_id":null,"html_url":"https://github.com/apsonex/font","commit_stats":null,"previous_names":["apsonex/font"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/apsonex/font","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsonex%2Ffont","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsonex%2Ffont/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsonex%2Ffont/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsonex%2Ffont/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apsonex","download_url":"https://codeload.github.com/apsonex/font/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apsonex%2Ffont/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31801629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"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":[],"created_at":"2026-01-08T17:54:55.085Z","updated_at":"2026-04-14T15:01:05.290Z","avatar_url":"https://github.com/apsonex.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Font Manager PHP Package\n\nA simple PHP package to manage and search fonts from multiple providers.\nCurrently supports the **Bunny Fonts** provider with an easy way to list, search, and filter fonts.\n\n## Features\n- List fonts with pagination\n- Search fonts by keyword\n- Find fonts by key(s), family(ies), and type\n- Extensible with multiple font providers\n\n## Installation\n\n```bash\ncomposer require apsonex/font-manager\n```\n\n## Usage\n\n```php\nuse Apsonex\\Font\\Font;\n\n// Instantiate the font manager\n$fontManager = Font::make();\n\n// Select Bunny provider\n$fontManager-\u003ebunny();\n\n// List fonts (paginated)\n$response = $fontManager-\u003elist(limit: 20, page: 1);\nforeach ($response-\u003efonts as $font) {\n    echo $font-\u003efamily . PHP_EOL;\n}\n\n// Search fonts by keyword\n$searchResponse = $fontManager-\u003esearch('abo', limit: 20, page: 1);\n\n// Find font by a single key\n$font = $fontManager-\u003efindByKey('abel');\n\n// Find fonts by multiple keys\n$response = $fontManager-\u003efindByKeys(['abel', 'abeezee'], limit: 10);\n\n// Find fonts by family\n$response = $fontManager-\u003efindByFamily('Abel', limit: 10);\n\n// Find fonts by multiple families\n$response = $fontManager-\u003efindByFamilies(['Abel', 'Aboreto'], limit: 10);\n\n// Find fonts by type (e.g., 'sans-serif')\n// Use limit -1 to fetch all matches\n$response = $fontManager-\u003efindByType('sans-serif', limit: -1);\n```\n\n## API Reference\n\n### Font Manager `(Apsonex\\Font\\Font)`\n- make(): static — Create a new instance\n- bunny(): static — Use Bunny font provider\n- useProvider(FontProviderInterface $provider): static — Use a custom font provider\n- list(int $limit = 20, int $page = 1): FontResponse — List fonts paginated\n- search(string $keyword, int $limit = 20, int $page = 1): FontResponse — Search fonts by keyword\n- findByKey(string $key): ?FontDTO — Find a single font by key\n- findByKeys(array $keys, int $limit = 20): FontResponse — Find fonts by keys\n- findByFamily(string $family, int $limit = 20): FontResponse — Find fonts by family\n- findByFamilies(array $families, int $limit = 20): FontResponse — Find fonts by families\n- findByType(string $type, int $limit = -1): FontResponse — Find fonts by category/type\n\n### FontDTO `(Apsonex\\Font\\FontDTO)`\n- Represents a single font object with these properties:\n- key (string): Unique font key\n- provider (string): Provider name\n- category (string): Font category (e.g., sans-serif)\n- family (string): Font family name\n- urlString (string): CSS font string identifier\n\nThe `FontDTO` class represents a single font item with key metadata used across the package.\n\n| Property    | Type   | Description                                     | Example              |\n| ----------- | ------ | ----------------------------------------------- | -------------------- |\n| `key`       | string | Unique identifier for the font                  | `\"abeezee\"`          |\n| `provider`  | string | The font provider source                        | `\"bunny\"`            |\n| `category`  | string | Font category/type (e.g., serif, sans-serif)    | `\"sans-serif\"`       |\n| `family`    | string | The font family name                            | `\"ABeeZee\"`          |\n| `urlString` | string | A URL-friendly CSS font string used for loading | `\"abeezee:400,400i\"` |\n\n```php\nuse Apsonex\\Font\\FontDTO;\n\n// Creating a FontDTO object (usually returned from provider methods)\n$font = new FontDTO(\n    key: 'abeezee',\n    provider: 'bunny',\n    category: 'sans-serif',\n    family: 'ABeeZee',\n    urlString: 'abeezee:400,400i'\n);\n\n// Accessing properties\necho \"Font Key: \" . $font-\u003ekey . PHP_EOL;             // Output: abeezee\necho \"Provider: \" . $font-\u003eprovider . PHP_EOL;        // Output: bunny\necho \"Category: \" . $font-\u003ecategory . PHP_EOL;        // Output: sans-serif\necho \"Family: \" . $font-\u003efamily . PHP_EOL;            // Output: ABeeZee\necho \"CSS URL String: \" . $font-\u003eurlString . PHP_EOL; // Output: abeezee:400,400i\n```\n\n## FontResponse `(Apsonex\\Font\\FontResponse)`\n- Paginated font response containing:\n- fonts (array of FontDTO)\n- total (int) — total matched fonts\n- limit (int) — items per page\n- page (int) — current page number\n\n## Testing\nThis package uses Pest PHP for testing.\n\n```bash\n./vendor/bin/pest\n```\n\n## Extending with other Providers\n\nYou can implement your own provider by creating a class that implements:\n\n```php\nuse Apsonex\\Font\\Contracts\\FontProviderInterface;\n\nclass YourProvider implements FontProviderInterface\n{\n    public function list(int $limit, int $page): FontResponse { /*...*/ }\n    public function search(string $keyword, int $limit, int $page): FontResponse { /*...*/ }\n    public function findByKey(string $key): ?FontDTO { /*...*/ }\n    // Implement other methods from interface...\n}\n```\n\nThen register it:\n\n```php\n    $fontManager-\u003euseProvider(new YourProvider());\n```\n\n## License\nMIT License © Apsonex Inc\n\n## Contributing\nFeel free to open issues and pull requests!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsonex%2Ffont","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapsonex%2Ffont","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsonex%2Ffont/lists"}