在Flash嵌入字体具有相同的字体名称属性 [英] Embedded fonts in flash with the same fontName property

查看:106
本文介绍了在Flash嵌入字体具有相同的字体名称属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是含有一些字体类的加载和注册的字体为我的Flash网站在运行外部SWF。 (在库面板中的Flash IDE然后在帧脚本中注册的出口)

I'm using an external swf containing a number of font classes to load and register the fonts for my flash site at runtime. (exported in the library panel Flash IDE then registered in the frame script)

在这种特殊情况下的SWF中包含了许多同一家庭不同的权重。例如。罗马字体,字体斜体字体轻,字体重,等...

In this particular case the swf contains a number of different weights of the same family. eg. font roman, font italic, font light, font heavy, etc...

中的字体出现注册很好,但是当我尝试使用一些字体这些字体的字体名称属性是相同的。三是显示为罗马和两个为指示灯,一个是轻脚...所以我去寻找一些愚蠢的编码错误,但让我失望的我没有发现任何。正确的字体对象被加载在正确的顺序。

The fonts appear to register fine, but when I try to use the fonts some of the fontName properties of these fonts are identical. Three are showing up as Roman and two as light and one is light sc... So I went searching for some silly coding errors, but to my dismay I didn't find any. The correct font objects were loading in the right order.

在相当多的测试,我检查了我的字体文件夹(Vista)的。当我打开文件重工在字体浏览器的标题显示了罗马;在字体浏览器的标题匹配的是我越来越闪光灯。此行为似乎是唯一的这个字体。

After quite a bit of testing I checked my fonts folder (vista). When I opened the file for Heavy the title in font viewer shows Roman; the titles in font viewer matched what I was getting in flash. This behaviour appears to be unique to this font.

由于的fontName是我知道如何字体分配到TextField我很为难,如何我可以用那个可爱的沉重字体为我的动态标题的唯一途径!

Since fontName is the only way i know how to assign a font to a TextField I'm stumped as to how I can use that lovely heavy font for my dynamic headings!

这是一个Type 1字体

It's a type 1 font

任何人都可以提出一个原因,解决方案或替代方法?

Can anyone suggest a cause, solution or a workaround?

推荐答案

谢谢你,我想你对这种权利。

Thanks, i think your right about that.

但是我没有发现嵌入的字体和设置名称的一种方式。

I did however find a way of embedding the font and setting the name.

首先我用CrossFont的类型1 PostScript字体转换为.otf的

First of all I used CrossFont to convert the Type 1 postscript font to an .otf

使用[嵌入()功能现在在CS4中可用,我能够使用fontFamily中归因于嵌入字体的字体名称属性设置。

Using the [embed()] feature now available in cs4, I was able to use the fontFamily attribute to set the fontName property of the embedded font.

在code下面你可以看到我设置的名称为BlaaDeeBlaa和则TextFormat会接受它,并显示该嵌入字体。

In the code below you can see I set the name to "BlaaDeeBlaa" and the TextFormat will accept it and display the embedded font.

[Embed(source="assets/FontFileName.otf",
                            fontFamily="BlaaDeeBlaa",
                            mimeType="application/x-font")]
var BlaaDeeBlaa:Class;

var CH:Font = new BlaaDeeBlaa();

var testTxt:TextField =  new TextField();
testTxt.defaultTextFormat = new TextFormat("BlaaDeeBlaa",28,0x000000,true);
testTxt.embedFonts = true;
testTxt.text = Font.enumerateFonts(false)[0].fontName;
testTxt.autoSize = "left";
addChild(testTxt);

n.b。只有OpenType字体(.otf)的和TrueType(.TTF),可以使用此方法嵌入

n.b. Only OpenType(.OTF) and Truetype (.TTF) can be embedded using this method

我放到这个技术由李Brimelows教程在gotoandlearn

这篇关于在Flash嵌入字体具有相同的字体名称属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