Skip to content

Commit

Permalink
empiric fixes fntsize for console
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p committed Dec 3, 2023
1 parent fa2fe67 commit bf0c294
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
1 change: 1 addition & 0 deletions pygbag/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@
else:
time.sleep(dt)
print("sim loop exited")
sys.stdout.flush()
1 change: 1 addition & 0 deletions pygbag/support/cross/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def overloaded(i, *attrs):
leave = enter + spent

from asyncio import *
from asyncio import exceptions

__run__ = run

Expand Down
11 changes: 4 additions & 7 deletions static/pythons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1012,15 +1012,12 @@ async function feat_vtx(debug_hidden) {
const { WasmTerminal } = await import("./vtx.js")
const lines = get_terminal_lines() // including virtual get_terminal_console()
const py = window.document.body.clientHeight
var fntsize = Math.floor(py/lines) - 7
var fntsize = Math.floor(py/lines) - 2

// if (lines<45)
// fntsize -= 3
// why ????????
if (fntsize>32) fntsize--
if (fntsize>20) fntsize--

if (py>720)
fntsize += 1
if (py>1024)
fntsize += 1
console.warn("fnt:",window.document.body.clientHeight ,"/", lines,"=", fntsize)
vm.vt = new WasmTerminal(
"terminal",
Expand Down
37 changes: 15 additions & 22 deletions static/vtx.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,43 +48,36 @@ export class WasmTerminal {
this.inputStartCursor = null

this.nodup = 1
var theme = { background: '#1a1c1f' }
var theme = {
background: '#1a1c1f'
}


var transparency = false
var sback = 1000

if (is_fbdev) {
theme = {
foreground: '#ffffff',
background: 'rgba(0, 0, 0, 0)',
cursor: '#ffffff',
selection: 'rgba(255, 255, 255, 0.3)',
black: '#000000',
red: '#e06c75',
brightRed: '#e06c75',
green: '#A4EFA1',
brightGreen: '#A4EFA1',
brightYellow: '#EDDC96',
yellow: '#EDDC96',
magenta: '#e39ef7',
brightMagenta: '#e39ef7',
cyan: '#5fcbd8',
brightBlue: '#5fcbd8',
brightCyan: '#5fcbd8',
blue: '#5fcbd8',
white: '#d0d0d0',
brightBlack: '#808080',
brightWhite: '#ffffff'
background: 'rgba(0, 0, 0, 0)'
}
sback = 0
transparency = true
}

this.xterm = new Terminal(
{
// rendererType : "dom",
rendererType : "webgl",
experimentalCharAtlas : "webgl",
theme: theme,
allowTransparency: transparency,
allowProposedApi : true , // xterm 0.5 + sixel
scrollback: 0,
scrollback: sback,
fontFamily: 'Courier-new, courier, monospace',
fontSize: (fontsize || 12),
cols: (cols || 132), rows: (rows || 32)
cols: (cols || 132),
rows: (rows || 32)
}
);

Expand Down

0 comments on commit bf0c294

Please sign in to comment.