NME: Fonts on iOS are not displayed

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

NME: Fonts on iOS are not displayed

alexbor
Hi.

The following code works perfectly on windows but on iPhone (and iPhone simulator too) text is not displayed. This error is shown when running the app: "Primitive not found : freetype_import_font__3". The latest NME SVN version is used, and iOS binaries are rebuilt. Arial font I use here is a standart windows 7 font.

Does anyone know how this problem can be solved?

Thanks, Alex.

-----haxe---------------------

package ;

import nme.Lib;
import nme.text.Font;
import nme.text.FontStyle;
import nme.text.TextField;
import nme.text.TextFormat;

class Main
{
        public static function main():Void
        {
                var font:Font = ApplicationMain.getAsset("assets/ARIAL.TTF");
               
                var format:TextFormat = new TextFormat(font.fontName, 15, 0x494949);
                        format.bold =  (font.fontStyle == FontStyle.BOLD ||
                                                        font.fontStyle == FontStyle.BOLD_ITALIC);
                        format.italic = (font.fontStyle == FontStyle.ITALIC ||
                                                         font.fontStyle == FontStyle.BOLD_ITALIC);
               
                var label:TextField = new TextField();
                        label.x = 10;
                        label.y = 10;
                        label.width = 300;
                        label.height = 40;
                        label.selectable = false;
                        label.text = "some testing text...";
                        label.setTextFormat(format);
               
                Lib.current.addChild(label);
        }
}

-----nmml--------------------------


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

        <app
                file="FontsTest"
                title="Fonts Test"
                package="ab.fontstest"
                version="1.0"
                company="ab"
                main="Main"
        />

        <window
                width="480"
                height="320"
                orientation="landscape"
                fps="60"
                background="0xcccccc"
                resizeable="true"
                hardware="true"
        />

        <assets>
               
               
        </assets>

        <set name="BUILD_DIR" value="bin/release" />
        <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
       
        <classpath name="src" />
       
        <haxelib name="nme" />

        <ndll name="nme" haxelib="nme" nekoapi="1"/>
        <ndll name="std" />
        <ndll name="zlib" />
        <ndll name="regexp" />

</project>

---------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: NME: Fonts on iOS are not displayed

alexbor
alexbor wrote
Hi.

The following code works perfectly on windows but on iPhone (and iPhone simulator too) text is not displayed. This error is shown when running the app: "Primitive not found : freetype_import_font__3". The latest NME SVN version is used, and iOS binaries are rebuilt. Arial font I use here is a standart windows 7 font.

Does anyone know how this problem can be solved?

Thanks, Alex.

-----haxe---------------------

package ;

import nme.Lib;
import nme.text.Font;
import nme.text.FontStyle;
import nme.text.TextField;
import nme.text.TextFormat;

class Main
{
        public static function main():Void
        {
                var font:Font = ApplicationMain.getAsset("assets/ARIAL.TTF");
               
                var format:TextFormat = new TextFormat(font.fontName, 15, 0x494949);
                        format.bold =  (font.fontStyle == FontStyle.BOLD ||
                                                        font.fontStyle == FontStyle.BOLD_ITALIC);
                        format.italic = (font.fontStyle == FontStyle.ITALIC ||
                                                         font.fontStyle == FontStyle.BOLD_ITALIC);
               
                var label:TextField = new TextField();
                        label.x = 10;
                        label.y = 10;
                        label.width = 300;
                        label.height = 40;
                        label.selectable = false;
                        label.text = "some testing text...";
                        label.setTextFormat(format);
               
                Lib.current.addChild(label);
        }
}

-----nmml--------------------------


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

        <app
                file="FontsTest"
                title="Fonts Test"
                package="ab.fontstest"
                version="1.0"
                company="ab"
                main="Main"
        />

        <window
                width="480"
                height="320"
                orientation="landscape"
                fps="60"
                background="0xcccccc"
                resizeable="true"
                hardware="true"
        />

        <assets>
               
               
        </assets>

        <set name="BUILD_DIR" value="bin/release" />
        <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
       
        <classpath name="src" />
       
        <haxelib name="nme" />

        <ndll name="nme" haxelib="nme" nekoapi="1"/>
        <ndll name="std" />
        <ndll name="zlib" />
        <ndll name="regexp" />

</project>

---------------------------------

Oops, I posted wrong nmml (font asset tag is missing). Here is correct version:

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

        <app
                file="FontsTest"
                title="Fonts Test"
                package="ab.fontstest"
                version="1.0"
                company="ab"
                main="Main"
        />

        <window
                width="480"
                height="320"
                orientation="landscape"
                fps="60"
                background="0xcccccc"
                resizeable="true"
                hardware="true"
        />

        <assets>
             
        </assets>

        <set name="BUILD_DIR" value="bin/release" />
        <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
       
        <classpath name="src" />
       
        <haxelib name="nme" />

        <ndll name="nme" haxelib="nme" nekoapi="1"/>
        <ndll name="std" />
        <ndll name="zlib" />
        <ndll name="regexp" />

</project>
Reply | Threaded
Open this post in threaded view
|

Re: NME: Fonts on iOS are not displayed

alexbor
alexbor wrote
alexbor wrote
Hi.

The following code works perfectly on windows but on iPhone (and iPhone simulator too) text is not displayed. This error is shown when running the app: "Primitive not found : freetype_import_font__3". The latest NME SVN version is used, and iOS binaries are rebuilt. Arial font I use here is a standart windows 7 font.

Does anyone know how this problem can be solved?

Thanks, Alex.

-----haxe---------------------

package ;

import nme.Lib;
import nme.text.Font;
import nme.text.FontStyle;
import nme.text.TextField;
import nme.text.TextFormat;

class Main
{
        public static function main():Void
        {
                var font:Font = ApplicationMain.getAsset("assets/ARIAL.TTF");
               
                var format:TextFormat = new TextFormat(font.fontName, 15, 0x494949);
                        format.bold =  (font.fontStyle == FontStyle.BOLD ||
                                                        font.fontStyle == FontStyle.BOLD_ITALIC);
                        format.italic = (font.fontStyle == FontStyle.ITALIC ||
                                                         font.fontStyle == FontStyle.BOLD_ITALIC);
               
                var label:TextField = new TextField();
                        label.x = 10;
                        label.y = 10;
                        label.width = 300;
                        label.height = 40;
                        label.selectable = false;
                        label.text = "some testing text...";
                        label.setTextFormat(format);
               
                Lib.current.addChild(label);
        }
}

-----nmml--------------------------


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

        <app
                file="FontsTest"
                title="Fonts Test"
                package="ab.fontstest"
                version="1.0"
                company="ab"
                main="Main"
        />

        <window
                width="480"
                height="320"
                orientation="landscape"
                fps="60"
                background="0xcccccc"
                resizeable="true"
                hardware="true"
        />

        <assets>
               
               
        </assets>

        <set name="BUILD_DIR" value="bin/release" />
        <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
       
        <classpath name="src" />
       
        <haxelib name="nme" />

        <ndll name="nme" haxelib="nme" nekoapi="1"/>
        <ndll name="std" />
        <ndll name="zlib" />
        <ndll name="regexp" />

</project>

---------------------------------

Oops, I posted wrong nmml (font asset tag is missing). Here is correct version:

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

        <app
                file="FontsTest"
                title="Fonts Test"
                package="ab.fontstest"
                version="1.0"
                company="ab"
                main="Main"
        />

        <window
                width="480"
                height="320"
                orientation="landscape"
                fps="60"
                background="0xcccccc"
                resizeable="true"
                hardware="true"
        />

        <assets>
             
        </assets>

        <set name="BUILD_DIR" value="bin/release" />
        <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
       
        <classpath name="src" />
       
        <haxelib name="nme" />

        <ndll name="nme" haxelib="nme" nekoapi="1"/>
        <ndll name="std" />
        <ndll name="zlib" />
        <ndll name="regexp" />

</project>
OMG, it seems that nabble filters out XML tags from my posts... So do not pay attention to  tag absence, it's just a nabble form validation bug.
Reply | Threaded
Open this post in threaded view
|

