diff options
Diffstat (limited to 'Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp')
-rw-r--r-- | Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp index d6f97eb0377..9946e7cc26a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp @@ -2,7 +2,7 @@ ** JFM.cpp ** ** ** ** This file is part of dvisvgm -- a fast DVI to SVG converter ** -** Copyright (C) 2005-2016 Martin Gieseking <martin.gieseking@uos.de> ** +** Copyright (C) 2005-2017 Martin Gieseking <martin.gieseking@uos.de> ** ** ** ** This program is free software; you can redistribute it and/or ** ** modify it under the terms of the GNU General Public License as ** @@ -23,8 +23,8 @@ #include <cstring> #include <fstream> #include <sstream> -#include "JFM.h" -#include "StreamReader.h" +#include "JFM.hpp" +#include "StreamReader.hpp" using namespace std; @@ -32,26 +32,26 @@ using namespace std; JFM::JFM (istream &is) { is.seekg(0); StreamReader reader(is); - UInt16 id = UInt16(reader.readUnsigned(2)); // JFM ID (9 or 11) + uint16_t id = uint16_t(reader.readUnsigned(2)); // JFM ID (9 or 11) if (id != 9 && id != 11) { ostringstream oss; oss << "invalid JFM identifier " << id << " (9 or 11 expected)"; throw FontMetricException(oss.str()); } _vertical = (id == 9); - UInt16 nt = UInt16(reader.readUnsigned(2)); // length of character type table - UInt16 lf = UInt16(reader.readUnsigned(2)); // length of entire file in 4 byte words - UInt16 lh = UInt16(reader.readUnsigned(2)); // length of header in 4 byte words - UInt16 bc = UInt16(reader.readUnsigned(2)); // smallest character code in font - UInt16 ec = UInt16(reader.readUnsigned(2)); // largest character code in font - UInt16 nw = UInt16(reader.readUnsigned(2)); // number of words in width table - UInt16 nh = UInt16(reader.readUnsigned(2)); // number of words in height table - UInt16 nd = UInt16(reader.readUnsigned(2)); // number of words in depth table - UInt16 ni = UInt16(reader.readUnsigned(2)); // number of words in italic corr. table - UInt16 nl = UInt16(reader.readUnsigned(2)); // number of words in glue/kern table - UInt16 nk = UInt16(reader.readUnsigned(2)); // number of words in kern table - UInt16 ng = UInt16(reader.readUnsigned(2)); // number of words in glue table - UInt16 np = UInt16(reader.readUnsigned(2)); // number of font parameter words + uint16_t nt = uint16_t(reader.readUnsigned(2)); // length of character type table + uint16_t lf = uint16_t(reader.readUnsigned(2)); // length of entire file in 4 byte words + uint16_t lh = uint16_t(reader.readUnsigned(2)); // length of header in 4 byte words + uint16_t bc = uint16_t(reader.readUnsigned(2)); // smallest character code in font + uint16_t ec = uint16_t(reader.readUnsigned(2)); // largest character code in font + uint16_t nw = uint16_t(reader.readUnsigned(2)); // number of words in width table + uint16_t nh = uint16_t(reader.readUnsigned(2)); // number of words in height table + uint16_t nd = uint16_t(reader.readUnsigned(2)); // number of words in depth table + uint16_t ni = uint16_t(reader.readUnsigned(2)); // number of words in italic corr. table + uint16_t nl = uint16_t(reader.readUnsigned(2)); // number of words in glue/kern table + uint16_t nk = uint16_t(reader.readUnsigned(2)); // number of words in kern table + uint16_t ng = uint16_t(reader.readUnsigned(2)); // number of words in glue table + uint16_t np = uint16_t(reader.readUnsigned(2)); // number of font parameter words if (7+nt+lh+(ec-bc+1)+nw+nh+nd+ni+nl+nk+ng+np != lf) throw FontMetricException("inconsistent length values"); @@ -67,10 +67,10 @@ JFM::JFM (istream &is) { void JFM::readTables (StreamReader &reader, int nt, int nw, int nh, int nd, int ni) { // determine smallest charcode with chartype > 0 - UInt16 minchar=0xFFFF, maxchar=0; + uint16_t minchar=0xFFFF, maxchar=0; for (int i=0; i < nt; i++) { - UInt16 c = (UInt16)reader.readUnsigned(2); - UInt16 t = (UInt16)reader.readUnsigned(2); + uint16_t c = (uint16_t)reader.readUnsigned(2); + uint16_t t = (uint16_t)reader.readUnsigned(2); if (t > 0) { minchar = min(minchar, c); maxchar = max(maxchar, c); @@ -80,11 +80,11 @@ void JFM::readTables (StreamReader &reader, int nt, int nw, int nh, int nd, int if (minchar <= maxchar) { _minchar = minchar; _charTypeTable.resize(maxchar-minchar+1); - memset(&_charTypeTable[0], 0, nt*sizeof(UInt16)); + memset(&_charTypeTable[0], 0, nt*sizeof(uint16_t)); reader.seek(-nt*4, ios::cur); for (int i=0; i < nt; i++) { - UInt16 c = (UInt16)reader.readUnsigned(2); - UInt16 t = (UInt16)reader.readUnsigned(2); + uint16_t c = (uint16_t)reader.readUnsigned(2); + uint16_t t = (uint16_t)reader.readUnsigned(2); if (c >= minchar) _charTypeTable[c-minchar] = t; } @@ -94,7 +94,7 @@ void JFM::readTables (StreamReader &reader, int nt, int nw, int nh, int nd, int int JFM::charIndex (int c) const { - UInt16 chartype = 0; + uint16_t chartype = 0; if (!_charTypeTable.empty() && c >= _minchar && size_t(c) < _minchar+_charTypeTable.size()) chartype = _charTypeTable[c-_minchar]; return TFM::charIndex(chartype); |