More font editor stuff

This commit is contained in:
mniip 2020-03-10 01:18:12 +03:00
parent 6607b7e845
commit a38d8639e7

View File

@ -448,13 +448,15 @@ FontEditor::FontEditor(ByteString _header):
StringBuilder input; StringBuilder input;
input << Format::Hex() << Format::Width(2); input << Format::Hex() << Format::Width(2);
for(unsigned int ch = 0x20; ch <= 0xFF; ch += 0x10) for(auto p : fontRanges)
if(p[1] >= 0x20)
{ {
if(ch == 0x80) if(p[0] < 0x20)
input << "\n"; p[0] = 0x20;
else if(ch != 0x20) if(p[0] == p[1])
input << " 0a "; input << p[0] << "\n";
input << ch << ":" << (ch + 0x0F); else
input << p[0] << ":" << p[1] << "\n";
} }
inputPreview->SetText(input.Build()); inputPreview->SetText(input.Build());
textChangedCallback(); textChangedCallback();
@ -525,6 +527,7 @@ void FontEditor::Translate(std::array<std::array<char, MAX_WIDTH>, FONT_H> &pixe
pixels[j][i] = old[j - dy][i - dx]; pixels[j][i] = old[j - dy][i - dx];
else else
pixels[j][i] = 0; pixels[j][i] = 0;
savedButton->SetToggleState(false);
} }
void FontEditor::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) void FontEditor::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)