{"id":26601949,"url":"https://github.com/patrickmarabeas/jquery-fontspy.js","last_synced_at":"2025-04-09T16:42:30.631Z","repository":{"id":7775843,"uuid":"9145288","full_name":"patrickmarabeas/jQuery-FontSpy.js","owner":"patrickmarabeas","description":"Style your @font-face elements while they load or upon catastrophic failure","archived":false,"fork":false,"pushed_at":"2019-01-23T00:52:34.000Z","size":73,"stargazers_count":86,"open_issues_count":5,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T18:53:03.169Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://patrickmarabeas.github.io/jQuery-FontSpy.js","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/patrickmarabeas.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":"2013-04-01T10:24:45.000Z","updated_at":"2024-09-11T15:27:54.000Z","dependencies_parsed_at":"2022-08-31T04:21:52.112Z","dependency_job_id":null,"html_url":"https://github.com/patrickmarabeas/jQuery-FontSpy.js","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickmarabeas%2FjQuery-FontSpy.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickmarabeas%2FjQuery-FontSpy.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickmarabeas%2FjQuery-FontSpy.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickmarabeas%2FjQuery-FontSpy.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickmarabeas","download_url":"https://codeload.github.com/patrickmarabeas/jQuery-FontSpy.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248069192,"owners_count":21042636,"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","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":"2025-03-23T18:46:57.807Z","updated_at":"2025-04-09T16:42:30.550Z","avatar_url":"https://github.com/patrickmarabeas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jQuery-FontSpy.js\n\n### Style your @font-face elements while they load or upon catastrophic failure.\n\njQuery-FontSpy.js works by checking the change in width of a string. Courier New is used as the font to compare against as it is one of the most widely distrubuted default fonts. Using a very large font-size, we are able to determine even the slightest change. When the width of the string changes, we know that the custom font-face file has been loaded and applied.\n\n## Install:\n\nGrab it with Bower: `bower install fontspy`\n\n## Usage:\n\n```javascript\nfontSpy('My Icons', {\n  glyphs: '\\ue81a\\ue82d\\ue823',\n  success: function() {\n    //alert(\"My Icons loaded successfully\");\n  },\n  failure: function() {\n    //alert(\"My Icons failed to load\");\n  }\n});\n```\n\nThe first argument passed to fontSpy is the name of the font-family. This is used to style the test string when checking width changes.\n\nThe second argument is for options that can be passed to jQuery-FontSpy.\n\nIf a custom font is loaded, a class with the font name is added to the html element.\nIf a custom font fails to load, a class with the font name prefixed with `no-` is add to the HTML element.\n\nFont names are converted to lowercase and spaces are removed when converted to class names to be used on the HTML element.\nFor example, the font name, `My Icons` will render as `myicons` when used an HTML class.\n\n\n## Options\n\n**glyphs:** If your font is mapped to PUA characters, you can pass a few of the glyphs contained in the custom font. We measure these characters to make sure the font has loaded successfully.\n\n**success:** If the font specified as in the first arguement passed to fontSpy loads, you can excute custom JavaScript here.\n\n**failure:** If the font specified as in the first arguement passed to fontSpy fails to load, you can excute custom JavaScript here.\n\n## Browser Support\n\nfontcheck has been tested and works in the following environments.\n\n* Chrome 40\n* Firefox 35\n* Safari 7.1\n* Internet Explorer 8, 9, 10, 11\n* Android 4.4.4 Stock Browser\n* iOS Safari 8.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickmarabeas%2Fjquery-fontspy.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickmarabeas%2Fjquery-fontspy.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickmarabeas%2Fjquery-fontspy.js/lists"}