Not really 'Fun' or 'Games', but...

A forum to share your demonstrations stacks, fun stacks, games, etc.
Post Reply
User avatar
tperry2x
Posts: 1538
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Not really 'Fun' or 'Games', but...

Post by tperry2x »

Not really 'Fun' or 'Games', but this does fall under "gaming related code" as per the topic description.
Many games have a custom font, and I've found today that this isn't supported under LCC/OXT in Linux.

So, here's an example stack that should work on all desktop platforms (loading a font via mobile is a different kettle-of-fish altogether).

I have some workarounds for Linux here, the script is all in the stack.
screenshot.png
screenshot.png (20.31 KiB) Viewed 280 times
custom font.zip
(22.06 KiB) Downloaded 19 times
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by OpenXTalkPaul »

tperry2x wrote: Mon Mar 11, 2024 11:58 am Not really 'Fun' or 'Games', but this does fall under "gaming related code" as per the topic description.
Many games have a custom font, and I've found today that this isn't supported under LCC/OXT in Linux.

So, here's an example stack that should work on all desktop platforms (loading a font via mobile is a different kettle-of-fish altogether).

I have some workarounds for Linux here, the script is all in the stack.
screenshot.png

custom font.zip
Thanks,
I haven't done anything with custom Fonts on Linux, but .otf support seems pretty essential to have in this decade. I'm not familiar with the specifics of this problem but hopefully we can come up with a fix for this that can be included directly in the IDE.

The LiveCode wiki has a note about 'start using font' on Linux:
create folder "~/.fonts"
revCopyFile "DroidSansMono.ttf", "~/.fonts/DroidSansMono.ttf"
put shell("fc-cache -fv") into temp
-- so installing font and updating the Font cache is this fix it seems?
fc-cache docs:
https://manpages.ubuntu.com/manpages/tr ... che.1.html

BTW, I have a macOS specific Extension library that gives a REAL list of fonts in the System. This includes invisible-file System UI (with names like '.SFSymbols.otf'... ) fonts that you don't normally see in the Font Menu (in ANY Apps), it's also really handy for extracting fonts from Adobe's Cloud cache.
User avatar
OpenXTalkPaul
Posts: 1574
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by OpenXTalkPaul »

I think we need another section, for non-Fun / non-Game shares / announcements.
I have various media oriented projects that are more things like music composition / music theory related than they are like games (of course music stuff is fun for me).
Workshop I guess could work for this subject too, that was kind of meant as a 'In Progress' area.
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by xAction »

put item 1 to -2 of the filename of this stack & "/" & tFont
Returns no useful string on windows
put char 2 to -2 of word 2 the long name of this stack into StackPath
set itemDel to "/"
put item 1 to -2 of tStackPath into StackDirectory
User avatar
tperry2x
Posts: 1538
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by tperry2x »

I'd guess it's clipping the C:/ drive letter off on windows?
Haven't got a Windows-box to test it on at the moment, but feel free to modify as a work in progress.
It would be good to be able to embed a TTF font within the stack, so we can then reference them directly:
can-we-add-fonts.png
can-we-add-fonts.png (63.48 KiB) Viewed 241 times
User avatar
richmond62
Posts: 2776
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by richmond62 »

This may sound a bit bonkers, but I have just setup Windows XP (bought licensed disk for 2 Euros from a chap in a computer shop who KNEW I was bonkers) in Virtual Box on MacOS 12 . . .

As have to run over my Devawriter code in Windows owing to 3 recent moans from folk in the south of the subcontinent who are running WXP.

Certainly a cheapo way to do things re Windows.

I had MacOS 10.6.8 running on Xubuntu a few years back.
https://richmondmathewson.owlstown.net/
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by xAction »

tperry2x wrote: Tue Mar 12, 2024 9:21 am It would be good to be able to embed a TTF font within the stack, so we can then reference them directly:
can-we-add-fonts.png
TTF fonts are actually a binary program
That's right, a little bit of running software.
No wonder my old co-workers got mad when I loaded all the fonts on those 4 megabytes of RAM computers.
tperry2x wrote: Tue Mar 12, 2024 9:21 am I'd guess it's clipping the C:/ drive letter off on windows?
Haven't got a Windows-box to test it on at the moment, but feel free to modify as a work in progress.
Maybe the itemDel is set to "\" or comma or something other than "/"?
this will cause
put item 1 to -2 of the fileName of this stack
to return empty on windows
if the platform is "Win32" then
put "/" into tDel
else
put "\" into tDel
end if
set itemDel to tDel
put item 1 to -2 of the fileName of this stack & tDel into tStackDirectory
User avatar
tperry2x
Posts: 1538
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by tperry2x »

Screenshot at 2024-03-13 12-45-33.png
Screenshot at 2024-03-13 12-45-33.png (14.5 KiB) Viewed 218 times
Hmmm, on a real windows machine - it just comes up with this above.
It can find the path and isn't clipping it (it returns the path properly in the fld above), so not sure what's wrong.

I wonder if it's something Windows doesn't like about that font. Even installing it manually into C:/Windows\Fonts\ doesn't make it appear in the IDE.
weird.png
weird.png (139.16 KiB) Viewed 217 times
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Not really 'Fun' or 'Games', but...

Post by xAction »

Try this:
start using font file (tFilePath) globally
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests