diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index 6c5ebe0..ad1b0eb 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -319,21 +319,24 @@ class PetitComputer int sppage, bgpage; void createFontTable() { - string html = cast(string)get("http://smileboom.com/special/ptcm3/download/unicode/"); - int pos = 0, index; auto file = File(fontTableFile, "w"); 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) { - pos = cast(int)html.indexOf("U+"); + pos = cast(int)html.indexOf("\r\nU+"); if(pos == -1) break; - pos += "U+".length; + pos += "\r\nU+".length; html = html[pos..$]; writeln(index = html.parse!int(16)); file.write(index, ','); - pos = cast(int)html.indexOf("("); + pos = cast(int)html.indexOf("\r\n("); if(pos == -1) break; - pos += "(".length; + pos += "\r\n(".length; html = html[pos..$]; writeln(fontTable[index].x = html.parse!int); file.write(fontTable[index].x, ','); @@ -345,6 +348,7 @@ class PetitComputer fontTable[index].w = 8; fontTable[index].h = 8; } + } } void loadFontTable() {