Flex 嵌入“压缩”字体的字样

发布于 2024-08-27 10:32:47 字数 106 浏览 6 评论 0原文

我正在尝试嵌入一种字体的不同字体,并为每个字体都有一个 .otf。看起来 Flex 只支持“粗体”、“斜体”。但是,如果我想嵌入“粗体压缩”、“常规压缩”和“黑色”,该怎么办?我将如何实现这一目标?

I am trying to embed different typefaces of a font and have a .otf for each of them. It looks like Flex only supports 'bold','italic'. But what do I do if I want to embed 'bold-condensed', 'regular-condensed' and 'black'. How would I achieve that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滿滿的愛 2024-09-03 10:32:47

如果其他人绊倒了这个:
您需要使用 open-type 或 true-type (.otf 或 .ttf)导入字体并以不同的方式命名,

            [Embed(source='assets/fonts/Interstate-BoldCondensed.otf',
            fontName='interstateBoldCondensed',
            mimeType='application/x-font',
            advancedAntiAliasing='true'
            )]
        private var font1:Class;

        [Embed(source='assets/fonts/Interstate-Light.otf',
            fontName='interstateLight',
            mimeType='application/x-font',
            advancedAntiAliasing='true'
            )]
        private var font2:Class;

        [Embed(source='assets/fonts/Interstate-RegularCondensed.otf',
            fontName='interstateRegularCondensed',
            mimeType='application/x-font',
            advancedAntiAliasing='true'
            )]
        private var font3:Class;

然后您只需将它们视为不同的字体并通过“新”名称引用它们:例如'州际常规压缩'。

If someone else stumbles over this:
You need to import the font using open-type or true-type (.otf or .ttf) and give name it differently

            [Embed(source='assets/fonts/Interstate-BoldCondensed.otf',
            fontName='interstateBoldCondensed',
            mimeType='application/x-font',
            advancedAntiAliasing='true'
            )]
        private var font1:Class;

        [Embed(source='assets/fonts/Interstate-Light.otf',
            fontName='interstateLight',
            mimeType='application/x-font',
            advancedAntiAliasing='true'
            )]
        private var font2:Class;

        [Embed(source='assets/fonts/Interstate-RegularCondensed.otf',
            fontName='interstateRegularCondensed',
            mimeType='application/x-font',
            advancedAntiAliasing='true'
            )]
        private var font3:Class;

then you'll just treat them as if they were different fonts and reference them by their 'new' name: e.g. 'interstateRegularCondensed'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文