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 / Kerning Image FOnts?

Author
Message
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 21st Jan 2018 12:56
Hi,

I want to be able to kern image based font. Anyone know if this is possible (Tier 1)?

I can find the command SetTextSpacing( iTextIndex, fSpacing ).... which allows a whole string to be spaced differently but I need it on a per character basis - and preferably set once and forgotten - ie kerning!

Ideally there would be a SetCharSpacing command where you could enter the ASCII and set its individual spacing pre and post. Without it situations like AV and up looking like A V!!
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 21st Jan 2018 14:25 Edited at: 21st Jan 2018 14:26
i believe u can use a subimages.txt file beside your font image. and i remember SetTextSpacing alow also negativ spacing.
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)

Attachments

Login to view attachments
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 21st Jan 2018 15:11
There's nothing built in to do it
I think you'll have to create a lookup table of letter combinations with custom spacing offsets, then render each character as a sprite.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 21st Jan 2018 15:28
As CJB said for the manual lookup but I wouldn't render each character as a sprite, I'd use SetTextCharX()
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 22nd Jan 2018 16:08
Ugh!
Thanks for the help.
Like the subimages text file, another associated file that helps with kerning would be good - it could use a few pre-determined shapes to define how the kerning would need to behave- you'd only need about 10 broad shapes that would cover all letters (Eg A, V, T, L etc) - it would make a huge difference to image based fonts....

Paul?
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Jan 2018 17:24
i read that need a kerning pairs table from min 60 to max ~ 80000 datas.
if you just need text a workaround is drawsprite where you set the image each char. text is often in front of all and can draw in backbuffer after call to Render().
AGK (Steam) V2017.12.12 : Windows 10 Pro 64 Bit : AMD (17.12.1) Radeon R7 265 : Mac mini OS High Sierra (10.13)
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 22nd Jan 2018 19:13
OK, thanks. Let's see how it looks and then I can figure if I should spend the time on it....
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2024-11-24 03:37:08
Your offset time is: 2024-11-24 03:37:08