Thanks, ill take a look at it!
I always insist on features like this being fully 100% unit tested before I will allow them into a codebase. If a developer is willing to do that amount of work, then they really believe in the feature. If they are not - then they self-select out. Generally I prefer 80% unit test coverage on a codebase. But I typically enforce 100% on new features and then let people argue why they couldnât hit 100%.
But more importantly it means that after that developer is on a new project, we still have documentation through unit test code of how a feature was intended to work.
Hardware and driver related things are unfortunately a nightmare to unit test or to test in general, and as anyone who has used printers knows theyâre fickle and hard to make work to begin with, from a driver and OS perspective, making it hard to know what is wrong if something doesnât work
I actually used to test printers. I worked with a trade group of printer manufactures implementing Bluetooth printing many years ago. But going back to the idea that theyâre a nightmare to test, thatâs how I would keep something like this out. The sheer volume of unit tests would make it infeasible to use. Basically I would weaponize the difficulty of testing. Which is why in my first post I recommended to OP to just make a PDF using Adobeâs library. Then all the fiddly bits are tested by Adobe.
Exporting to PDF is absolutely the portable and convenient solution, especially as even when printing a lot of it is to documents to send by email etc. anyway (I havenât printed much in years, except some contracts, most of the things I do like invoices or paperwork to the government etc. are either digital forms or PDFs)
This can already be achieved by following these steps:
- Make your Godot project write an HTML file using the FileAccess class.
- Add
<script>window.print()</script>at the bottom of the<body>of the HTML file, so that the browserâs print dialog appears immediately. - Open the HTML file in the userâs default web browser using
OS.shell_open(path_to_html_file). - The page will open and show the print dialog immediately. In all modern browsers, the user can choose to print to PDF (saving a PDF file), or print using a local or network printer.
I just got a cool idea.
A game you need a PRINTER to play, as the game prints hints enigms etc
This is just a totally rough concept that I have no idea how could be put in action
but still, if we wanted to use a printer in video games, thatâs one way
This is the most common and simple way to do the simple things that is not in Godot,use the OS thing! Like for checking vram,printing and many cool things!
But someone says WinDowS Doesnât Allows it!
Why! Why Bill?
Where did you see this?
ohh,someone said that windows donât allows new apps to run cmd commands, execute exe etc ,Which is I am pretty sure true.I think windows thinks someone will install a malware
@Calinou I found it
Iâm going to make my own âXbox Live Goldâ for gaming printer ink / toner service. Thanks for the idea ![]()
Genius.
Iâve never thought Iâd hear of a gaming ink lol.
found it
That comment only applies to PowerShell script execution, not executing commands (or even Batch files) using OS.execute().
You need to use PowerShell to get the GPU VRAM amount without external programs, but you donât need to run an external program.
That said, here, we donât even need to use OS.execute(). We just use OS.shell_open(), which makes the file be opened with the userâs default program for the given file type.