1
0

フォント表の仕様が変わっていたので変更

This commit is contained in:
deb
2016-07-31 06:27:58 +09:00
parent fff9c59dc0
commit 814354713a

View File

@@ -319,21 +319,24 @@ class PetitComputer
int sppage, bgpage; int sppage, bgpage;
void createFontTable() void createFontTable()
{ {
string html = cast(string)get("http://smileboom.com/special/ptcm3/download/unicode/");
int pos = 0, index;
auto file = File(fontTableFile, "w"); auto file = File(fontTableFile, "w");
std.algorithm.fill(fontTable, SDL_Rect(488,120, 8, 8));//TODO:480,120とどっちが使われているかは要調査 std.algorithm.fill(fontTable, SDL_Rect(488,120, 8, 8));//TODO:480,120とどっちが使われているかは要調査
for (int i = 1; i <= 16; i++)
{
string html = cast(string)get("http://smilebasic.com/supplements/unicode" ~ format("%02d",i));
std.stdio.writeln("http://smilebasic.com/supplements/unicode" ~ format("%02d",i));
int pos = 0, index;
while(true) while(true)
{ {
pos = cast(int)html.indexOf("<tr><th>U+"); pos = cast(int)html.indexOf("<tr>\r\n<th>U+");
if(pos == -1) break; if(pos == -1) break;
pos += "<tr><th>U+".length; pos += "<tr>\r\n<th>U+".length;
html = html[pos..$]; html = html[pos..$];
writeln(index = html.parse!int(16)); writeln(index = html.parse!int(16));
file.write(index, ','); file.write(index, ',');
pos = cast(int)html.indexOf("</td><td>("); pos = cast(int)html.indexOf("</td>\r\n<td>(");
if(pos == -1) break; if(pos == -1) break;
pos += "</td><td>(".length; pos += "</td>\r\n<td>(".length;
html = html[pos..$]; html = html[pos..$];
writeln(fontTable[index].x = html.parse!int); writeln(fontTable[index].x = html.parse!int);
file.write(fontTable[index].x, ','); file.write(fontTable[index].x, ',');
@@ -345,6 +348,7 @@ class PetitComputer
fontTable[index].w = 8; fontTable[index].w = 8;
fontTable[index].h = 8; fontTable[index].h = 8;
} }
}
} }
void loadFontTable() void loadFontTable()
{ {