Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
utf8mb4
Commit Description:
utf8mb4
import TTFFont from './TTFFont' ;
import WOFFDirectory from './tables/WOFFDirectory' ;
import tables from './tables' ;
import inflate from 'tiny-inflate' ;
import r from 'restructure' ;
export default class WOFFFont extends TTFFont {
static probe ( buffer ) {
return buffer . toString ( 'ascii' , 0 , 4 ) === 'wOFF' ;
}
_decodeDirectory () {
this . directory = WOFFDirectory . decode ( this . stream , { _startOffset : 0 });
}
_getTableStream ( tag ) {
let table = this . directory . tables [ tag ];
if ( table ) {
this . stream . pos = table . offset ;
if ( table . compLength < table . length ) {
this . stream . pos += 2 ; // skip deflate header
let outBuffer = new Buffer ( table . length );
let buf = inflate ( this . stream . readBuffer ( table . compLength - 2 ), outBuffer );
return new r . DecodeStream ( buf );
} else {
return this . stream ;
}
}
return null ;
}
}
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings