{"id":16239671,"url":"https://github.com/jalkoby/gulp-inline-fonts","last_synced_at":"2026-03-17T02:48:18.155Z","repository":{"id":57257904,"uuid":"51087365","full_name":"jalkoby/gulp-inline-fonts","owner":"jalkoby","description":"Web fonts with Gulp in a few actions ","archived":false,"fork":false,"pushed_at":"2019-05-05T20:42:58.000Z","size":59,"stargazers_count":11,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T09:06:33.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/jalkoby.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":"2016-02-04T16:05:53.000Z","updated_at":"2022-03-14T10:12:35.000Z","dependencies_parsed_at":"2022-08-25T21:22:48.100Z","dependency_job_id":null,"html_url":"https://github.com/jalkoby/gulp-inline-fonts","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalkoby%2Fgulp-inline-fonts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalkoby%2Fgulp-inline-fonts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalkoby%2Fgulp-inline-fonts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalkoby%2Fgulp-inline-fonts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jalkoby","download_url":"https://codeload.github.com/jalkoby/gulp-inline-fonts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244463799,"owners_count":20456944,"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":"2024-10-10T13:44:37.485Z","updated_at":"2026-03-17T02:48:18.102Z","avatar_url":"https://github.com/jalkoby.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-inline-fonts\n\n[![Build Status](https://travis-ci.org/jalkoby/gulp-inline-fonts.svg?branch=master)](https://travis-ci.org/jalkoby/gulp-inline-fonts)\n[![npm version](https://badge.fury.io/js/gulp-inline-fonts.svg)](https://badge.fury.io/js/gulp-inline-fonts)\n\nThe plug-in converts fonts into a standalone css file. The primary use-case is to make one file stylesheet when you have a custom fonts.\n\n## Installation\n\nInstall package with NPM and add it to your development dependencies:\n\n`npm i --save-dev gulp-inline-fonts`\n\n## Examples of usage\n\n### An icon font\n\nLet's suppose you have a custom icon font inside `assets/fonts/icons/` directory and want to include it inline into the stylesheets. To do it just add the follow into `gulpfile.js`:\n```js\n  var gulp = require('gulp'),\n    inlineFonts = require('gulp-inline-fonts');\n\n  gulp.task('icons', function() {\n    return gulp.src(['assets/fonts/icons/*'])\n      .pipe(inlineFonts({ name: 'icons' }))\n      .pipe(gulp.dest('dist/fonts/'));\n  });\n```\nThe plug-in will take supported formats(.woff \u0026 .woff2 by default), convert them into base64 and write into `dist/fonts/icons.css` next:\n\n```css\n  @font-face {\n    font-family: \"icons\";\n    font-style: normal;\n    font-stretch: normal;\n    font-weight: 400;\n    font-display: auto;\n    src: local(\"icons\"), url(\"data:application/font-woff;base64,...\") format(\"woff\"),\n      url(\"data:application/font-woff2;base64,...\") format(\"woff2\");\n  }\n```\n\n### A custom type font\n\nIn contrast to the icon font example a custom type font frequently has a few weights and styles (normal, bold,\nitalic \u0026 etc) like below:\n\n```bash\n$: ls src/fonts/thesans\n200.woff   # light\n200-i.woff # italic light\n400.woff   # normal\n400-i.woff # italic\n700.woff   # bold\n700-i.woff # italic bold\n```\n\nTo compile them into a single css file add this code:\n\n```js\nvar gulp = require('gulp'),\n  inline = require('gulp-inline-fonts'),\n  concat = require('gulp-concat'),\n  merge  = require('merge-stream');\n\ngulp.task('fonts', function() {\n  // create an accumulated stream\n  var fontStream = merge();\n\n  [200, 400, 700].forEach(function(weight) {\n    // a regular version\n    fontStream.add(gulp.src(`src/fonts/thesans/${weight}.woff`)\n                    .pipe(inline({ name: 'thesans', weight: weight, formats: ['woff'] })));\n\n    // an italic version\n    fontStream.add(gulp.src(`src/fonts/thesans/${weight}-i.woff`)\n                    .pipe(inline({ name: 'thesans', weight: weight, formats: ['woff'], style: 'italic' })));\n  });\n\n  return fontStream.pipe(concat('thesans.css')).pipe(gulp.dest('build'));\n});\n```\n\n## Default options\n```js\n{\n  name: 'font',\n  style: 'normal',\n  stretch: 'normal',\n  weight: 400,\n  display: 'auto',\n  formats: ['woff', 'woff2'] // also supported: 'ttf', 'eot', 'otf', 'svg'\n}\n```\n\n## Other solutions\n- [gulp-cssfont64](https://github.com/247even/gulp-cssfont64/tree/master/test)\n- [gulp-base64-webfont-css](https://github.com/ygoto3/gulp-base64-webfont-css)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalkoby%2Fgulp-inline-fonts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjalkoby%2Fgulp-inline-fonts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalkoby%2Fgulp-inline-fonts/lists"}