Multiple web fonts in text object?

Discussion and feedback on Construct 2

Post » Wed Feb 15, 2012 1:20 am

Hey, just quickly, I was wondering what would be the correct way to implement multiple web fonts in a single object.
Basically, I have a single text object and I want to dynamically set its font from a selection of four.
So how should I do it?
Does it only need one 'initialisation' of 'use web font', or shall I 'use web font' every time I set/change the font?

If it is the former, can I use the css for a whole collection that Google provides or do I have to do them individually.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Feb 15, 2012 5:02 am

You can do this:

+ On start of layout
-> Set web font A...
-> Set web font B...
-> Set web font C...
-> Set web font D...

This will leave it on font D, but it will download all four ready for use. Then just set web font during the running of the game between the four, and since they're already downloaded it should switch instantly.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Feb 15, 2012 11:08 am

OK, thanks.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Feb 15, 2012 2:23 pm

To use the font, "text:set font face".
You only need one "set webfont" action at the very beginning of the project.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Feb 15, 2012 8:45 pm

@Kyat.. oh, OK. That is different.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Feb 15, 2012 10:28 pm

I don't mean to hijack the thread but since it seems the question has been answered, I was wondering about the opposite case:

Using 1 web font across multiple text fields.

If I do 1 set webfont at the beginning of the project for textfield A, can I then use set font face on any text field with that webfont?
B
22
S
9
G
5
Posts: 122
Reputation: 5,386

Post » Mon Feb 20, 2012 10:50 pm

@Kyat
@wgfunstorm

Yeah, I was also wondering about that. Once I have a web font, can I use it across all text objects?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Feb 20, 2012 11:04 pm

[QUOTE=Kyatric] To use the font, "text:set font face".
You only need one "set webfont" action at the very beginning of the project.[/QUOTE]

As he said.

Text1: Set web font to "some web font"

Text2: Set Font face to Text1.FaceName
Text3: Set Font face to Text1.FaceName
...

ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Feb 20, 2012 11:18 pm

Indeed, setted fonts appear to be "global" to the text objects.
Nice trick/thinking @shinkan.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Mon Feb 20, 2012 11:29 pm

I just did what you wrote. @Kyatric we can share credits ;)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Colludium and 7 guests