ScreenweaverHX on Mac

Philippe Riou
In reply to this post by alexbor
Hi,

Does anyone used it lately ? I get tons of CGContext errors with flash
10.3 and 11 though it works perfectly well with 10.2 and earlier.

Ideas?

Phil

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: ScreenweaverHX on Mac

Philippe Riou
Sorry I forgot to mention I'm running snow leopard.

Le 17/10/2011 10:17, Philippe Riou a écrit :
Hi,

Does anyone used it lately ? I get tons of CGContext errors with flash 10.3 and 11 though it works perfectly well with 10.2 and earlier.

Ideas?

Phil


--

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME: Fonts on iOS are not displayed

singmajesty
In reply to this post by alexbor
Does it work if you use NME 3.1 Beta, or recompile the NME binaries?

Whenever you receive a message, "Primitive not found," it usually means  
the binary for your target platform is out-of-date


On Mon, 17 Oct 2011 01:17:13 -0700, alexbor <[hidden email]> wrote:

>
> alexbor wrote:
>>
>>
>> alexbor wrote:
>>>
>>> Hi.
>>>
>>> The following code works perfectly on windows but on iPhone (and iPhone
>>> simulator too) text is not displayed. This error is shown when running
>>> the app: "Primitive not found : freetype_import_font__3". The latest  
>>> NME
>>> SVN version is used, and iOS binaries are rebuilt. Arial font I use  
>>> here
>>> is a standart windows 7 font.
>>>
>>> Does anyone know how this problem can be solved?
>>>
>>> Thanks, Alex.
>>>
>>> -----haxe---------------------
>>>
>>> package ;
>>>
>>> import nme.Lib;
>>> import nme.text.Font;
>>> import nme.text.FontStyle;
>>> import nme.text.TextField;
>>> import nme.text.TextFormat;
>>>
>>> class Main
>>> {
>>> public static function main():Void
>>> {
>>> var font:Font = ApplicationMain.getAsset("assets/ARIAL.TTF");
>>>
>>> var format:TextFormat = new TextFormat(font.fontName, 15, 0x494949);
>>> format.bold =  (font.fontStyle == FontStyle.BOLD ||
>>> font.fontStyle == FontStyle.BOLD_ITALIC);
>>> format.italic = (font.fontStyle == FontStyle.ITALIC ||
>>> font.fontStyle == FontStyle.BOLD_ITALIC);
>>>
>>> var label:TextField = new TextField();
>>> label.x = 10;
>>> label.y = 10;
>>> label.width = 300;
>>> label.height = 40;
>>> label.selectable = false;
>>> label.text = "some testing text...";
>>> label.setTextFormat(format);
>>>
>>> Lib.current.addChild(label);
>>> }
>>> }
>>>
>>> -----nmml--------------------------
>>>
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <project>
>>>
>>> <app
>>> file="FontsTest"
>>> title="Fonts Test"
>>> package="ab.fontstest"
>>> version="1.0"
>>> company="ab"
>>> main="Main"
>>> />
>>>
>>> <window
>>> width="480"
>>> height="320"
>>> orientation="landscape"
>>> fps="60"
>>> background="0xcccccc"
>>> resizeable="true"
>>> hardware="true"
>>> />
>>>
>>> <assets>
>>>
>>>
>>> </assets>
>>>
>>> <set name="BUILD_DIR" value="bin/release" />
>>> <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
>>>
>>> <classpath name="src" />
>>>
>>> <haxelib name="nme" />
>>>
>>> <ndll name="nme" haxelib="nme" nekoapi="1"/>
>>> <ndll name="std" />
>>> <ndll name="zlib" />
>>> <ndll name="regexp" />
>>>
>>> </project>
>>>
>>> ---------------------------------
>>>
>>
>>
>> Oops, I posted wrong nmml (font asset tag is missing). Here is correct
>> version:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <project>
>>
>>         <app
>>                 file="FontsTest"
>>                 title="Fonts Test"
>>                 package="ab.fontstest"
>>                 version="1.0"
>>                 company="ab"
>>                 main="Main"
>>         />
>>
>>         <window
>>                 width="480"
>>                 height="320"
>>                 orientation="landscape"
>>                 fps="60"
>>                 background="0xcccccc"
>>                 resizeable="true"
>>                 hardware="true"
>>         />
>>
>>         <assets>
>>
>>         </assets>
>>
>>         <set name="BUILD_DIR" value="bin/release" />
>>         <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
>>
>>         <classpath name="src" />
>>
>>         <haxelib name="nme" />
>>
>>         <ndll name="nme" haxelib="nme" nekoapi="1"/>
>>         <ndll name="std" />
>>         <ndll name="zlib" />
>>         <ndll name="regexp" />
>>
>> </project>
>>
>
> OMG, it seems that nabble filters out XML tags from my posts... So do not
> pay attention to  tag absence, it's just a nabble form validation bug.
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/NME-Fonts-on-iOS-are-not-displayed-tp6899365p6899658.html
> Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME: Fonts on iOS are not displayed

