• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Font embed AIR 24 / 25 [HELP]

Engaged ,
Jul 15, 2017 Jul 15, 2017

Copy link to clipboard

Copied

Does anyone know how to get this to work?  The example I found says to do it like this in your app-xml

?xml version="1.0" encoding="utf-8" standalone="no"?>

<application xmlns="http://ns.adobe.com/air/application/24.0">

     <embedFonts>

             <font>

                  <fontName>Life is goofy</fontName>

                  <fontPath>life_is_goofy.ttf</fontPath>

             </font>

     </embedFonts>

</application>

I try this and I get an error.  I'm using a Mac.   Trying to build an Android app with the embedded font. Any help appreciated here.

TOPICS
Development

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Jul 16, 2017 Jul 16, 2017

I remember I got that error until I put the font in my "src root" folder.

You may also try putting the full path eg:

<fontPath>/Path/on_your/machine/life_is_goofy.ttf</fontPath>

As reference - I am using AIR25 and this compiles fine for me on Android and iOS with the setup here:

WebViewANE/WebViewANESample-app.xml at master · tuarua/WebViewANE · GitHub

Votes

Translate

Translate
LEGEND ,
Jul 15, 2017 Jul 15, 2017

Copy link to clipboard

Copied

Is life_is_goofy.tt online?

Is this HTML5 Canvas? That could affect what fonts could work.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 15, 2017 Jul 15, 2017

Copy link to clipboard

Copied

Thats not the font I'm using .. thats just an example..

This is for an AIR - Android / iOS app.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 15, 2017 Jul 15, 2017

Copy link to clipboard

Copied

Font i'm trying to use is Omnes-Bold

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 15, 2017 Jul 15, 2017

Copy link to clipboard

Copied

Everything works fine in iOS.. I just noticed when kicking off an Android build that my input field fonts werent rendering.

I saw that you can embed fonts in AIR 24 and up thats supposed to work for android

The actual error I get is

An attribute or element contains an invalid value in the application descriptor file.

error 105: application.embedFonts.font.fontPath contains an invalid value

application.embedFonts.font.fontPath

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 15, 2017 Jul 15, 2017

Copy link to clipboard

Copied

Weird.. I can't find anything on the web about this.

This is driving me nuts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 16, 2017 Jul 16, 2017

Copy link to clipboard

Copied

I remember I got that error until I put the font in my "src root" folder.

You may also try putting the full path eg:

<fontPath>/Path/on_your/machine/life_is_goofy.ttf</fontPath>

As reference - I am using AIR25 and this compiles fine for me on Android and iOS with the setup here:

WebViewANE/WebViewANESample-app.xml at master · tuarua/WebViewANE · GitHub

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 16, 2017 Jul 16, 2017

Copy link to clipboard

Copied

FWIW, I'm also having a problem with fonts on Android. The Chinese characters which displayed fine in previous AIR versions, and which work fine on iOS, simply don't display. But I get no build error, so this may be a completely different issue...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 20, 2017 Dec 20, 2017

Copy link to clipboard

Copied

Hi Douglas! We you able to show chinese fonts in the end?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 16, 2017 Jul 16, 2017

Copy link to clipboard

Copied

Which compilers are you using ?

ASC2 from the AIR SDK ?
or
ASC (eg. v1) from an AIR SDK merged with a Flex SDK?

AND


Where do you try to use the embedded font ?

Are you using those embedFonts settings to use in a StageText or something else?

see here

Custom fonts support for StageText on iOS and Android

eg.

Beginning with AIR 24, we have introduced support for Custom fonts on StageText for iOS and Android. Earlier, StageText was created with specific system fonts. With the introduction of this feature, the AS developers now have more flexibility in using fonts apart from the ones present in system. The developers can use ttf and otf font files.


also

  • For packaging the .apk file using Flash Builder, the developer needs to provide absolute fontPath.
  • With Java 1.6 on Windows, otf files are not rendered for IPAs.

that's about it, if you use this setting to embed font to display somewhere else than in StageText, not really gonna work

from Flash Builder you gonna need absolute path, from the command-line you may be able to use relative path

Alternatively, depending on your compiler (ASC1 or ASC2) you could try what's described here
Adobe Flex 4.6 Embed Fonts

If you use the AIR SDK by itself (without merging with the Flex SDK)
in ASC2 font transcoding has been removed and fonts should be pre-transcoded
with the command-line tool fontswf

Assuming (I did not test this specific case with StageText) that AIR 24 <embedFonts>
work the same way as previously font embedding, with ASC2 you should be able fontswf
to compile your font to a SWF file, and the -a param should be the equivalent of <fontName>,

eg. you could embed the SWF, not use the setting  <embedFonts> and still be able to use the

font name as the fontFamily property for a StageText.

I would say it's worth a try and few tests to just avoid the absolute path in your app xml.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 16, 2017 Jul 16, 2017

Copy link to clipboard

Copied

I'm using Animate CC.

I just got it to work!

I had to use full path like this   -  /Users/username/Desktop/FolderNam/FolderWithAppNam

Now the only pain in the ass is that the Y coords on Android are different than iOS ... so will have to work around that... but at least the font renders now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 15, 2018 Jan 15, 2018

Copy link to clipboard

Copied

LATEST

> Hi Douglas! We you able to show chinese fonts in the end?

Sorry, I haven't had time to look into this. This project is on the back burner for now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines