|
Post by xxgeek on Aug 4, 2021 19:09:00 GMT
I'm pretty sure I got the font from the same site as you tsh73, and the code above works using OldLondon with no space. Strange, I may have downed a different file, a zipped one with four files. 2 otf and 2 ttf
honky mentioned wrong font in texeditor and textbox, but before I edited honky's code there was no font included for the textbox. The texteditor had code for the font and worked here, so did the graphicbox text. I added the code for the button, just to check it too.
The last code posted should work for him. Honky stated that when he ran the code posted using my old BAS2EXE window, the font showed up as it should have, and in that code the name used was OldLondon - no space.
EDIT - I tried both with and without the underscore. They both worked....
|
|
|
Post by honky on Aug 5, 2021 8:38:15 GMT
that works ! that works ! But hey, I will not allow myself to add fonts in OS that do not belong to me, it is too intrusive. xxgeek, you are a master coder, well done!
EDIT: I'm under XP, but i've Win10 also
|
|
|
Post by xxgeek on Aug 5, 2021 16:17:46 GMT
that works ! that works ! But hey, I will not allow myself to add fonts in OS that do not belong to me, it is too intrusive. xxgeek, you are a master coder, well done! EDIT: I'm under XP, but i've Win10 also My error logs have issues with "master coder" lol Not a problem installing things on other PC's, as long as you "ask" first, with option to decline. Old Aesop fable "Where there is a will, there is a way" If JB code isn't up to the task, there is always what is built into Windows OS to help you get intended results. The command interpreter(.cmd), Powershell Scripts(.ps1), Visual Basic Scripts(.vbs), Java Scripts(.js) are all available for use with JB, each with their own capabilities and limits. Visual Basic Scripts(.vbs) are the easiest of them all since the code is very similar to JB code and are "allowed" to run through wscript. Powershell scripts are not allowed to run, so that's when you would need to bypass security, and policy restrictions. Not a problem. Use vbs script to do that, then run the powershell script. In this case there was no need to bypass security, or policy restrictions, since they don't care if a new font is installed. They are more concerned with mailware, viruses etc. Happy to help people learn their options. Never say "It can't be done" If you hear it said, repeat to yourself "Maybe "they" can't do it, but I sure as heck can" Then go do it. Be the best "magician" you can be.
|
|
|
Post by honky on Aug 6, 2021 7:49:50 GMT
You open up great perspectives. Thank you for.
|
|
|
Post by honky on Aug 20, 2021 11:07:01 GMT
I see you put some kind of delay
for x = 1 to 4000000 next x
Which implies that JB is multitasking, which I think is not. While JB is counting in the loop, he's not doing anything else. It does not give time for other actions. What is it?
|
|
|
Post by tsh73 on Aug 20, 2021 11:25:52 GMT
Then you run stuff, JB does not wait for completion - it instantly moves to next statement
run "notepad.exe" print "I do not wait for run program to complete"
So JB waits for Windows to do the job, as comment suggests
'give a couple of seconds for script to complete.
|
|
|
Post by Rod on Aug 20, 2021 14:59:21 GMT
Yep so JB runs the Windows Notepad.exe or indeed any other .exe as a new thread. So we are multi threaded at this point, though JB can only start a new thread. We have no idea if it completes, we just assume it will and code a delay.
The 0 to 4000000 type delay is really really bad, don’t code it. Code a timer delay or start looking for some other indication the other thread. Is complete.
|
|
|
Post by honky on Aug 21, 2021 7:00:46 GMT
Thanks for the explanation.
|
|
|
Post by xxgeek on Aug 30, 2021 18:21:21 GMT
As tsh73 states - When the run command is used the program continues without waiting for the program that was RUN to complete. A delay was needed to make sure the script completes before further program execution resumes.
Totally agree with Rod too, a for next loop isn't a good solution but hey, it works. Better solution would be to verify the new file existence before allowing code to proceed. (I got lazy, and didn't want to search around to figure out the "REAL" name of the file and path to it, at the time)
Why I need the input...... I only use Win 10,Pro and Linux/WINE 64 bit, with 32 bit support here. No way to know if things work in other operating systems. No way to check where Windows puts things in OS's that I don't have access to, so I rely on input from you guys.
Something I found out while testing... Win 10 Pro (using this program) is putting the new font file into c:\Users\xxgee\AppData\Local\Microsoft\Windows\Fonts and NOT in c:\Windows\Fonts as one would expect. I guess MS is keeping system fonts separate from user installed fonts. shrugs It did work for me on Win 10 Pro when I copied, and pasted the ttf into c:\Windows\Fonts(actually showed a window stating font is being installed) Strange, but true..
|
|