alexbor
singmajesty wrote
Does it work if you use NME 3.1 Beta, or recompile the NME binaries?

Whenever you receive a message, "Primitive not found," it usually means  
the binary for your target platform is out-of-date
The following was done with no results:
1. I downloaded NME sources from SVN;
2. rebuilt binaries on Mac OS X;
3. copied binaries back to Windows to generate XCode project (I develop on windows and use Mac only to compile for iPhone);
4. generated XCode project (lib folder contained new libnme.iphoneos.a and libnme.iphonesim.a);
5. ran it on iPhone and iPhone simulator.

To rebuild binaries I ran:
cd /users/[username]/desktop/libraries/nme/project
rm -r obj
haxelib run hxcpp Build.xml -Diphone -Diphoneos
rm -r obj
haxelib run hxcpp Build.xml -Diphone -Diphonesim

Development directory is set correctly. I tryed to clean and rebuild. Still the same error: "Primitive not found : freetype_import_font__3".
Reply | Threaded
Open this post in threaded view
|

Re: NME: Fonts on iOS are not displayed

alexbor
In reply to this post by singmajesty
singmajesty wrote
Does it work if you use NME 3.1 Beta, or recompile the NME binaries?

Whenever you receive a message, "Primitive not found," it usually means  
the binary for your target platform is out-of-date


On Mon, 17 Oct 2011 01:17:13 -0700, alexbor <[hidden email]> wrote:

