Fonts on Ejecta

Discussion and feedback on Construct 2

Post » Wed Aug 06, 2014 12:34 pm

Is there a way to load a ttf or any other font file and use the font in an Ejecta built app or is spritefont the only option?
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Thu Aug 07, 2014 4:58 am

HI KFC,
I'm sorry for poor English, but i think that i found a dirty workaround for fonts+ejecta
As said Construct2's docs "The Text plugin's 'Set web font' action is not supported." but there is a way to set your font

I need to get this

Image

Instead this
Image
Image



Step by step.
1. Including your font to xcode project (gotham_pro_black in my case)
1.1 Put font file to Resources folder and add it to target in modal window - http://joxi.ru/HvbiU_3JTJDiB2Nnw50
1.2 Check that your font are included as Resources in your bundle - http://joxi.ru/rffiU4wyTJASQEVhdlc
1.3 Include your font in your application plist - open plist and add a new row called “Fonts provided by application” as array and add name of you font in list. like this - http://joxi.ru/ivjiU4wyTJDeXA-DgEU
1.4 Now you need to find PostScript name of the font. I used this script to find it in font check.
http://joxi.ru/C_riU4wyTJDMAjztq9I
Run the project and find PostScript name in debug window
http://joxi.ru/vvriU_3JTJA9CHzLsqM
In my case it is "GothamPro-Black"

script here:
for (id familyName in [UIFont familyNames]) {
NSLog(@"%@", familyName);
for (id fontName in [UIFont fontNamesForFamilyName:familyName]) NSLog(@" %@", fontName);
}
I beilive that there are more easy ways to find it =)
This script is useless at this point - so delete it.

2. Now we need to export the project for ejecta and replace name of the font.
2.1 Go to Win platform to you Construct project and export it for ejecta - http://joxi.ru/svziU4wyTJDEAslCONM
2.2 Open index.js (i use Notepad++) and replace font name that provided Construct on PostScript name from 1.4 like this - http://joxi.ru/svziU4wyTJDEAslCONM
In my case i set "Gotham Pro Black" font for all text objects in my capx for easy finding - http://joxi.ru/3v3iU_3JTJBkZMMLGhQ
Result - http://joxi.ru/Gv7iU4wyTJDQAhPbpmE

Upload export file to the dropbox.

3. Check the result. Go to Mac
3.1 Replace files in you App folder - http://joxi.ru/CgDjU_3JTJAzCN6G7NM
3.2 Run the project. Now text objects should be set to you font-face =)

Result:
Image
Image

One more thing. You can use a multiple fonts. Just add your fonts into Resource folder and add new rows to “Fonts provided by application” array in plist.
Once again sorry for bad English and i hope this will be usefull for you and C2 developers =)

Cheers
B
9
S
3
Posts: 9
Reputation: 1,168

Post » Fri Aug 08, 2014 7:55 pm

Thanks @mikeOstaff it worked like a charm.

Have you considered posting this as a tutorial so that others could easily find it?
Oh, and you can easily check the postscript name if you installed the font on your mac by checking the font info (cmd + i) in Font Book.
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Thu Sep 11, 2014 5:07 am

@mikeOstaff

Good documentation mate. You should put it as a tutorial.
I haven't used it yet, but will do in a bit and let you know if it worked for me.
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,662

Post » Thu Sep 11, 2014 3:58 pm

Worked :)

I had different fonts, so had some issues at first.
Some of the fonts are moving away a bit to left... which is not a problem, but it looks weird when font moves off from its holder at the scoreNote :D

As far as this tutorial goes, it works as written :)
If you have multiple fonts, ensure you find them all and replace them.
If you didn't set a font or force webfont in your game, then it's proabably Arial font that you need to replace.
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,662

Post » Thu Sep 11, 2014 4:59 pm

@mikeOstaff

what is your game? any links?
Looks interesting.
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,662

Post » Sun Sep 14, 2014 10:44 pm

@krish, @KFC sorry for the delaying. I'm glad that this workaround is work =)
I have no time to create tutorial or something bigger than post on forum topic, so i will be glad if you guys create this tutorial, because this info is useful for iOs developers.

krish wrote:@mikeOstaff

what is your game? any links?
Looks interesting.

It's our project - RunRabbitRun - hardcore platformer which eat all of our time =) . The game about rabbit which want to find his carrot. This game has been created under the impression of Super Meat Boy and Defrag(Quake3Arena mod).
You can find more info here - http://runrabbitrun.ru/
B
9
S
3
Posts: 9
Reputation: 1,168

Post » Wed Sep 17, 2014 3:51 pm

@mikeOstaff .. that looks pretty good mate.
I tried playing with keyboard and would love to play with controller :)
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,662


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests