Compare commits

...

2 commits

Author SHA1 Message Date
932d19ad18 update 2024-01-31 23:58:41 +08:00
6df014f878 update 2024-01-31 23:54:53 +08:00
3 changed files with 43 additions and 17 deletions

BIN
public/new_font_h.bin Normal file

Binary file not shown.

BIN
public/new_font_k.bin Normal file

Binary file not shown.

View file

@ -63,14 +63,8 @@ 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')
break
default:
alert('TODO')
return
}
const reader = fontPacket.body.getReader(); const reader = fontPacket.body.getReader();
const chunks = []; const chunks = [];
while(true) { while(true) {
@ -82,6 +76,38 @@ const restore = async(type: any = 1) => {
} }
const binary = new Uint8Array(chunks) const binary = new Uint8Array(chunks)
await restoreRange(0x02000, binary) 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;
}
} }
</script> </script>