Start displaying TrueType fonts
This commit is contained in:
parent
2315131b90
commit
34357eac19
10
fonts.js
10
fonts.js
@ -103,7 +103,7 @@ var Font = (function () {
|
|||||||
|
|
||||||
// If the font is to be ignored, register it like an already loaded font
|
// If the font is to be ignored, register it like an already loaded font
|
||||||
// to avoid the cost of waiting for it be be loaded by the platform.
|
// to avoid the cost of waiting for it be be loaded by the platform.
|
||||||
if (properties.ignore || properties.type == "TrueType" || kDisableFonts) {
|
if (properties.ignore || kDisableFonts) {
|
||||||
Fonts[name] = {
|
Fonts[name] = {
|
||||||
data: file,
|
data: file,
|
||||||
loading: false,
|
loading: false,
|
||||||
@ -368,11 +368,11 @@ var Font = (function () {
|
|||||||
var length = FontsUtils.bytesToInteger(file.getBytes(4));
|
var length = FontsUtils.bytesToInteger(file.getBytes(4));
|
||||||
|
|
||||||
// Read the table associated data
|
// Read the table associated data
|
||||||
var currentPosition = file.pos;
|
var previousPosition = file.pos;
|
||||||
file.pos = file.start + offset;
|
file.pos = file.start ? file.start : 0;
|
||||||
|
file.skip(offset);
|
||||||
var data = file.getBytes(length);
|
var data = file.getBytes(length);
|
||||||
file.pos = currentPosition;
|
file.pos = previousPosition;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
tag: tag,
|
tag: tag,
|
||||||
|
9
pdf.js
9
pdf.js
@ -2199,8 +2199,13 @@ var CanvasGraphics = (function() {
|
|||||||
var tokens = [];
|
var tokens = [];
|
||||||
var token = "";
|
var token = "";
|
||||||
|
|
||||||
var buffer = cmapObj.ensureBuffer ? cmapObj.ensureBuffer() : cmapObj;
|
var length = cmapObj.length;
|
||||||
var cmap = cmapObj.getBytes(buffer.byteLength);
|
if (cmapObj instanceof FlateStream) {
|
||||||
|
cmapObj.readBlock();
|
||||||
|
length = cmapObj.bufferLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmap = cmapObj.getBytes(length);
|
||||||
for (var i =0; i < cmap.length; i++) {
|
for (var i =0; i < cmap.length; i++) {
|
||||||
var byte = cmap[i];
|
var byte = cmap[i];
|
||||||
if (byte == 0x20 || byte == 0x0A || byte == 0x3C || byte == 0x3E) {
|
if (byte == 0x20 || byte == 0x0A || byte == 0x3C || byte == 0x3E) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user