Text obj is a Headache

Discussion and feedback on Construct 2

Post » Thu Jan 28, 2016 12:06 am

with objection to this post also
Text get smaller after i build on cocoon io
Text move after build on intel xdk etc look on all the below test

construct 2 view Image
chrome Image
cocoon io build Image
Firefox Image
intel build Image

please fix this
Image
B
33
S
10
G
2
Posts: 305
Reputation: 3,550

Post » Thu Jan 28, 2016 12:27 am

I noticed this as well. I could line up text in my layouts, and then it could have different results depending on the browser I tested it with. I also noticed, horizontal and vertical alignment matters and can change where the text actually ends up greatly (expected vs. reality).
B
40
S
16
G
8
Posts: 476
Reputation: 8,120

Post » Thu Jan 28, 2016 2:47 pm

Every browser and platform implements slightly different font rendering engines, so it's expected that it will never look quite identical across platforms. If you need exact predictable font rendering, you have to use a sprite font.
Scirra Founder
B
383
S
225
G
86
Posts: 24,119
Reputation: 190,546

Post » Thu Jan 28, 2016 3:50 pm

Ashley wrote:Every browser and platform implements slightly different font rendering engines, so it's expected that it will never look quite identical across platforms. If you need exact predictable font rendering, you have to use a sprite font.

hi
how i use sprite font for persian language ?!?!?!?!
we cant make sprite font in persian look at this "hello" : "سلام"
the words are not seperate ! some of them are but not all ! :?: :cry:
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Thu Jan 28, 2016 10:25 pm

mahdi71 wrote:
Ashley wrote:Every browser and platform implements slightly different font rendering engines, so it's expected that it will never look quite identical across platforms. If you need exact predictable font rendering, you have to use a sprite font.

hi
how i use sprite font for persian language ?!?!?!?!
we cant make sprite font in persian look at this "hello" : "سلام"
the words are not seperate ! some of them are but not all ! :?: :cry:


That is a difficult situation! You probably wouldn't want to use sprite font in that case, but design your interface with rendering differences in mind, like giving your text some more padding and margins and using center align for positioning. As always, it is a little troublesome, but test your output on as many platforms as you can to find the best compromise.

For situations where pixel perfect rendering is absolutely necessary, I recommend using a graphics editor like Photoshop, Gimp, or Paint.net to render and export the words as images. It's not optimal and could take a lot of time though, so try to do so only as needed.
Mistakes were made.
B
47
S
23
G
107
Posts: 1,571
Reputation: 60,133

Post » Thu Jan 28, 2016 11:25 pm

to get it on a line i have to build game see it location on mobile @Ashley i would appreciated it if there was a guide to show where the text position going to move to after export from construct 2 to all the above platform.

just to make workflow a bit faster
Image
B
33
S
10
G
2
Posts: 305
Reputation: 3,550

Post » Fri Jan 29, 2016 12:23 pm

Yeah, spritefonts aren't great for some languages, and that makes it tricky... unfortunately there's no good way C2 could show you a preview of where the text is going to go - since it depends on hidden details of the browser/OS combination, there's not a good way to know until you run it. Cross-browser testing is always important and you should be doing that anyway, and this is another reason why it's important. As we've always said, the only good workaround is to make sure there is enough free space around text objects to ensure they can fit regardless of any small changes to size/alignment.
Scirra Founder
B
383
S
225
G
86
Posts: 24,119
Reputation: 190,546

Post » Wed Mar 30, 2016 7:11 am

Same problem,
does someone recently found a way to overcome the problem? Code? Plugin?
Is it possible to add via browser-plugin a javascript code to recognize the broeser and correct the offset?

Thank you.
B
54
S
26
G
6
Posts: 117
Reputation: 7,192

Post » Wed Mar 30, 2016 9:16 am

Image

Solution for manualy offseting the text for FireFox

Code: Select all
Browser.ExecJS("navigator.userAgent.toLowerCase().indexOf('firefox') > -1")

Returns 1 for firefox, 0 for everything else.

Posible to make more generic solution using Families with same font and make the anjastment acording to family.height

Still not perfect solution.
B
54
S
26
G
6
Posts: 117
Reputation: 7,192


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests