From 814354713a6fc8d1eeda02095be7e7766c4be8a7 Mon Sep 17 00:00:00 2001 From: deb Date: Sun, 31 Jul 2016 06:27:58 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=B3=E3=83=88=E8=A1=A8?= =?UTF-8?q?=E3=81=AE=E4=BB=95=E6=A7=98=E3=81=8C=E5=A4=89=E3=82=8F=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/petitcomputer.d | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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() {