fonts don't render in nme on iphone version <4?

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

fonts don't render in nme on iphone version <4?

Alex Liebert
Hello,


It's the only issue that makes nme not work on an iOS v3.2 device that i can't figure out.  They just plain don't show up...

Alex

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

Re: fonts don't render in nme on iphone version <4?

Gamehaxe
Hi,
If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh

> Hello,
>
> Any ideas on this bug:  
> http://code.google.com/p/nekonme/issues/detail?id=112
>
> It's the only issue that makes nme not work on an iOS v3.2 device that i
> can't figure out.  They just plain don't show up...
>
> Alex

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

Re: fonts don't render in nme on iphone version <4?

Alex Liebert
Thanks Hugh, will try- so I need to try to render a textfield who's contents is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the size measurements of fields, after changing that one property) but nothing actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]> wrote:
Hi,
If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


Hello,

Any ideas on this bug: http://code.google.com/p/nekonme/issues/detail?id=112

It's the only issue that makes nme not work on an iOS v3.2 device that i
can't figure out.  They just plain don't show up...

Alex

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


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

Re: fonts don't render in nme on iphone version <4?

Gamehaxe
No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

> Thanks Hugh, will try- so I need to try to render a textfield who's  
> contents
> is either 'xxxx' or '....' ?
>
> I tried printf debugs before and everything seemed right (including the  
> size
> measurements of fields, after changing that one property) but nothing
> actually appeared on screen.
>
> Alex
>
>
> On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]> wrote:
>
>> Hi,
>> If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
>> see if it is rendering all '.' or whether '.' and 'X' are rendered.
>> If it is all '.' then perhaps there is a rendering offset that needs
>> to be taken into account.
>> If nothing is printed then the font creation may have failed.
>> If it looks good, then the problem is downstream.
>>
>> Hugh
>>
>>
>>  Hello,
>>>
>>> Any ideas on this bug: http://code.google.com/p/**
>>> nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>>>
>>> It's the only issue that makes nme not work on an iOS v3.2 device that  
>>> i
>>> can't figure out.  They just plain don't show up...
>>>
>>> Alex
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org

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

Re: fonts don't render in nme on iphone version <4?

Alex Liebert
Hey Hugh,

I ran with debug on device and those lines uncommented.  When running on 3.1.3 I get all dots.  If you point me in the right direction to debug/test a fix I'll get to it and report back (since 3.1.3 won't run in simulator i guess)

Included below is the output, plus a small change I made to handle an api change for line height thats different prior to 3.2.  Maybe I broke it that way somehow with the leading?  from what i read they simply replaced 'leading' with 'lineheight' in the api)

Thanks!

Alex

--

if([mFont respondsToSelector: NSSelectorFromString(@"lineHeight")])

         {

mMetrics.height = (int)[ mFont lineHeight ];

}

else {

mMetrics.height = (int) [mFont leading ];

}


         printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,  mMetrics.descent ,  mMetrics.height );

--



mFont metrics 11.000000/2.000000/15.000000

Loaded native font : 0x72ee70

...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont metrics 15.000000/3.000000/20.000000

Loaded native font : 0x73a2f0

............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont metrics 22.000000/5.000000/29.000000

Loaded native font : 0x73b210

..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont metrics 33.000000/8.000000/43.000000

Loaded native font : 0x73c350

.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................


On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:
No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

Thanks Hugh, will try- so I need to try to render a textfield who's contents
is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the size
measurements of fields, after changing that one property) but nothing
actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]> wrote:

Hi,
If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


 Hello,

Any ideas on this bug: http://code.google.com/p/**
nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>


It's the only issue that makes nme not work on an iOS v3.2 device that i
can't figure out.  They just plain don't show up...

Alex


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

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


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

Re: fonts don't render in nme on iphone version <4?

Gamehaxe
Hi,
If you are getting all "." then I think the glyph is probably rendering in
the wrong spot (too high or too low).  Probably 1 char height off.

I also notice some changes in  
http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682
messing with the sign (+/-) of the descender.

You may also need to do something like leading-ascender.

Try changing the origin used by [str drawAtPoint:textOrigin  
withFont:mFont];

to something like:
CGPoint textOrigin = CGPointMake(0,15);
or
CGPoint textOrigin = CGPointMake(0,-15);

Also, it would be interesting to see what the size is:
CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);

Another thing to try is a multi-lined text box - there may be an  
origin/renderer clipping problem.

Hugh


> Hey Hugh,
>
> I ran with debug on device and those lines uncommented.  When running on
> 3.1.3 I get all dots.  If you point me in the right direction to  
> debug/test
> a fix I'll get to it and report back (since 3.1.3 won't run in simulator  
> i
> guess)
>
> Included below is the output, plus a small change I made to handle an api
> change for line height thats different prior to 3.2.  Maybe I broke it  
> that
> way somehow with the leading?  from what i read they simply replaced
> 'leading' with 'lineheight' in the api)
>
> Thanks!
>
> Alex
>
> --
>
>  if([mFont respondsToSelector: NSSelectorFromString(@"lineHeight")])
>
>          {
>
>  mMetrics.height = (int)[ mFont lineHeight ];
>
>  }
>
>  else {
>
>  mMetrics.height = (int) [mFont leading ];
>
>  }
>
>
>          printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
> mMetrics.descent ,  mMetrics.height );
>
> --
>
>
> *mFont metrics 11.000000/2.000000/15.000000*
>
> *Loaded native font : 0x72ee70*
>
> *...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
> metrics 15.000000/3.000000/20.000000*
>
> *Loaded native font : 0x73a2f0*
>
> *............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
> metrics 22.000000/5.000000/29.000000*
>
> *Loaded native font : 0x73b210*
>
> *...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
> .......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
> metrics 33.000000/8.000000/43.000000*
>
> *Loaded native font : 0x73c350*
>
> *
> ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
> ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
> ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
> ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
> .........................................................................................................................................................................................
> *
>
> On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:
>
>> No, the glyphs should be printed out, like:
>>
>>
>> ...XXXX...
>> ..XX...XX.
>> ..XX...XX.
>> ..XXXXXXX.
>> ..XX...XX
>> ..XX...XX.
>>
>> Hugh
>>
>>  Thanks Hugh, will try- so I need to try to render a textfield who's
>>> contents
>>> is either 'xxxx' or '....' ?
>>>
>>> I tried printf debugs before and everything seemed right (including the
>>> size
>>> measurements of fields, after changing that one property) but nothing
>>> actually appeared on screen.
>>>
>>> Alex
>>>
>>>
>>> On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]>  
>>> wrote:
>>>
>>>  Hi,
>>>> If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
>>>> see if it is rendering all '.' or whether '.' and 'X' are rendered.
>>>> If it is all '.' then perhaps there is a rendering offset that needs
>>>> to be taken into account.
>>>> If nothing is printed then the font creation may have failed.
>>>> If it looks good, then the problem is downstream.
>>>>
>>>> Hugh
>>>>
>>>>
>>>>  Hello,
>>>>
>>>>>
>>>>> Any ideas on this bug: http://code.google.com/p/**
>>>>> nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**
>>>>> nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>>>>> >
>>>>>
>>>>>
>>>>> It's the only issue that makes nme not work on an iOS v3.2 device  
>>>>> that i
>>>>> can't figure out.  They just plain don't show up...
>>>>>
>>>>> Alex
>>>>>
>>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org

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

Re: fonts don't render in nme on iphone version <4?

Alex Liebert
Thanks Hugh.

I tried a y offset of 15 and -15 but saw no change.

here's some printout on the 02 text sample for that CGSize:

mFont metrics 11.000000/2.000000/15.000000

Loaded native font : 0x72ee70

Drawing at size 9x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 4x15...

mFont metrics 15.000000/3.000000/20.000000

Loaded native font : 0x73a2f0

Drawing at size 12x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 5x20...

mFont metrics 22.000000/5.000000/29.000000

Loaded native font : 0x73b210

Drawing at size 18x29...

Drawing at size 14x29...

Drawing at size 6x29...

Drawing at size 14x29...

Drawing at size 7x29...

Drawing at size 7x29...

mFont metrics 33.000000/8.000000/43.000000

Loaded native font : 0x73c350

Drawing at size 26x43...

Drawing at size 21x43...

Drawing at size 8x43...

Drawing at size 21x43...

Drawing at size 10x43...

Drawing at size 11x43...



On Wed, Aug 3, 2011 at 4:17 AM, Gamehaxe <[hidden email]> wrote:
Hi,
If you are getting all "." then I think the glyph is probably rendering in
the wrong spot (too high or too low).  Probably 1 char height off.

I also notice some changes in http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682
messing with the sign (+/-) of the descender.

You may also need to do something like leading-ascender.

Try changing the origin used by [str drawAtPoint:textOrigin withFont:mFont];

to something like:
CGPoint textOrigin = CGPointMake(0,15);
or
CGPoint textOrigin = CGPointMake(0,-15);

Also, it would be interesting to see what the size is:
CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);

Another thing to try is a multi-lined text box - there may be an origin/renderer clipping problem.

Hugh


Hey Hugh,

I ran with debug on device and those lines uncommented.  When running on
3.1.3 I get all dots.  If you point me in the right direction to debug/test
a fix I'll get to it and report back (since 3.1.3 won't run in simulator i
guess)

Included below is the output, plus a small change I made to handle an api
change for line height thats different prior to 3.2.  Maybe I broke it that
way somehow with the leading?  from what i read they simply replaced
'leading' with 'lineheight' in the api)

Thanks!

Alex

--

 if([mFont respondsToSelector: NSSelectorFromString(@"lineHeight")])

        {

 mMetrics.height = (int)[ mFont lineHeight ];

 }

 else {

 mMetrics.height = (int) [mFont leading ];

 }


        printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
mMetrics.descent ,  mMetrics.height );

--


*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
*

On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:

No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

 Thanks Hugh, will try- so I need to try to render a textfield who's
contents
is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the
size
measurements of fields, after changing that one property) but nothing
actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]> wrote:

 Hi,
If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


 Hello,


Any ideas on this bug: http://code.google.com/p/**
nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**

nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>


It's the only issue that makes nme not work on an iOS v3.2 device that i
can't figure out.  They just plain don't show up...

Alex


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


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

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


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

Re: fonts don't render in nme on iphone version <4?

Baluta Cristian
I think that are some statistics somewhere, the number of people with ios < 4 is too small to bother supporting it.


On Thu, Aug 4, 2011 at 12:35 AM, Alex Liebert <[hidden email]> wrote:
Thanks Hugh.

I tried a y offset of 15 and -15 but saw no change.

here's some printout on the 02 text sample for that CGSize:

mFont metrics 11.000000/2.000000/15.000000

Loaded native font : 0x72ee70

Drawing at size 9x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 4x15...

mFont metrics 15.000000/3.000000/20.000000

Loaded native font : 0x73a2f0

Drawing at size 12x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 5x20...

mFont metrics 22.000000/5.000000/29.000000

Loaded native font : 0x73b210

Drawing at size 18x29...

Drawing at size 14x29...

Drawing at size 6x29...

Drawing at size 14x29...

Drawing at size 7x29...

Drawing at size 7x29...

mFont metrics 33.000000/8.000000/43.000000

Loaded native font : 0x73c350

Drawing at size 26x43...

Drawing at size 21x43...

Drawing at size 8x43...

Drawing at size 21x43...

Drawing at size 10x43...

Drawing at size 11x43...



On Wed, Aug 3, 2011 at 4:17 AM, Gamehaxe <[hidden email]> wrote:
Hi,
If you are getting all "." then I think the glyph is probably rendering in
the wrong spot (too high or too low).  Probably 1 char height off.

I also notice some changes in http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682
messing with the sign (+/-) of the descender.

You may also need to do something like leading-ascender.

Try changing the origin used by [str drawAtPoint:textOrigin withFont:mFont];

to something like:
CGPoint textOrigin = CGPointMake(0,15);
or
CGPoint textOrigin = CGPointMake(0,-15);

Also, it would be interesting to see what the size is:
CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);

Another thing to try is a multi-lined text box - there may be an origin/renderer clipping problem.

Hugh


Hey Hugh,

I ran with debug on device and those lines uncommented.  When running on
3.1.3 I get all dots.  If you point me in the right direction to debug/test
a fix I'll get to it and report back (since 3.1.3 won't run in simulator i
guess)

Included below is the output, plus a small change I made to handle an api
change for line height thats different prior to 3.2.  Maybe I broke it that
way somehow with the leading?  from what i read they simply replaced
'leading' with 'lineheight' in the api)

Thanks!

Alex

--

 if([mFont respondsToSelector: NSSelectorFromString(@"lineHeight")])

        {

 mMetrics.height = (int)[ mFont lineHeight ];

 }

 else {

 mMetrics.height = (int) [mFont leading ];

 }


        printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
mMetrics.descent ,  mMetrics.height );

--


*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
*

On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:

No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

 Thanks Hugh, will try- so I need to try to render a textfield who's
contents
is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the
size
measurements of fields, after changing that one property) but nothing
actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]> wrote:

 Hi,
If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


 Hello,


Any ideas on this bug: http://code.google.com/p/**
nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**

nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>


It's the only issue that makes nme not work on an iOS v3.2 device that i
can't figure out.  They just plain don't show up...

Alex


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


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

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


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



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

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

Re: fonts don't render in nme on iphone version <4?

Alex Liebert
If I can fix it, I'd love to fix it, since it's the only place with a major issue for supporting 3.1.3.  If you look at the top games on the app store, they still support 3.1.3 (which first generation device users are locked in to.)

On Wed, Aug 3, 2011 at 9:50 PM, Baluta Cristian <[hidden email]> wrote:
I think that are some statistics somewhere, the number of people with ios < 4 is too small to bother supporting it.


On Thu, Aug 4, 2011 at 12:35 AM, Alex Liebert <[hidden email]> wrote:
Thanks Hugh.

I tried a y offset of 15 and -15 but saw no change.

here's some printout on the 02 text sample for that CGSize:

mFont metrics 11.000000/2.000000/15.000000

Loaded native font : 0x72ee70

Drawing at size 9x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 4x15...

mFont metrics 15.000000/3.000000/20.000000

Loaded native font : 0x73a2f0

Drawing at size 12x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 5x20...

mFont metrics 22.000000/5.000000/29.000000

Loaded native font : 0x73b210

Drawing at size 18x29...

Drawing at size 14x29...

Drawing at size 6x29...

Drawing at size 14x29...

Drawing at size 7x29...

Drawing at size 7x29...

mFont metrics 33.000000/8.000000/43.000000

Loaded native font : 0x73c350

Drawing at size 26x43...

Drawing at size 21x43...

Drawing at size 8x43...

Drawing at size 21x43...

Drawing at size 10x43...

Drawing at size 11x43...



On Wed, Aug 3, 2011 at 4:17 AM, Gamehaxe <[hidden email]> wrote:
Hi,
If you are getting all "." then I think the glyph is probably rendering in
the wrong spot (too high or too low).  Probably 1 char height off.

I also notice some changes in http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682
messing with the sign (+/-) of the descender.

You may also need to do something like leading-ascender.

Try changing the origin used by [str drawAtPoint:textOrigin withFont:mFont];

to something like:
CGPoint textOrigin = CGPointMake(0,15);
or
CGPoint textOrigin = CGPointMake(0,-15);

Also, it would be interesting to see what the size is:
CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);

Another thing to try is a multi-lined text box - there may be an origin/renderer clipping problem.

Hugh


Hey Hugh,

I ran with debug on device and those lines uncommented.  When running on
3.1.3 I get all dots.  If you point me in the right direction to debug/test
a fix I'll get to it and report back (since 3.1.3 won't run in simulator i
guess)

Included below is the output, plus a small change I made to handle an api
change for line height thats different prior to 3.2.  Maybe I broke it that
way somehow with the leading?  from what i read they simply replaced
'leading' with 'lineheight' in the api)

Thanks!

Alex

--

 if([mFont respondsToSelector: NSSelectorFromString(@"lineHeight")])

        {

 mMetrics.height = (int)[ mFont lineHeight ];

 }

 else {

 mMetrics.height = (int) [mFont leading ];

 }


        printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
mMetrics.descent ,  mMetrics.height );

--


*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
*

On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:

No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

 Thanks Hugh, will try- so I need to try to render a textfield who's
contents
is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the
size
measurements of fields, after changing that one property) but nothing
actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]> wrote:

 Hi,
If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


 Hello,


Any ideas on this bug: http://code.google.com/p/**
nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**

nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>


It's the only issue that makes nme not work on an iOS v3.2 device that i
can't figure out.  They just plain don't show up...

Alex


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


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

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


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



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

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


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

Re: fonts don't render in nme on iphone version <4?

Alex Liebert
In reply to this post by Alex Liebert
Hi Hugh,

Any further debug suggestions?  Things look 'right' but still don't show up, I tried changing the offsets a little but didn't see a visible change.

I updated to your latest glyph code which seems faster actually.  I had to change the get resource lines to work on ios3 too (otherwise all output for fonts was empty bc it wouldn't find the file?):

             // Could not find installed font - try one in file...

std::string fName=GetResourcePath() + gAssetBase + name +".ttf";

NSString *fontPath = [[NSString alloc] initWithUTF8String:fName.c_str()];

printf("font path: %s\n",[fontPath UTF8String]);

 

 // str = [[NSString alloc] initWithUTF8String:(gAssetBase+name).c_str()];

//NSString *fontPath = [[NSBundle mainBundle] pathForResource:str ofType:@"ttf"]; 



On Wed, Aug 3, 2011 at 2:35 PM, Alex Liebert <[hidden email]> wrote:
Thanks Hugh.

I tried a y offset of 15 and -15 but saw no change.

here's some printout on the 02 text sample for that CGSize:

mFont metrics 11.000000/2.000000/15.000000

Loaded native font : 0x72ee70

Drawing at size 9x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 7x15...

Drawing at size 3x15...

Drawing at size 4x15...

mFont metrics 15.000000/3.000000/20.000000

Loaded native font : 0x73a2f0

Drawing at size 12x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 9x20...

Drawing at size 4x20...

Drawing at size 5x20...

mFont metrics 22.000000/5.000000/29.000000

Loaded native font : 0x73b210

Drawing at size 18x29...

Drawing at size 14x29...

Drawing at size 6x29...

Drawing at size 14x29...

Drawing at size 7x29...

Drawing at size 7x29...

mFont metrics 33.000000/8.000000/43.000000

Loaded native font : 0x73c350

Drawing at size 26x43...

Drawing at size 21x43...

Drawing at size 8x43...

Drawing at size 21x43...

Drawing at size 10x43...

Drawing at size 11x43...



On Wed, Aug 3, 2011 at 4:17 AM, Gamehaxe <[hidden email]> wrote:
Hi,
If you are getting all "." then I think the glyph is probably rendering in
the wrong spot (too high or too low).  Probably 1 char height off.

I also notice some changes in http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682
messing with the sign (+/-) of the descender.

You may also need to do something like leading-ascender.

Try changing the origin used by [str drawAtPoint:textOrigin withFont:mFont];

to something like:
CGPoint textOrigin = CGPointMake(0,15);
or
CGPoint textOrigin = CGPointMake(0,-15);

Also, it would be interesting to see what the size is:
CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);

Another thing to try is a multi-lined text box - there may be an origin/renderer clipping problem.

Hugh


Hey Hugh,

I ran with debug on device and those lines uncommented.  When running on
3.1.3 I get all dots.  If you point me in the right direction to debug/test
a fix I'll get to it and report back (since 3.1.3 won't run in simulator i
guess)

Included below is the output, plus a small change I made to handle an api
change for line height thats different prior to 3.2.  Maybe I broke it that
way somehow with the leading?  from what i read they simply replaced
'leading' with 'lineheight' in the api)

Thanks!

Alex

--

 if([mFont respondsToSelector: NSSelectorFromString(@"lineHeight")])

        {

 mMetrics.height = (int)[ mFont lineHeight ];

 }

 else {

 mMetrics.height = (int) [mFont leading ];

 }


        printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
mMetrics.descent ,  mMetrics.height );

--


*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mFont
metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
*

On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:

No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

 Thanks Hugh, will try- so I need to try to render a textfield who's
contents
is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the
size
measurements of fields, after changing that one property) but nothing
actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]> wrote:

 Hi,
If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


 Hello,


Any ideas on this bug: http://code.google.com/p/**
nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**

nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>


It's the only issue that makes nme not work on an iOS v3.2 device that i
can't figure out.  They just plain don't show up...

Alex


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


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

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



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

Re: fonts don't render in nme on iphone version <4?

Gamehaxe
Hi,
I could only run the emulator for 3.2, not 3.1, so I can't reproduce this.
I'm wondering now if it is something other than the font, like the
font colour or the blend mode that needs to be set.  Could
perhaps try drawing some lines just to make sure they show up.
Given that it works on 3.2, what is the type of use who would have
3.1, but can't upgrade for some reason?

HUgh

> Hi Hugh,
>
> Any further debug suggestions?  Things look 'right' but still don't show  
> up,
> I tried changing the offsets a little but didn't see a visible change.
>
> I updated to your latest glyph code which seems faster actually.  I had  
> to
> change the get resource lines to work on ios3 too (otherwise all output  
> for
> fonts was empty bc it wouldn't find the file?):
>
>              // Could not find installed font - try one in file...
>
>  std::string fName=GetResourcePath() + gAssetBase + name +".ttf";
>
>  NSString *fontPath = [[NSString alloc]  
> initWithUTF8String:fName.c_str()];
>
>  printf("font path: %s\n",[fontPath UTF8String]);
>
>
>
>  // str = [[NSString alloc]  
> initWithUTF8String:(gAssetBase+name).c_str()];
>
> //NSString *fontPath = [[NSBundle mainBundle] pathForResource:str  
> ofType:@
> "ttf"];
>
>
>
> On Wed, Aug 3, 2011 at 2:35 PM, Alex Liebert  
> <[hidden email]>wrote:
>
>> Thanks Hugh.
>>
>> I tried a y offset of 15 and -15 but saw no change.
>>
>> here's some printout on the 02 text sample for that CGSize:
>>
>> *mFont metrics 11.000000/2.000000/15.000000*
>>
>> *Loaded native font : 0x72ee70*
>>
>> *Drawing at size 9x15...*
>>
>> *Drawing at size 7x15...*
>>
>> *Drawing at size 3x15...*
>>
>> *Drawing at size 7x15...*
>>
>> *Drawing at size 3x15...*
>>
>> *Drawing at size 4x15...*
>>
>> *mFont metrics 15.000000/3.000000/20.000000*
>>
>> *Loaded native font : 0x73a2f0*
>>
>> *Drawing at size 12x20...*
>>
>> *Drawing at size 9x20...*
>>
>> *Drawing at size 4x20...*
>>
>> *Drawing at size 9x20...*
>>
>> *Drawing at size 4x20...*
>>
>> *Drawing at size 5x20...*
>>
>> *mFont metrics 22.000000/5.000000/29.000000*
>>
>> *Loaded native font : 0x73b210*
>>
>> *Drawing at size 18x29...*
>>
>> *Drawing at size 14x29...*
>>
>> *Drawing at size 6x29...*
>>
>> *Drawing at size 14x29...*
>>
>> *Drawing at size 7x29...*
>>
>> *Drawing at size 7x29...*
>>
>> *mFont metrics 33.000000/8.000000/43.000000*
>>
>> *Loaded native font : 0x73c350*
>>
>> *Drawing at size 26x43...*
>>
>> *Drawing at size 21x43...*
>>
>> *Drawing at size 8x43...*
>>
>> *Drawing at size 21x43...*
>>
>> *Drawing at size 10x43...*
>>
>> *Drawing at size 11x43...*
>> *
>> *
>>
>> On Wed, Aug 3, 2011 at 4:17 AM, Gamehaxe <[hidden email]> wrote:
>>
>>> Hi,
>>> If you are getting all "." then I think the glyph is probably  
>>> rendering in
>>> the wrong spot (too high or too low).  Probably 1 char height off.
>>>
>>> I also notice some changes in http://code.google.com/p/**
>>> nekonme/source/list?path=/**trunk/project/iPhone/**
>>> NativeFont.mm&start=682<http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682>
>>> messing with the sign (+/-) of the descender.
>>>
>>> You may also need to do something like leading-ascender.
>>>
>>> Try changing the origin used by [str drawAtPoint:textOrigin
>>> withFont:mFont];
>>>
>>> to something like:
>>> CGPoint textOrigin = CGPointMake(0,15);
>>> or
>>> CGPoint textOrigin = CGPointMake(0,-15);
>>>
>>> Also, it would be interesting to see what the size is:
>>> CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);
>>>
>>> Another thing to try is a multi-lined text box - there may be an
>>> origin/renderer clipping problem.
>>>
>>> Hugh
>>>
>>>
>>>  Hey Hugh,
>>>>
>>>> I ran with debug on device and those lines uncommented.  When running  
>>>> on
>>>> 3.1.3 I get all dots.  If you point me in the right direction to
>>>> debug/test
>>>> a fix I'll get to it and report back (since 3.1.3 won't run in  
>>>> simulator
>>>> i
>>>> guess)
>>>>
>>>> Included below is the output, plus a small change I made to handle an  
>>>> api
>>>> change for line height thats different prior to 3.2.  Maybe I broke it
>>>> that
>>>> way somehow with the leading?  from what i read they simply replaced
>>>> 'leading' with 'lineheight' in the api)
>>>>
>>>> Thanks!
>>>>
>>>> Alex
>>>>
>>>> --
>>>>
>>>>  if([mFont respondsToSelector: NSSelectorFromString(@"**lineHeight")])
>>>>
>>>>         {
>>>>
>>>>  mMetrics.height = (int)[ mFont lineHeight ];
>>>>
>>>>  }
>>>>
>>>>  else {
>>>>
>>>>  mMetrics.height = (int) [mFont leading ];
>>>>
>>>>  }
>>>>
>>>>
>>>>         printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
>>>> mMetrics.descent ,  mMetrics.height );
>>>>
>>>> --
>>>>
>>>>
>>>> *mFont metrics 11.000000/2.000000/15.000000*
>>>>
>>>> *Loaded native font : 0x72ee70*
>>>>
>>>> *.............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ................mFont
>>>> metrics 15.000000/3.000000/20.000000*
>>>>
>>>> *Loaded native font : 0x73a2f0*
>>>>
>>>> *.............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> .....................mFont
>>>> metrics 22.000000/5.000000/29.000000*
>>>>
>>>> *Loaded native font : 0x73b210*
>>>>
>>>> *.............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**.........................mFont
>>>> metrics 33.000000/8.000000/43.000000*
>>>>
>>>> *Loaded native font : 0x73c350*
>>>>
>>>> *
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> ..............................**..............................**
>>>> .............................
>>>> *
>>>>
>>>> On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]>  
>>>> wrote:
>>>>
>>>>  No, the glyphs should be printed out, like:
>>>>>
>>>>>
>>>>> ...XXXX...
>>>>> ..XX...XX.
>>>>> ..XX...XX.
>>>>> ..XXXXXXX.
>>>>> ..XX...XX
>>>>> ..XX...XX.
>>>>>
>>>>> Hugh
>>>>>
>>>>>  Thanks Hugh, will try- so I need to try to render a textfield who's
>>>>>
>>>>>> contents
>>>>>> is either 'xxxx' or '....' ?
>>>>>>
>>>>>> I tried printf debugs before and everything seemed right (including  
>>>>>> the
>>>>>> size
>>>>>> measurements of fields, after changing that one property) but  
>>>>>> nothing
>>>>>> actually appeared on screen.
>>>>>>
>>>>>> Alex
>>>>>>
>>>>>>
>>>>>> On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>>  Hi,
>>>>>>
>>>>>>> If you enable all the printf's in NmativeFont.mm/RenderGlyph, you  
>>>>>>> can
>>>>>>> see if it is rendering all '.' or whether '.' and 'X' are rendered.
>>>>>>> If it is all '.' then perhaps there is a rendering offset that  
>>>>>>> needs
>>>>>>> to be taken into account.
>>>>>>> If nothing is printed then the font creation may have failed.
>>>>>>> If it looks good, then the problem is downstream.
>>>>>>>
>>>>>>> Hugh
>>>>>>>
>>>>>>>
>>>>>>>  Hello,
>>>>>>>
>>>>>>>
>>>>>>>> Any ideas on this bug: http://code.google.com/p/**
>>>>>>>> nekonme/issues/detail?id=112<**h**ttp://code.google.com/p/**
>>>>>>>>
>>>>>>>> nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**
>>>>>>>> nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>>>>>>>> >
>>>>>>>> >
>>>>>>>>
>>>>>>>>
>>>>>>>> It's the only issue that makes nme not work on an iOS v3.2 device
>>>>>>>> that i
>>>>>>>> can't figure out.  They just plain don't show up...
>>>>>>>>
>>>>>>>> Alex
>>>>>>>>
>>>>>>>>
>>>>>>>>  --
>>>>>>> haXe - an open source web programming language
>>>>>>> http://haxe.org
>>>>>>>
>>>>>>>
>>>>>>  --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>

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

Re: fonts don't render in nme on iphone version <4?

Baluta Cristian
3.2 is for iPad, for the iPhone the latest version is 3.1.3. I think only first generation of iphones have it and maybe the people with 3G which didn't knew how to upgrade to 4.


On Tue, Aug 16, 2011 at 12:49 PM, Gamehaxe <[hidden email]> wrote:
Hi,
I could only run the emulator for 3.2, not 3.1, so I can't reproduce this.
I'm wondering now if it is something other than the font, like the
font colour or the blend mode that needs to be set.  Could
perhaps try drawing some lines just to make sure they show up.
Given that it works on 3.2, what is the type of use who would have
3.1, but can't upgrade for some reason?

HUgh

Hi Hugh,

Any further debug suggestions?  Things look 'right' but still don't show up,
I tried changing the offsets a little but didn't see a visible change.

I updated to your latest glyph code which seems faster actually.  I had to
change the get resource lines to work on ios3 too (otherwise all output for
fonts was empty bc it wouldn't find the file?):

            // Could not find installed font - try one in file...

 std::string fName=GetResourcePath() + gAssetBase + name +".ttf";

 NSString *fontPath = [[NSString alloc] initWithUTF8String:fName.c_str()];

 printf("font path: %s\n",[fontPath UTF8String]);



 // str = [[NSString alloc] initWithUTF8String:(gAssetBase+name).c_str()];

//NSString *fontPath = [[NSBundle mainBundle] pathForResource:str ofType:@
"ttf"];



On Wed, Aug 3, 2011 at 2:35 PM, Alex Liebert <[hidden email]>wrote:

Thanks Hugh.

I tried a y offset of 15 and -15 but saw no change.

here's some printout on the 02 text sample for that CGSize:

*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*Drawing at size 9x15...*

*Drawing at size 7x15...*

*Drawing at size 3x15...*

*Drawing at size 7x15...*

*Drawing at size 3x15...*

*Drawing at size 4x15...*

*mFont metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*Drawing at size 12x20...*

*Drawing at size 9x20...*

*Drawing at size 4x20...*

*Drawing at size 9x20...*

*Drawing at size 4x20...*

*Drawing at size 5x20...*

*mFont metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*Drawing at size 18x29...*

*Drawing at size 14x29...*

*Drawing at size 6x29...*

*Drawing at size 14x29...*

*Drawing at size 7x29...*

*Drawing at size 7x29...*

*mFont metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*Drawing at size 26x43...*

*Drawing at size 21x43...*

*Drawing at size 8x43...*

*Drawing at size 21x43...*

*Drawing at size 10x43...*

*Drawing at size 11x43...*
*
*

On Wed, Aug 3, 2011 at 4:17 AM, Gamehaxe <[hidden email]> wrote:

Hi,
If you are getting all "." then I think the glyph is probably rendering in
the wrong spot (too high or too low).  Probably 1 char height off.

I also notice some changes in http://code.google.com/p/**
nekonme/source/list?path=/**trunk/project/iPhone/**
NativeFont.mm&start=682<http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682>

messing with the sign (+/-) of the descender.

You may also need to do something like leading-ascender.

Try changing the origin used by [str drawAtPoint:textOrigin
withFont:mFont];

to something like:
CGPoint textOrigin = CGPointMake(0,15);
or
CGPoint textOrigin = CGPointMake(0,-15);

Also, it would be interesting to see what the size is:
CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);

Another thing to try is a multi-lined text box - there may be an
origin/renderer clipping problem.

Hugh


 Hey Hugh,

I ran with debug on device and those lines uncommented.  When running on
3.1.3 I get all dots.  If you point me in the right direction to
debug/test
a fix I'll get to it and report back (since 3.1.3 won't run in simulator
i
guess)

Included below is the output, plus a small change I made to handle an api
change for line height thats different prior to 3.2.  Maybe I broke it
that
way somehow with the leading?  from what i read they simply replaced
'leading' with 'lineheight' in the api)

Thanks!

Alex

--

 if([mFont respondsToSelector: NSSelectorFromString(@"**lineHeight")])

       {

 mMetrics.height = (int)[ mFont lineHeight ];

 }

 else {

 mMetrics.height = (int) [mFont leading ];

 }


       printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
mMetrics.descent ,  mMetrics.height );

--


*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*.............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
................mFont
metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*.............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
.....................mFont
metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*.............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**.........................mFont
metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
.............................
*

On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:

 No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

 Thanks Hugh, will try- so I need to try to render a textfield who's

contents
is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the
size
measurements of fields, after changing that one property) but nothing
actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]>
wrote:

 Hi,

If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


 Hello,


Any ideas on this bug: http://code.google.com/p/**
nekonme/issues/detail?id=112<**h**ttp://code.google.com/p/**

nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**
nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>
>


It's the only issue that makes nme not work on an iOS v3.2 device
that i
can't figure out.  They just plain don't show up...

Alex


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


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


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



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



--
Băluță Cristian
http://ralcr.com
http://imagin.ro

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

Re: fonts don't render in nme on iphone version <4?

Alex Liebert
In reply to this post by Gamehaxe
Hm, thanks Hugh.  Line drawing with graphics API works ok.  For the blend mode- how would I Test that?  Is it something internal in cpp or just like the standard displayobject blendmode properties?

Baluta's correct- the iPhone 1st generation can't run greater than 3.1.2.  The iPhone 3G, although it's the same hardware, can run 4.  It's lame that apple won't ship the older simulator stuff anymore.  They want people to move on from the old hardware (understandable), but still, all the top games support 3.1.2 still, and I can say for sure there are a number of game reviewers out there who actually test on first gen hardware.

Thanks!

Alex


On Tue, Aug 16, 2011 at 2:49 AM, Gamehaxe <[hidden email]> wrote:
Hi,
I could only run the emulator for 3.2, not 3.1, so I can't reproduce this.
I'm wondering now if it is something other than the font, like the
font colour or the blend mode that needs to be set.  Could
perhaps try drawing some lines just to make sure they show up.
Given that it works on 3.2, what is the type of use who would have
3.1, but can't upgrade for some reason?

HUgh

Hi Hugh,

Any further debug suggestions?  Things look 'right' but still don't show up,
I tried changing the offsets a little but didn't see a visible change.

I updated to your latest glyph code which seems faster actually.  I had to
change the get resource lines to work on ios3 too (otherwise all output for
fonts was empty bc it wouldn't find the file?):

            // Could not find installed font - try one in file...

 std::string fName=GetResourcePath() + gAssetBase + name +".ttf";

 NSString *fontPath = [[NSString alloc] initWithUTF8String:fName.c_str()];

 printf("font path: %s\n",[fontPath UTF8String]);



 // str = [[NSString alloc] initWithUTF8String:(gAssetBase+name).c_str()];

//NSString *fontPath = [[NSBundle mainBundle] pathForResource:str ofType:@
"ttf"];



On Wed, Aug 3, 2011 at 2:35 PM, Alex Liebert <[hidden email]>wrote:

Thanks Hugh.

I tried a y offset of 15 and -15 but saw no change.

here's some printout on the 02 text sample for that CGSize:

*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*Drawing at size 9x15...*

*Drawing at size 7x15...*

*Drawing at size 3x15...*

*Drawing at size 7x15...*

*Drawing at size 3x15...*

*Drawing at size 4x15...*

*mFont metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*Drawing at size 12x20...*

*Drawing at size 9x20...*

*Drawing at size 4x20...*

*Drawing at size 9x20...*

*Drawing at size 4x20...*

*Drawing at size 5x20...*

*mFont metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*Drawing at size 18x29...*

*Drawing at size 14x29...*

*Drawing at size 6x29...*

*Drawing at size 14x29...*

*Drawing at size 7x29...*

*Drawing at size 7x29...*

*mFont metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*Drawing at size 26x43...*

*Drawing at size 21x43...*

*Drawing at size 8x43...*

*Drawing at size 21x43...*

*Drawing at size 10x43...*

*Drawing at size 11x43...*
*
*

On Wed, Aug 3, 2011 at 4:17 AM, Gamehaxe <[hidden email]> wrote:

Hi,
If you are getting all "." then I think the glyph is probably rendering in
the wrong spot (too high or too low).  Probably 1 char height off.

I also notice some changes in http://code.google.com/p/**
nekonme/source/list?path=/**trunk/project/iPhone/**
NativeFont.mm&start=682<http://code.google.com/p/nekonme/source/list?path=/trunk/project/iPhone/NativeFont.mm&start=682>

messing with the sign (+/-) of the descender.

You may also need to do something like leading-ascender.

Try changing the origin used by [str drawAtPoint:textOrigin
withFont:mFont];

to something like:
CGPoint textOrigin = CGPointMake(0,15);
or
CGPoint textOrigin = CGPointMake(0,-15);

Also, it would be interesting to see what the size is:
CGSize size = CGSizeMake(outTarget.mRect.w, outTarget.mRect.h);

Another thing to try is a multi-lined text box - there may be an
origin/renderer clipping problem.

Hugh


 Hey Hugh,

I ran with debug on device and those lines uncommented.  When running on
3.1.3 I get all dots.  If you point me in the right direction to
debug/test
a fix I'll get to it and report back (since 3.1.3 won't run in simulator
i
guess)

Included below is the output, plus a small change I made to handle an api
change for line height thats different prior to 3.2.  Maybe I broke it
that
way somehow with the leading?  from what i read they simply replaced
'leading' with 'lineheight' in the api)

Thanks!

Alex

--

 if([mFont respondsToSelector: NSSelectorFromString(@"**lineHeight")])

       {

 mMetrics.height = (int)[ mFont lineHeight ];

 }

 else {

 mMetrics.height = (int) [mFont leading ];

 }


       printf("mFont metrics %f/%f/%f\n",  mMetrics.ascent,
mMetrics.descent ,  mMetrics.height );

--


*mFont metrics 11.000000/2.000000/15.000000*

*Loaded native font : 0x72ee70*

*.............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
................mFont
metrics 15.000000/3.000000/20.000000*

*Loaded native font : 0x73a2f0*

*.............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
.....................mFont
metrics 22.000000/5.000000/29.000000*

*Loaded native font : 0x73b210*

*.............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**.........................mFont
metrics 33.000000/8.000000/43.000000*

*Loaded native font : 0x73c350*

*
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
..............................**..............................**
.............................
*

On Sun, Jul 31, 2011 at 4:59 PM, Gamehaxe <[hidden email]> wrote:

 No, the glyphs should be printed out, like:


...XXXX...
..XX...XX.
..XX...XX.
..XXXXXXX.
..XX...XX
..XX...XX.

Hugh

 Thanks Hugh, will try- so I need to try to render a textfield who's

contents
is either 'xxxx' or '....' ?

I tried printf debugs before and everything seemed right (including the
size
measurements of fields, after changing that one property) but nothing
actually appeared on screen.

Alex


On Sun, Jul 31, 2011 at 1:45 AM, Gamehaxe <[hidden email]>
wrote:

 Hi,

If you enable all the printf's in NmativeFont.mm/RenderGlyph, you can
see if it is rendering all '.' or whether '.' and 'X' are rendered.
If it is all '.' then perhaps there is a rendering offset that needs
to be taken into account.
If nothing is printed then the font creation may have failed.
If it looks good, then the problem is downstream.

Hugh


 Hello,


Any ideas on this bug: http://code.google.com/p/**
nekonme/issues/detail?id=112<**h**ttp://code.google.com/p/**

nekonme/issues/detail?id=112<h**ttp://code.google.com/p/**
nekonme/issues/detail?id=112<http://code.google.com/p/nekonme/issues/detail?id=112>
>
>


It's the only issue that makes nme not work on an iOS v3.2 device
that i
can't figure out.  They just plain don't show up...

Alex


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


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


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



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


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