mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
Compare commits
No commits in common. "932d19ad188b29e03307a19f8eefce5c38dc53a0" and "a78e16644f0e684f59c1c07ada51a091976f5750" have entirely different histories.
932d19ad18
...
a78e16644f
3 changed files with 16 additions and 42 deletions
Binary file not shown.
Binary file not shown.
|
@ -63,51 +63,25 @@ const restore = async(type: any = 1) => {
|
|||
}
|
||||
state.status = state.status + "正在下载字库...<br />"
|
||||
let fontPacket = undefined
|
||||
if(type == 1){
|
||||
fontPacket = await fetch('/old_font.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(0x02000, binary)
|
||||
return;
|
||||
switch(type){
|
||||
case 1:
|
||||
fontPacket = await fetch('/old_font.bin')
|
||||
break
|
||||
default:
|
||||
alert('TODO')
|
||||
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 reader = fontPacket.body.getReader();
|
||||
const chunks = [];
|
||||
while(true) {
|
||||
const {done, value} = await reader.read();
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
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;
|
||||
chunks.push(...value)
|
||||
}
|
||||
const binary = new Uint8Array(chunks)
|
||||
await restoreRange(0x02000, binary)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue