diff --git a/data/font.cpp b/data/font.cpp index 89cd22d89..cc8cec547 100644 --- a/data/font.cpp +++ b/data/font.cpp @@ -610,7 +610,7 @@ extern const unsigned char font_data[] = { 0x0A, 0x00, 0x00, 0x00, 0x74, 0x00, 0xD0, 0x1F, 0x40, 0x8B, 0x07, 0x3D, 0xF3, 0xF1, 0x3F, 0x3F, 0xFD, 0xF8, 0x41, 0xFF, 0x07, 0xD0, 0x1C, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -extern const unsigned short font_ptrs[] = { +extern const unsigned int font_ptrs[] = { 0x0000, 0x0010, 0x0020, 0x0030, 0x0040, 0x0050, 0x0060, 0x0070, 0x0080, 0x0090, 0x00A0, 0x00B0, 0x00C0, 0x00D0, 0x00E0, 0x00F0, 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, diff --git a/data/font.h b/data/font.h index 175363a85..713d515c6 100644 --- a/data/font.h +++ b/data/font.h @@ -2,10 +2,10 @@ #define FONT_H 12 #ifndef FONTEDITOR extern const unsigned char font_data[]; -extern const unsigned short font_ptrs[]; +extern const unsigned int font_ptrs[]; extern const unsigned int font_ranges[][2]; #else extern unsigned char *font_data; -extern unsigned short *font_ptrs; +extern unsigned int *font_ptrs; extern unsigned int (*font_ranges)[2]; #endif diff --git a/src/gui/font/FontEditor.cpp b/src/gui/font/FontEditor.cpp index 09288dccf..4ba6480e6 100644 --- a/src/gui/font/FontEditor.cpp +++ b/src/gui/font/FontEditor.cpp @@ -18,7 +18,7 @@ #ifdef FONTEDITOR unsigned char *font_data; -unsigned short *font_ptrs; +unsigned int *font_ptrs; unsigned int (*font_ranges)[2]; void FontEditor::ReadDataFile(ByteString dataFile) @@ -122,7 +122,7 @@ void FontEditor::ReadDataFile(ByteString dataFile) file.close(); } -void FontEditor::WriteDataFile(ByteString dataFile, std::vector const &fontData, std::vector const &fontPtrs, std::vector > const &fontRanges) +void FontEditor::WriteDataFile(ByteString dataFile, std::vector const &fontData, std::vector const &fontPtrs, std::vector > const &fontRanges) { std::fstream file; file.open(dataFile, std::ios_base::out | std::ios_base::trunc); @@ -155,7 +155,7 @@ void FontEditor::WriteDataFile(ByteString dataFile, std::vector c else file << " "; first = false; - file << "0x" << std::setw(4) << (unsigned int)fontPtrs[pos++] << ","; + file << "0x" << std::setw(8) << (unsigned int)fontPtrs[pos++] << ","; } file << std::endl; } @@ -171,7 +171,7 @@ void FontEditor::UnpackData( std::map &fontWidths, std::map, FONT_H> > &fontPixels, std::vector const &fontData, - std::vector const &fontPtrs, + std::vector const &fontPtrs, std::vector > const &fontRanges) { fontWidths.clear(); @@ -204,7 +204,7 @@ void FontEditor::PackData( std::map const &fontWidths, std::map, FONT_H> > const &fontPixels, std::vector &fontData, - std::vector &fontPtrs, + std::vector &fontPtrs, std::vector > &fontRanges) { fontData.clear(); @@ -490,7 +490,7 @@ FontEditor::FontEditor(ByteString target, ByteString source): tgtFontPixels[p.first] = p.second; } std::vector tmpFontData; - std::vector tmpFontPtrs; + std::vector tmpFontPtrs; std::vector > tmpFontRanges; PackData(tgtFontWidths, tgtFontPixels, tmpFontData, tmpFontPtrs, tmpFontRanges); WriteDataFile(target, tmpFontData, tmpFontPtrs, tmpFontRanges); @@ -652,7 +652,7 @@ void FontEditor::Render() void FontEditor::Save() { std::vector tmpFontData; - std::vector tmpFontPtrs; + std::vector tmpFontPtrs; std::vector > tmpFontRanges; PackData(fontWidths, fontPixels, tmpFontData, tmpFontPtrs, tmpFontRanges); WriteDataFile(dataFile, tmpFontData, tmpFontPtrs, tmpFontRanges); diff --git a/src/gui/font/FontEditor.h b/src/gui/font/FontEditor.h index 25c2f759e..f39427080 100644 --- a/src/gui/font/FontEditor.h +++ b/src/gui/font/FontEditor.h @@ -25,7 +25,7 @@ private: std::map, FONT_H> > fontPixels; std::vector fontData; - std::vector fontPtrs; + std::vector fontPtrs; std::vector > fontRanges; ByteString beforeFontData; @@ -34,18 +34,18 @@ private: ByteString afterFontRanges; void ReadDataFile(ByteString dataFile); - void WriteDataFile(ByteString dataFile, std::vector const &fontData, std::vector const &fontPtrs, std::vector > const &fontRanges); + void WriteDataFile(ByteString dataFile, std::vector const &fontData, std::vector const &fontPtrs, std::vector > const &fontRanges); static void PackData( std::map const &fontWidths, std::map, FONT_H> > const &fontPixels, std::vector &fontData, - std::vector &fontPtrs, + std::vector &fontPtrs, std::vector > &fontRanges); static void UnpackData( std::map &fontWidths, std::map, FONT_H> > &fontPixels, std::vector const &fontData, - std::vector const &fontPtrs, + std::vector const &fontPtrs, std::vector > const &fontRanges); ui::Textbox *currentCharTextbox;