mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-29 11:42:23 +01:00
Fixes #9925: convert font data to base64, fixing 0xefbfbd (Unicode Replacement Character) chars in customizer fonts.
Merges #9982
This commit is contained in:
parent
58a47b6bfd
commit
aad70834fc
@ -3,6 +3,7 @@
|
||||
module.exports = function(grunt) {
|
||||
"use strict";
|
||||
|
||||
var btoa = require('btoa')
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
|
||||
@ -209,7 +210,8 @@ module.exports = function(grunt) {
|
||||
return type == 'fonts' ? true : new RegExp('\\.' + type + '$').test(path)
|
||||
})
|
||||
.forEach(function (path) {
|
||||
return files[path] = fs.readFileSync(type + '/' + path, 'utf8')
|
||||
return type == 'fonts' ? files[path] = btoa(fs.readFileSync(type + '/' + path)) :
|
||||
files[path] = fs.readFileSync(type + '/' + path, 'utf8')
|
||||
})
|
||||
return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
if (fonts) {
|
||||
var fontsFolder = zip.folder('fonts')
|
||||
for (var fileName in fonts) {
|
||||
fontsFolder.file(fileName, fonts[fileName])
|
||||
fontsFolder.file(fileName, fonts[fileName], {base64: true})
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -20,7 +20,8 @@
|
||||
}
|
||||
]
|
||||
, "devDependencies": {
|
||||
"grunt": "~0.4.1"
|
||||
"btoa": "~1.1.1"
|
||||
, "grunt": "~0.4.1"
|
||||
, "grunt-contrib-clean": "~0.5.0"
|
||||
, "grunt-contrib-concat": "~0.3.0"
|
||||
, "grunt-contrib-connect": "~0.5.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user