Page 1 of 1

Using Cufon Font

Posted: 18 Feb 2010, 14:58
by sm00th
I am wanting to use Gill Sans font on the website,Specially on the navigation.

I would have to import cufon javascritp for this to work. Is this possible in Imagevue?

Where would I place my coding for this to work?

Thank you again?

Posted: 19 Feb 2010, 03:38
by mjau-mjau
Since this is flash and not html, you would need to embed the font in the flash(FLA) itself ... That would require editing the FLA source file, and I am not sure I can recommend it - Read more:
viewtopic.php?t=4233

You could use a font-family and set Gill Sans in the CSS, but it would only display for computers that have Gill Sans installed of course ... Elsewise, it will choose the "next" font ...

Sorry that there is no easy way for this ...

Posted: 16 Mar 2010, 21:37
by sm00th
Thank you for your reply,

I have now sent you a private message about this.

Posted: 17 Mar 2010, 03:42
by mjau-mjau
Basically, this is not a simple procedure, because everything is coded with actionscript, and there is a big difference in using embedded fonts and standard device fonts. Let me try to guide you:

1. First of all, open the imagevue2.fla. You can disregard any messages about "missing fonts".
2. Embed your font - Go to library palette, and click the down-arrow in the top right corner and select "New Font". Give it any NAME, select the FONT you intend to embed, select the STYLE(if any). Deselect and disregard any of the faux, bitmap and size settings. Finally, check "Export for actionscript" and make sure you also have "Export in Frame 1" checked ... Click "Ok"
3. Add font in code - Now you need to tell actionscript that this font is embedded if it is going to be used. In the timeline, click frame 3 in the layer "mainmenu". Open the "Actions" panel to view the actionscript - Locate line 618:
Code
myembededfonts = new Array("standard 07_53", "standard 07_63", "DesertDogHmk");
Add the exact name of your font to the array ...
Code
myembededfonts = new Array("standard 07_53", "standard 07_63", "DesertDogHmk", "your_font");
4. Finally, you need to remember to add your font to your theme CSS stylesheet.

As you may understand, this is a bit tricky ... Also, remember you can not use bold or italic styling for your font, unless you embed the font separately with these styles checked (step 3).

Posted: 17 Mar 2010, 16:05
by sm00th
That sounds sweet,

Hit me up with the FLA when you are ready.

Thank you for providing the answer.

Problem with custom font

Posted: 02 Sep 2010, 11:52
by poka
One comment: A helpful addition to your guide might be that the SWFAddress* files must be in the same folder as the imagevue2.fla. Otherwise a compiler warning occurs.

Following the tutorial above I embedded "Gorri Sans" under the name "gorri". I then tried to use it as a .filemod_title for Photoblinds with the following CSS:
Code
.filemod_title {
/* Sets styles for the filemod title, i.e. photoblinds effect */ 
	font-size: 12px;
	color: #C0C0C0;
	font-family: gorri, "Trebuchet MS", Arial;
	font-style: normal; 
}
Unfortunately, one of the alternative typefaces was displayed instead of gorri.

After some research I stumbled upon Karl's comment concerning "embedFonts = true" and added a respective entry in line 60 of filemodule Frame 3:
Code
		var t = this.mytitle.createTextField("mytf",1,0,0,100,50);
		t.embedFonts = true;
		t.styleSheet = myCSS;
It seems as if this addition is at least doing something: The text to be displayed is now missing completely.

Please help. A working CSS and/or code-snippet for DesertDogHmk* should be sufficient.

* or any other already-embedded font

Re: Problem with custom font

Posted: 03 Sep 2010, 05:12
by mjau-mjau
As explained in here, there is a reason why we don't support or recommend editing the FLA source file. Even trying to add your own font is not easy. WHY? Because its a tricky procedure all the way through ...

If you embedded the font correctly and added it to the ARRAY, you shouldn't need to amend any more code, because the reason it is in the array is because it then automatically add EMBEDFONTS = TRUE to these items. However, there are many reason why this may not be working:

1. I think you should still be referring to the font in the CSS by its ORIGINAL name, and not the name you gave the font LIBRARY item. I would recommend giving the SAME name to the library item as the font name ... including CaSe.

2. It will not work everywhere. Why? Why because you can't mix embedded fonts with non-embedded fonts in the same textfield. A Textpage uses a single textpage, so if you ARE going to use an embedded font, you need to apply it to the entire TEXTPAGE not just the textpage_title. This is just how flash works, and you cant have embedded fonts and non-embedded fonts in a textfield because its either on or off:
Code
textfield.embedFonts = true/false


Code
.filemod_title {
/* Sets styles for the filemod title, i.e. photoblinds effect */ 
	font-size: 12px;
	color: #C0C0C0;
	font-family: gorri, "Trebuchet MS", Arial;
	font-style: normal; 
}
Unfortunately, one of the alternative typefaces was displayed instead of gorri.

After some research I stumbled upon Karl's comment concerning "embedFonts = true" and added a respective entry in line 60 of filemodule Frame 3:
poka wrote:It seems as if this addition is at least doing something: The text to be displayed is now missing completely.
I don't see how this is progress. If the text is displaying, at least its just because it cant find the font ... or because you have mixed embedded/non-embedded fonts ... If entire field is blank, it just means you are trying to force embed on a textfield that contains non-embedded font also (Even though your CSS reference to "gorri" still may not be correct).
poka wrote:Please help. A working CSS and/or code-snippet for DesertDogHmk* should be sufficient.
Why not check out the GARDENER theme? This theme is using an embedded font "standard 07_53". This is visible in the CSS, and you will find that we had to repeat the font for all styles where we wanted to use it (unlike for normal non-embedded fonts, which will simply inherit from the parent .body class). Also, as you can see, this font is simply added to the embedded fonts array, and of course, the font is embedded into the FLA ...

Re: Problem with custom font

Posted: 11 Sep 2010, 09:40
by poka
Thanks, I finally did succeed in embedding a font.

For reference:
- Now I did address the font by its original name as you recommended.
- Your hint to "apply it to the entire TEXTPAGE" was the deciding breakthrough. I had originally only applied the font settings to .filemod_title and not .filemod - being unaware of this flash specialty.
- Except for adding the font to the array (see above), no changes to the flash source are necessary indeed.

Re: Using Cufon Font

Posted: 27 Dec 2010, 12:15
by ojojoo7
hi, I try to add another font too.
So I really need to go into FLA ?
Or what can I do ?

Re: Using Cufon Font

Posted: 27 Dec 2010, 12:41
by mjau-mjau
You can add fonts available just like in HTML. You can not add custom embedded fonts though ...

Re: Using Cufon Font

Posted: 27 Dec 2010, 13:07
by ojojoo7
thanks for your answer
But I want use a funny font for the "menu" only.
Of course I try with the style sheet : @font-face.

I know, i can't use @font-face beteween flash and css.
or can I send you the .ttf and you could add into the .fla

Please is very important for me.

Thanks for help !