mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 08:15:18 +00:00
Compare commits
2 commits
a78e16644f
...
932d19ad18
Author | SHA1 | Date | |
---|---|---|---|
932d19ad18 | |||
6df014f878 |
3 changed files with 43 additions and 17 deletions
BIN
public/new_font_h.bin
Normal file
BIN
public/new_font_h.bin
Normal file
Binary file not shown.
BIN
public/new_font_k.bin
Normal file
BIN
public/new_font_k.bin
Normal file
Binary file not shown.
|
@ -63,25 +63,51 @@ const restore = async(type: any = 1) => {
|
||||||
}
|
}
|
||||||
state.status = state.status + "正在下载字库...<br />"
|
state.status = state.status + "正在下载字库...<br />"
|
||||||
let fontPacket = undefined
|
let fontPacket = undefined
|
||||||
switch(type){
|
if(type == 1){
|
||||||
case 1:
|
fontPacket = await fetch('/old_font.bin')
|
||||||
fontPacket = await fetch('/old_font.bin')
|
const reader = fontPacket.body.getReader();
|
||||||
break
|
const chunks = [];
|
||||||
default:
|
while(true) {
|
||||||
alert('TODO')
|
const {done, value} = await reader.read();
|
||||||
return
|
if (done) {
|
||||||
}
|
break;
|
||||||
const reader = fontPacket.body.getReader();
|
}
|
||||||
const chunks = [];
|
chunks.push(...value)
|
||||||
while(true) {
|
|
||||||
const {done, value} = await reader.read();
|
|
||||||
if (done) {
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
chunks.push(...value)
|
const binary = new Uint8Array(chunks)
|
||||||
|
await restoreRange(0x02000, binary)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(type == 2){
|
||||||
|
fontPacket = await fetch('/new_font_k.bin')
|
||||||
|
const reader = fontPacket.body.getReader();
|
||||||
|
const chunks = [];
|
||||||
|
while(true) {
|
||||||
|
const {done, value} = await reader.read();
|
||||||
|
if (done) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
chunks.push(...value)
|
||||||
|
}
|
||||||
|
const binary = new Uint8Array(chunks)
|
||||||
|
await restoreRange(0x02480, binary)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(type == 3){
|
||||||
|
fontPacket = await fetch('/new_font_h.bin')
|
||||||
|
const reader = fontPacket.body.getReader();
|
||||||
|
const chunks = [];
|
||||||
|
while(true) {
|
||||||
|
const {done, value} = await reader.read();
|
||||||
|
if (done) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
chunks.push(...value)
|
||||||
|
}
|
||||||
|
const binary = new Uint8Array(chunks)
|
||||||
|
await restoreRange(0x02480, binary)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const binary = new Uint8Array(chunks)
|
|
||||||
await restoreRange(0x02000, binary)
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue