|
|
Quellcode |
1 2 3 4 5 |
[Embed(source="MyriadWebPro.ttf", fontFamily="Myriad", fontWeight="normal", mimeType='application/x-font' )] and , as mentionned above : txt.embedFonts = true; // will enable the embeded fonts so it's able to set the font by CSS data. txt.antiAliasType = AntiAliasType.ADVANCED; // will set the antialiased type to Advanced, so the characters look smooth. // |
|
|
Quellcode |
1 |
css="color:#666666; font-family:Myriad; font-size:12; font-weight:normal; text-align:center; text-decoration:none; |
Zitat
in your source you have embedded only the 'bold' font but in your posted css you were trying to use the 'normal' font
Zitat
note - normal, bold, italic and bold-italic are different fonts!
i know, i know|
|
Quellcode |
1 |
css="color:#666666; font-family:Myriad; font-size:12; font-weight:normal; text-align:center; text-decoration:none;" |
right, sorry, the included textfield.as is not up-to-date, the last change from build 2012-03-16 which allows using the css without element assignment (p{...}) is not included there,
Zitat
there definetly something with the css line in .xml
|
|
Quellcode |
1 2 |
[Embed(source="DroidSans.ttf", fontFamily="droidsans", fontWeight="normal", mimeType='application/x-font', embedAsCFF="false" )] private var Droidfont:Class; [Embed(source="DroidSans-Bold.ttf", fontFamily="droidsans", fontWeight="bold", mimeType='application/x-font', embedAsCFF="false" )] private var Droidboldfont:Class; |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
/*
krpano font embedding
*/
package
{
import flash.display.Sprite;
import flash.text.Font;
[SWF(width="0", height="0", backgroundColor="#000000")]
public class embeddedfonts extends Sprite
{
// embed a font files
[Embed(source="VIVALDII.TTF", fontName="Vivaldi", fontWeight="normal", fontStyle="normal", unicodeRange="U+0020-U+00FF", mimeType="application/x-font", advancedAntiAliasing="true", embedAsCFF="false")] private var embeddedfont_VivaldiNormal : Class;
public function registerplugin(krpano:Object, pluginfullpath:String, plugin:Object):void
{
krpano.trace(1,"registering fonts...");
Font.registerFont(embeddedfont_VivaldiNormal);
}
}
}
|
|
|
Quellcode |
1 2 3 4 5 6 |
compile embeddedfonts.swf...
G:\ToDo\ArtEtThe\EmbeddedFont\embeddedfonts.as(19): Error: exception during transcoding: Unexpected exception encountered while reading font file '/G:/ToDo/ArtEtThe/EmbeddedFont/VIVALDII.TTF'
[Embed(source="VIVALDII.TTF", fontName="Vivaldi", fontWeight="normal", fontStyle="normal", unicodeRange="U+0020-U+00FF", mimeType="application/x-font", advancedAntiAliasing="true", embedAsCFF="false")] private var embeddedfont_VivaldiNormal : Class;
G:\ToDo\ArtEtThe\EmbeddedFont\embeddedfonts.as(19): col: 3: Error: unable to build font 'Vivaldi'
[Embed(source="VIVALDII.TTF", fontName="Vivaldi", fontWeight="normal", fontStyle="normal", unicodeRange="U+0020-U+00FF", mimeType="application/x-font", advancedAntiAliasing="true", embedAsCFF="false")] private var embeddedfont_VivaldiNormal : Class; ^
G:\ToDo\ArtEtThe\EmbeddedFont\embeddedfonts.as(19): col: 3: Error: Unable to transcode VIVALDII.TTF. ^
|
|
|
Quellcode |
1 2 3 4 5 |
G:\ToDo\ArtEtThe\EmbeddedFont\embeddedfonts.as(19): Error: exception during transcoding: No FontManager provided. Cannot build font.
[Embed(source="VIVALDII.TTF", fontName="Vivaldi", fontWeight="normal", fontStyle="normal", unicodeRange="U+0020-U+00FF", mimeType="application/x-font", advancedAntiAliasing="true", embedAsCFF="false")] private var embeddedfont_VivaldiNormal : Class;
G:\ToDo\ArtEtThe\EmbeddedFont\embeddedfonts.as(19): col: 3: Error: unable to build font 'Vivaldi'
[Embed(source="VIVALDII.TTF", fontName="Vivaldi", fontWeight="normal", fontStyle="normal", unicodeRange="U+0020-U+00FF", mimeType="application/x-font", advancedAntiAliasing="true", embedAsCFF="false")] private var embeddedfont_VivaldiNormal : Class; ^
G:\ToDo\ArtEtThe\EmbeddedFont\embeddedfonts.as(19): col: 3: Error: Unable to transcode VIVALDII.TTF. ^
|
|
|
Quellcode |
1 2 3 4 |
compile embeddedfonts.swf... G:\ToDo\ArtEtThe\EmbeddedFont\embeddedfonts.as: Avertissement: Cette unitÚ de compilation ne disposait pas d'entrÚe factory Class indiquÚe dans les mÚtadonnÚes Frame en vue de charger les bibliothÞques d'exÚcution partagÚes configurÚes. Pour compiler sans bibliothÞque d'exÚcution partagÚe, dÚfinissez l'option -static-link-runtime-shared-libraries sur vraie ou dÚsactivez l'option -runtime-shared-libraries. Appuyez sur une touche pour continuer... |
|
|
Quellcode |
1 2 3 4 |
<plugin url="%SWFPATH%/plugins/embeddedfonts.swf" preload="true" keep="true" devices="flash" /> <layer name="text" embeddedfonts="true" url="%SWFPATH%/plugins/textfield.swf" handcursor="false" children="false" align="lefttop" x="0" y="0" autoheight="true" background="false" html="data:page1" css="font-family:Vivaldi;" handcursor="true" onclick="if(hotspot[menuPage2].flying == 1.0, closeMenu());"/> |
|
|
Quellcode |
1 |
css="*{font-family: myFont; font-size:14px;} h1{font-size:22px;} a{color:#229922;text-decoration:underline;cursor:pointer;}"
|
|
|
Quellcode |
1 |
font-family: myFont; font-size: 14px; |
|
|
Quellcode |
1 |
<font face="xxx">blablabla</font> |