iDevGames Forums
Using png font . please help - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Using png font . please help (/thread-2712.html)



Using png font . please help - gotfredsen - Mar 19, 2008 01:10 AM

Hi everyone. this is my first post ...

I am trying to do a thing that I gues for you people is a rather simple thing . but I do not know what its called and what tools to use ..

What I´m trying to do is converting a font abcdefgh etc into a png file so I can budle that file with my app and then use that resource png to render text ...

MyFont.ttf - > Myfont.png


in app

renderText("Hello World", "MyFont.png");

thanks in advance

Best Regards
Andy


Using png font . please help - OneSadCookie - Mar 19, 2008 01:18 AM

http://fax.twilightcoders.net/GlyphTool/

There may be others, but this one was made by a forum member here Wink


Using png font . please help - gotfredsen - Mar 19, 2008 03:51 AM

OneSadCookie Wrote:http://fax.twilightcoders.net/GlyphTool/

There may be others, but this one was made by a forum member here Wink

great, thanks I´m one step closer .


Using png font . please help - gotfredsen - Mar 19, 2008 05:08 AM

its seems there something wrong with the gui in leopard ... not working at all ... the Glyphs are only displayed as a long line and not in a grid ...


Using png font . please help - _ibd_ - Mar 19, 2008 09:30 AM

Yes, others and I get the same error... does anyone know how/care to fix it? Sad


Using png font . please help - ThemsAllTook - Mar 19, 2008 09:47 AM

E-mailing the author is probably the best approach to getting it fixed.


Using png font . please help - _ibd_ - Mar 19, 2008 12:47 PM

It seems like Ed doesn't know what is causing the bug, so it might be good if other people could help to resolve the problem, too. Smile


Using png font . please help - handcircus - May 30, 2008 03:01 AM

_ibd_ Wrote:It seems like Ed doesn't know what is causing the bug, so it might be good if other people could help to resolve the problem, too. Smile

Not sure if anyone is still looking for a fix for this for leopard (I wanted to use it for an iPhone game), but you just need to make a couple changes to GlyphToolTypesetter. I'll mail over a zip if anyone wants it. Hope this helps Smile



In GlyphToolTypesetter, the listener has changed.

You need to change

Code:
- (void)layoutGlyphsInLayoutManager:(NSLayoutManager *)theLayoutManager startingAtGlyphIndex:(unsigned)startGlyphIndex maxNumberOfLineFragments:(unsigned)maxNumLines nextGlyphIndex:(unsigned *)nextGlyph

TO

Code:
- (NSRange)layoutCharactersInRange:(NSRange)characterRange forLayoutManager:(NSLayoutManager *)theLayoutManager maximumNumberOfLineFragments:(long)maxNumLines

(In both the .h and .m files)



and in the function you need to change the following


Code:
[super layoutGlyphsInLayoutManager:theLayoutManager startingAtGlyphIndex:startGlyphIndex maxNumberOfLineFragments:maxNumLines nextGlyphIndex:nextGlyph];

TO

Code:
int startGlyphIndex=characterRange.location;
[super layoutCharactersInRange:characterRange forLayoutManager:theLayoutManager maximumNumberOfLineFragments:maxNumLines];