Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [Request] CreateFontFromMemblock

Author
Message
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 2nd Jan 2022 19:06
There is memblock commands to load images, sprites, objects and music from memblocks but there isnt a command to load a font from memblock.

Is there a way to do this without saving the memblock to a file so we can just load a font at runtime from a memblock?
-EdzUp
Patreon: https://www.patreon.com/EdzUp
Buy me a coffee:https://www.buymeacoffee.com/EdzUp
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 2nd Jan 2022 20:26
You can certainly do it with bitmap fonts but I presume you know that already
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 2nd Jan 2022 21:24
Yeah I was thinking about ttf fonts
-EdzUp
Patreon: https://www.patreon.com/EdzUp
Buy me a coffee:https://www.buymeacoffee.com/EdzUp
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 2nd Jan 2022 21:25 Edited at: 2nd Jan 2022 21:40
how are you getting it into a memblock without loading it (in some form) at some point?

in another thread, there was short discussion about loading a sound and playing it but if the sound was later deleted from the harddrive, you could no longer play the sound? so, i wondered if there HAS to be a file SOMEWHERE.

update: i was mistaken. this is the thread i was referencing.
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 4th Jan 2022 00:12
Completely thinking out loud here...

Has anyone worked with vector graphics directly in AppGameKit somehow? Wondering if you could take an image of a TTF font and get the vertices to represent a letter. Or can the data in a TTF file be mined for something like that.

...carry on...
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Jan 2022 00:23 Edited at: 4th Jan 2022 00:30
i've only seen vector graphics in tier 2.

meanwhile, i think the AGK2 font is embedded in the exe and somehow built at runtime (i could be wrong). regardless, i'm sure a ttf can be "built", saved and loaded back in (somehow).
jd_zoo
6
Years of Service
User Offline
Joined: 12th May 2018
Location: Nova Scotia
Posted: 4th Jan 2022 01:00
Interesting! SVG files are simple XML data so shouldn't be too big a deal to come up with something to convert very simple shapes.

BUT taking a look and a TTF file is not a simple data file to mine. There is a CreateMemblockFromFile() command to get the raw data, but my guess is you will be making a glorified image font with a home made vector algorithm.
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 4th Jan 2022 08:46 Edited at: 4th Jan 2022 08:48
What I do ATM is unencrypt a file to memblock ATM then save the memblock to file and load from that file, after that I delete the file.

What I was wondering was if there was a command to load the front from memblock directly?

I have commands to load sound (standard and ogg), images, sprites, objects and data from memblocks directly there just isn't a command for fonts
-EdzUp
Patreon: https://www.patreon.com/EdzUp
Buy me a coffee:https://www.buymeacoffee.com/EdzUp
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Jan 2022 03:18
This may be a little off topic, but with windows you can create a bitmap and from that freely create a png that can also be converted to a ttf totally with free legal software.
Converting the bmp into sections with memblocks the math can be achieved the main problem I foresee is converting that to a ttf and for my purposes placing it into the
correct directory. As a community with the current AppGameKit I believe its possible and this is certainly the place to ask. If I had a chance I'de look at the algorithm from memory
to a saved ttf format. It may require a few resaves and the use of one of the file handling tools I've seen on the forum
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 5th Jan 2022 12:52 Edited at: 5th Jan 2022 12:54
I have just started to get to grips with memblocks and all is good . So I covert a file to memblock then back to a sound and then play the sound . What I do not understand Is the point of doing this . Could somebody please explain the purpose of using a memblock?
Maybe I'm very thick .
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 5th Jan 2022 15:05
Once you have the data in its raw format you can manipulate it it in any way you want.
Encryption, change the pitch or speed of a sound, blend sounds together, blend images together, adjust brightness, contrast, colour. The world is your oyster.

Login to post a reply

Server time is: 2024-11-21 13:36:03
Your offset time is: 2024-11-21 13:36:03