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 / I think i found the bug with html 5 and truetype fonts?????

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 12th Oct 2018 11:39 Edited at: 12th Oct 2018 11:41
Any loaded truetype or open trutype font gets displayed t the same size Always in html 5.
only the original built in font works or bitmap font...

But i belive the error is here somewhere in agks code ..


This is how agk does it with ttf and otf fonts....




SetTextFont
Description
Sets the TrueType font to use for this text object. The font must have been loaded with LoadFont from a TrueType font file. This is different from the old bitmap fonts in that it supports unicode characters and the characters will usually appear sharper on screen at all sizes.
[b]Note that resizing a text object that is using a TrueType font will redraw all the characters from the font file onto an image for drawing, for large text sizes using hundreds of different unicode characters this could be a slow process but in normal use it is usually not noticeable.
Recently used sizes are kept for a short period of time so if you are frequently switching between two or three text sizes then no redrawing will need
[/b]to be done and it will be faster.
Use a font ID of 0 to use the built in TrueType font that supports a wide range of unicode characters.


Are i completely out in the woods here or could someone at tgc confitm this????


Wath i can see so does loaded font use a unified size straightforward and dont rezise?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Oct 2018 14:21
The code that HTML5 uses is exactly the same as the other platforms, so I'm not sure why it would be behaving differently. Do you have an example I can try to reproduce the problem?
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 13th Oct 2018 09:57
emailed the source to your email on your forum profile.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Oct 2018 14:49
Thanks, I spent the better part of a day trying to track this down but unfortunately I can't find the source. It looks like it is somewhere in the FreeType library that we are using to parse the font file, something about it being used on HTML5 is causing it to fail for this particular font. Is there any chance you could try converting your font to a TTF file, or rebuilding it in some way?
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Oct 2018 16:32
I have actually tryed other fonts and converted this one but get the same error ?
I wonder if its something with how these free fonts are being edited that is the problem ?
wath tools the authors use?
I might have managed to download fonts that is created with the same tools???
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Oct 2018 17:02 Edited at: 17th Oct 2018 17:03
Huuuummmm i Think i know wath it is now…
the fonts that do not work do miss the open font layout?
Something when displayed in html5 uses this in freetype fonts?

Wath do you Think??


Convertors do not apply this layout and thats why these fonts is displayed wrong in html 5...

i dont have a font editor to test to add this ?

Attachments

Login to view attachments
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 17th Oct 2018 17:22
Unfortunately I don't know the inner workings of FreeType, so it's possible the missing OpenType is the cause, but I can't say for sure.

Login to post a reply

Server time is: 2024-03-29 07:36:28
Your offset time is: 2024-03-29 07:36:28