From 77b7b0b9686403181aae2c93c8899cc4e5ea9196 Mon Sep 17 00:00:00 2001 From: Eugenio Parodi Date: Thu, 14 Dec 2023 00:28:48 +0000 Subject: [PATCH] Fixed the font loading in the HTML exporter --- docs/MDNotes/Games.md | 29 +++ tests/sandbox/Makefile | 4 +- tests/sandbox/sandbox.NerdFont.html | 202 ++++++++++++++++++ tests/sandbox/sandbox.html | 3 +- .../standalone.fullscreen.NerdFont.html | 95 ++++++++ 5 files changed, 331 insertions(+), 2 deletions(-) create mode 100644 docs/MDNotes/Games.md create mode 100644 tests/sandbox/sandbox.NerdFont.html create mode 100644 tests/sandbox/standalone.fullscreen.NerdFont.html diff --git a/docs/MDNotes/Games.md b/docs/MDNotes/Games.md new file mode 100644 index 00000000..1acf7b5b --- /dev/null +++ b/docs/MDNotes/Games.md @@ -0,0 +1,29 @@ +# Intro +This page include a list of game that can be made using [pyTermTk](https://github.com/ceccopierangiolieugenio/pyTermTk). + +## Features +Full mouse support and key presses, full glyphs set available on a standard terminal, plus NerdFonts and emoji if required + +## Limitation +Any game cannot take advantage of the keyboard events up/down +For this reason games like MarioBros are not technically possible on a terminal where the release of the key is required for the interaztion + + +# Released +* Breakout - The Roguelike + https://ceccopierangiolieugenio.itch.io/breakoutrl + +# Prototypes + +# Ideas +* Fruit Ninja +* Diablo - Can be played via mouse, keyboard can be used for the potions and basic interaction +* Syndicate +* Lemmings +* Puzzle bobble +* Minesweeper +* Any terminal roguelike +* Whac-A-Mole +* Dungeon Master +* Flappy Bird +* \ No newline at end of file diff --git a/tests/sandbox/Makefile b/tests/sandbox/Makefile index 5cad54f7..04859ddd 100644 --- a/tests/sandbox/Makefile +++ b/tests/sandbox/Makefile @@ -4,7 +4,7 @@ testSandbox: python3 -m http.server --directory ./ www: - mkdir -p www/pyodide www/xterm/ www/xterm-addon-fit www/codemirror www/codemirror/theme www/codemirror/modes www/fontawesome www/w2ui www/webfonts + mkdir -p www/pyodide www/xterm/ www/xterm-addon-fit www/codemirror www/codemirror/theme www/codemirror/modes www/fontawesome www/w2ui www/webfonts www/nerdfonts wget -P www/pyodide/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/pyodide/pyodide.js wget -P www/pyodide/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/pyodide/python_stdlib.zip @@ -25,6 +25,8 @@ www: wget -P www/fontawesome/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/fontawesome/fontawesome.min.css wget -P www/webfonts/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/webfonts/fa-regular-400.woff2 + wget -P www/nerdfonts/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/nerdfonts/HurmitNerdFontMono-Regular.otf + wget -P www/nerdfonts/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/nerdfonts/DejaVuSansMNerdFont-Regular.ttf wget -P www/w2ui/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/w2ui/w2ui-2.0.min.js wget -P www/w2ui/ https://ceccopierangiolieugenio.github.io/binaryRepo/pyTermTk/www/w2ui/w2ui-2.0.min.css diff --git a/tests/sandbox/sandbox.NerdFont.html b/tests/sandbox/sandbox.NerdFont.html new file mode 100644 index 00000000..dced2e1b --- /dev/null +++ b/tests/sandbox/sandbox.NerdFont.html @@ -0,0 +1,202 @@ + + + + + Mr. pyTermTk Sandbox + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/tests/sandbox/sandbox.html b/tests/sandbox/sandbox.html index 0357d3f0..9557835c 100644 --- a/tests/sandbox/sandbox.html +++ b/tests/sandbox/sandbox.html @@ -90,6 +90,8 @@ term.open(document.getElementById('terminal')); + fitAddon.fit() + // start observing the terminal for resize const resize_ob = new ResizeObserver(function(entries) {fitAddon.fit();}); resize_ob.observe(document.querySelector("#terminal")); @@ -174,7 +176,6 @@ ttkProxy.run(getCode(), filename,fps) }; run() - fitAddon.fit() } main() diff --git a/tests/sandbox/standalone.fullscreen.NerdFont.html b/tests/sandbox/standalone.fullscreen.NerdFont.html new file mode 100644 index 00000000..22eb22db --- /dev/null +++ b/tests/sandbox/standalone.fullscreen.NerdFont.html @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + \ No newline at end of file