Using png font . please help

gotfredsen
Unregistered
 
Post: #1
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
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
http://fax.twilightcoders.net/GlyphTool/

There may be others, but this one was made by a forum member here Wink
Quote this message in a reply
gotfredsen
Unregistered
 
Post: #3
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 .
Quote this message in a reply
gotfredsen
Unregistered
 
Post: #4
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 ...
Quote this message in a reply
Member
Posts: 59
Joined: 2007.12
Post: #5
Yes, others and I get the same error... does anyone know how/care to fix it? Sad
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #6
E-mailing the author is probably the best approach to getting it fixed.
Quote this message in a reply
Member
Posts: 59
Joined: 2007.12
Post: #7
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
Quote this message in a reply
handcircus
Unregistered
 
Post: #8
_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];
Quote this message in a reply
Post Reply