Skip to content

Commit

Permalink
Copy KaTeX fonts as binary rather than text files
Browse files Browse the repository at this point in the history
Set the `encoding` option to `false` [1] when copying KaTeX fonts so they are
treated as binary rather than text. This fixes an issue where the fonts were
corrupted in the process.

[1] https://gulpjs.com/docs/en/api/src/#options

Fixes #6526
  • Loading branch information
robertknight committed Aug 28, 2024
1 parent d342f95 commit 94bd6bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ gulp.task('build-fonts', () => {
// Fonts are located in a subdirectory of `build/styles` so that we can reuse
// KaTeX's CSS bundle directly without any URL rewriting.
const fontsDir = 'build/styles/fonts';
return gulp.src(fontFiles).pipe(changed(fontsDir)).pipe(gulp.dest(fontsDir));
return gulp
.src(fontFiles, { encoding: false })
.pipe(changed(fontsDir))
.pipe(gulp.dest(fontsDir));
});

gulp.task(
Expand Down

0 comments on commit 94bd6bb

Please sign in to comment.