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

Spark labels won´t show embedded fonts on AIR 4.0

Explorer ,
Mar 09, 2014 Mar 09, 2014

Copy link to clipboard

Copied

Hello.

After noticing that AIR 3.9 was no longer accepted on the Apple Store (http://flashgamer.com/blog/comments/apple-is-not-currently-accepting-applications-built-with-air-3.9), I downloaded a new Apache Flex SDK (version 4.11 + AIR 4.0 + Flash Player 12.0). I then recompiled my mobile application, with no errors.

But both on the emulator and the device (iPhone 3GS), the spark labels I used in the whole application don´t load properlly the embedded fonts set on the CSS file. They always show the default font style. This is my code:

styles.css

@namespace s "library://ns.adobe.com/flex/spark";

@namespace local "*";

@font-face {

          src: url("assets/fonts/CustomFont.ttf");

          fontFamily: "CustomFontCFF";

          embedAsCFF: true;

}

@font-face {

          src: url("assets/fonts/CustomFont.ttf");

          fontFamily: "CustomFont";

          embedAsCFF: false;

}

.phrase

{

     color: #FF0000; /* red */

     fontFamily: "CustomFontCFF";

}

App.mxml (The label is in fact inside another view, but I think this is enough to get the concept)

<?xml version="1.0" encoding="utf-8"?>

<s:TabbedViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                            xmlns:s="library://ns.adobe.com/flex/spark">

          <fx:Style source="assets/css/styles.css" />

        <s:Label id="phraseLabel" width="100%"

                                             cacheAsBitmap="false"

                                             styleName="phrase" />

</s:TabbedViewNavigatorApplication>

Compilation arguments:

-locale en_US  -swf-version=23 -debug=false

I can say the stylesheet is being loaded because the spark label is red, as the CSS specifies. But the font won´t show, even if I set the non-CFF version (CustomFont instead of CustomFontCFF). So, now the app is ready for submitting to the Apple Store, but I´ve lost a basic visual feature on the app (styled labels with custom embedded fonts)...

Anyone else is having this weird issue?

TOPICS
Development

Views

1.6K

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

Explorer , Mar 10, 2014 Mar 10, 2014

Ok, the problem was on the SDK I downloaded.. In the Apache Flex installer there are some important checkboxes (I didn´t check all of them). The important here is to check the "Adobe Embedded Font Libraries and Utilities (Optional)"

Captura.PNG

Votes

Translate

Translate
Explorer ,
Mar 09, 2014 Mar 09, 2014

Copy link to clipboard

Copied

There´s a warning message when debugging the application:

warning: incompatible embedded font 'CustomFontCFF' specified for spark.components::Label (Label110) . This component requires that the embedded font be declared with embedAsCFF=true.

Which is strange, because that property is set to true on the CSS stylesheet.

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 ,
Mar 10, 2014 Mar 10, 2014

Copy link to clipboard

Copied

Ok, the problem was on the SDK I downloaded.. In the Apache Flex installer there are some important checkboxes (I didn´t check all of them). The important here is to check the "Adobe Embedded Font Libraries and Utilities (Optional)"

Captura.PNG

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
Guest
Apr 03, 2015 Apr 03, 2015

Copy link to clipboard

Copied

Thanks a lot for this fix! I spent more than a week trying to make it 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
New Here ,
Jul 22, 2018 Jul 22, 2018

Copy link to clipboard

Copied

LATEST

This is my issue for a couple of days. This post and fontswf utility, a great help indeed. Thanks.

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