>
> alexbor wrote:
>>
>>
>> alexbor wrote:
>>>
>>> Hi.
>>>
>>> The following code works perfectly on windows but on iPhone (and iPhone
>>> simulator too) text is not displayed. This error is shown when running
>>> the app: "Primitive not found : freetype_import_font__3". The latest  
>>> NME
>>> SVN version is used, and iOS binaries are rebuilt. Arial font I use  
>>> here
>>> is a standart windows 7 font.
>>>
>>> Does anyone know how this problem can be solved?
>>>
>>> Thanks, Alex.
>>>
>>> -----haxe---------------------
>>>
>>> package ;
>>>
>>> import nme.Lib;
>>> import nme.text.Font;
>>> import nme.text.FontStyle;
>>> import nme.text.TextField;
>>> import nme.text.TextFormat;
>>>
>>> class Main
>>> {
>>> public static function main():Void
>>> {
>>> var font:Font = ApplicationMain.getAsset("assets/ARIAL.TTF");
>>>
>>> var format:TextFormat = new TextFormat(font.fontName, 15, 0x494949);
>>> format.bold =  (font.fontStyle == FontStyle.BOLD ||
>>> font.fontStyle == FontStyle.BOLD_ITALIC);
>>> format.italic = (font.fontStyle == FontStyle.ITALIC ||
>>> font.fontStyle == FontStyle.BOLD_ITALIC);
>>>
>>> var label:TextField = new TextField();
>>> label.x = 10;
>>> label.y = 10;
>>> label.width = 300;
>>> label.height = 40;
>>> label.selectable = false;
>>> label.text = "some testing text...";
>>> label.setTextFormat(format);
>>>
>>> Lib.current.addChild(label);
>>> }
>>> }
>>>
>>> -----nmml--------------------------
>>>
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <project>
>>>
>>> <app
>>> file="FontsTest"
>>> title="Fonts Test"
>>> package="ab.fontstest"
>>> version="1.0"
>>> company="ab"
>>> main="Main"
>>> />
>>>
>>> <window
>>> width="480"
>>> height="320"
>>> orientation="landscape"
>>> fps="60"
>>> background="0xcccccc"
>>> resizeable="true"
>>> hardware="true"
>>> />
>>>
>>> <assets>
>>>
>>>
>>> </assets>
>>>
>>> <set name="BUILD_DIR" value="bin/release" />
>>> <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
>>>
>>> <classpath name="src" />
>>>
>>> <haxelib name="nme" />
>>>
>>> <ndll name="nme" haxelib="nme" nekoapi="1"/>
>>> <ndll name="std" />
>>> <ndll name="zlib" />
>>> <ndll name="regexp" />
>>>
>>> </project>
>>>
>>> ---------------------------------
>>>
>>
>>
>> Oops, I posted wrong nmml (font asset tag is missing). Here is correct
>> version:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <project>
>>
>>         <app
>>                 file="FontsTest"
>>                 title="Fonts Test"
>>                 package="ab.fontstest"
>>                 version="1.0"
>>                 company="ab"
>>                 main="Main"
>>         />
>>
>>         <window
>>                 width="480"
>>                 height="320"
>>                 orientation="landscape"
>>                 fps="60"
>>                 background="0xcccccc"
>>                 resizeable="true"
>>                 hardware="true"
>>         />
>>
>>         <assets>
>>
>>         </assets>
>>
>>         <set name="BUILD_DIR" value="bin/release" />
>>         <set name="BUILD_DIR" value="bin/xcode" if="target_iphone" />
>>
>>         <classpath name="src" />
>>
>>         <haxelib name="nme" />
>>
>>         <ndll name="nme" haxelib="nme" nekoapi="1"/>
>>         <ndll name="std" />
>>         <ndll name="zlib" />
>>         <ndll name="regexp" />
>>
>> </project>
>>
>
> OMG, it seems that nabble filters out XML tags from my posts... So do not
> pay attention to  tag absence, it's just a nabble form validation bug.
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/NME-Fonts-on-iOS-are-not-displayed-tp6899365p6899658.html
> Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org
If it looks like I haven't build NME binaries then could you please share yours? I'd like to test if it is really my mistake.
Reply | Threaded
Open this post in threaded view
|

Re: NME: Fonts on iOS are not displayed

alexbor
Could someone please share latest (compiled from the latest trunk sources) iphone nme binaries (libnme.iphoneos.a and libnme.iphonesim.a)?
Reply | Threaded
Open this post in threaded view
|

Re: ScreenweaverHX on Mac

Philippe Riou
In reply to this post by Philippe Riou
Up.

Neko load the data ok but flash can't create anything from them.

Le 17/10/2011 10:17, Philippe Riou a écrit :
> Hi,
>
> Does anyone used it lately ? I get tons of CGContext errors with flash
> 10.3 and 11 though it works perfectly well with 10.2 and earlier.
>
> Ideas?
>
> Phil
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME: Fonts on iOS are not displayed

Alex Liebert
In reply to this post by alexbor
This issue is not resolved for me either.

I rebuild from source with no errors but also get the primitive not found error for freetype.  Is there a missing dependency somewhere?

Nothing will render at all in my project anymore once i start using the latest nme - but the above is the only visible console error so ill start with that.

thanks,

alex


On Wed, Oct 19, 2011 at 10:24 PM, alexbor <[hidden email]> wrote:
Could someone please share latest (compiled from the latest trunk sources)
iphone nme binaries (libnme.iphoneos.a and libnme.iphonesim.a)?

--
View this message in context: http://haxe.1354130.n2.nabble.com/NME-Fonts-on-iOS-are-not-displayed-tp6899365p6911694.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org