{"id":17472831,"url":"https://github.com/shinnn/read-font-cmap","last_synced_at":"2026-05-19T04:02:32.018Z","repository":{"id":21861837,"uuid":"25185257","full_name":"shinnn/read-font-cmap","owner":"shinnn","description":"Parse CMap of a TrueType/OpenType font file","archived":false,"fork":false,"pushed_at":"2015-07-24T09:58:57.000Z","size":148,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T14:51:51.731Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/shinnn.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":null,"support":null}},"created_at":"2014-10-14T01:30:35.000Z","updated_at":"2019-10-31T03:26:45.000Z","dependencies_parsed_at":"2022-08-05T14:01:06.318Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/read-font-cmap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/shinnn/read-font-cmap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fread-font-cmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fread-font-cmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fread-font-cmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fread-font-cmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/read-font-cmap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fread-font-cmap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270996991,"owners_count":24681955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-10-18T17:37:56.320Z","updated_at":"2026-05-19T04:02:31.942Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# read-font-cmap\n\n[![NPM version](https://img.shields.io/npm/v/read-font-cmap.svg)](https://www.npmjs.com/package/read-font-cmap)\n[![Build Status](https://travis-ci.org/shinnn/read-font-cmap.svg?branch=master)](https://travis-ci.org/shinnn/read-font-cmap)\n[![Build status](https://ci.appveyor.com/api/projects/status/507uq9x81gspk8wb?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/read-font-cmap)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/read-font-cmap.svg)](https://coveralls.io/r/shinnn/read-font-cmap)\n[![Dependency Status](https://img.shields.io/david/shinnn/read-font-cmap.svg?label=deps)](https://david-dm.org/shinnn/read-font-cmap)\n[![devDependency Status](https://img.shields.io/david/dev/shinnn/read-font-cmap.svg?label=devDeps)](https://david-dm.org/shinnn/read-font-cmap#info=devDependencies)\n\nA [Node](http://nodejs.org/) module to parse [CMap](https://www.microsoft.com/typography/otspec/cmap.htm) of a TrueType/OpenType font file\n\n```javascript\nconst readFontCmap = require('read-font-cmap');\n\nreadFontCmap('bower_components/font-awesome/fonts/FontAwesome.otf', (err, map) =\u003e {\n  if (err) {\n    throw err;\n  }\n\n  console.log(map); // yields: '{\"32\": 1, \"168\": 6, \"169\": 12, \"174\": 10, ... }'\n});\n```\n\n## Installation\n\n[Use npm.](https://docs.npmjs.com/cli/install)\n\n```\nnpm install read-font-cmap\n```\n\n## API\n\n```javascript\nconst readFontCmap = require('read-font-cmap');\n```\n\n### readFontCmap(*filePath*, *callback*)\n\n*filePath*: `String` (font file path)  \n*callback*: `Function`\n\nIt reads and parses a TrueType/OpenType font file asynchronously, then runs callback function.\n\n#### callback(*error*, *cmap*)\n\n*error*: `Object` (an error if it fails to parse the font, otherwise `null`)  \n*cmap*: `Object`\n\nThe second argument represents CMap table in the form:\n\n```json\n{\n  \"Unicode value (integer)\": \"Glyph ID (integer)\"\n}\n```\n\n[Here](https://raw.githubusercontent.com/shinnn/read-font-cmap/master/test/fixture.json) is a real-life example, the result of parsing [Font Awesome](https://fortawesome.github.io/Font-Awesome/) CMap table.\n\n### readFontCmap.sync(*filePath*)\n\n*filePath*: `String` (font file path)  \nReturn: `Object` (CMap table)\n\nSynchronous version of [`readFontCmap`](#readfontcmapfilepath-callback).\n\n```javascript\nconst readFontCmap = require('read-font-cmap');\nreadFontCmap.sync('bower_components/font-awesome/fonts/FontAwesome.otf');\n//=\u003e {\"32\": 1, \"168\": 6, \"169\": 12, \"174\": 10, ... }\n```\n\n## License\n\nCopyright (c) 2014 - 2015 [Shinnosuke Watanabe](https://github.com/shinnn)\n\nLicensed under [the MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fread-font-cmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fread-font-cmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fread-font-cmap/lists"}