Re: Animating handwriting

2011-06-26 Thread Gustavo Pizano
Ok I will check in Photoshop and create the animation there.

Thanks all for the reply
G
On Jun 25, 2011, at 4:47 AM, Scott Anguish wrote:

 I don’t think it’s the amount of page space, rather the quantity of the 
 alphabet.
 
 If this is just for an effect for an about screen or soemthing, I’d say your 
 photoshop idea is the way to go.
 
 Otherwise, I’d suggest the drawing custom app, but even then you’re going to 
 have issues with making sure that as you put in the ‘lines’ to follow for the 
 pen that the direction of the animated fill is right (likely at 90 degrees to 
 the pen position or previous direction). I only know this because it’s an 
 issue with embroidery software. the alternative is to draw points back and 
 forth on each side of the each letter for the fill. major tedium.
 
 All this sounds like a lot of work without knowing what the reason is.
 
 
 On Jun 24, 2011, at 9:26 AM, Ken Tozier wrote:
 
 If you're writing a whole page of text, creating all the frames by hand 
 would get real old real quick.
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-24 Thread Uli Kusterer
On 23.06.2011, at 18:45, Gustavo Pizano wrote:
 Yes kinda.

 kinda? Well, if you have a font, you simply don't have the information. So 
all you can do is transition it on screen with a wipe effect in direction 
toRight. CIFilter and CATransition (not sure if the latter exists on iOS) 
would be the thing to go for here. This works quite well when done fairly 
quickly, line-by-line and for small text. The larger the font size, the less 
believable it looks. But usually it's enough.

 OTOH if you can have someone actually write the text for you (or at least each 
individual letter that you need) you could record the mouse location and then 
replay them.

 Come to think of it, you could probably manually click at even intervals on 
the stroke of every letter in characters written in the font you're using, 
record the click coordinates, and then draw bezier paths repeatedly, each time 
to one more point than before. Then draw the corresponding animation instead of 
each letter in the font.

 You would have to layout the text manually, but for button titles and other 
one-line (or hard-wrapped) text that usually works just fine.

-- Uli Kusterer
Sole Janitor
http://www.the-void-software.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-24 Thread Ken Tozier

On Jun 24, 2011, at 4:05 AM, Uli Kusterer wrote:

 Come to think of it, you could probably manually click at even intervals on 
 the stroke of every letter in characters written in the font you're using, 
 record the click coordinates, and then draw bezier paths repeatedly, each 
 time to one more point than before. Then draw the corresponding animation 
 instead of each letter in the font.
 
 You would have to layout the text manually, but for button titles and other 
 one-line (or hard-wrapped) text that usually works just fine.

If he wants to use an actual typeface, it might be better to use the click 
recordings of the character skeletons as the path of an eraser moving over a 
layer that obscures the type underneath. Basically, he'd need a type layer and 
a second overlay layer painted right on top of it. He'd have to experiment 
with the various compositing constants, but if he animated a circular dot, 
about the same size as the typeface strokes, erasing as it goes, then the real 
handwriting typeface would be revealed as it went 
along___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-24 Thread Gustavo Pizano
Hello all.

So it will be good idea then to create a Mac app that will record the imput 
from the mouse/pen in a character basis, then record each character and then 
pass a string to a method, divided the string in characters and draw each 
character from the map I already did before... 

maybe yes, maybe no? 

what do you think?

G.
On Jun 24, 2011, at 2:03 PM, Ken Tozier wrote:

 
 On Jun 24, 2011, at 4:05 AM, Uli Kusterer wrote:
 
 Come to think of it, you could probably manually click at even intervals on 
 the stroke of every letter in characters written in the font you're using, 
 record the click coordinates, and then draw bezier paths repeatedly, each 
 time to one more point than before. Then draw the corresponding animation 
 instead of each letter in the font.
 
 You would have to layout the text manually, but for button titles and other 
 one-line (or hard-wrapped) text that usually works just fine.
 
 If he wants to use an actual typeface, it might be better to use the click 
 recordings of the character skeletons as the path of an eraser moving over a 
 layer that obscures the type underneath. Basically, he'd need a type layer 
 and a second overlay layer painted right on top of it. He'd have to 
 experiment with the various compositing constants, but if he animated a 
 circular dot, about the same size as the typeface strokes, erasing as it 
 goes, then the real handwriting typeface would be revealed as it went 
 along___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/gustavxcodepicora%40gmail.com
 
 This email sent to gustavxcodepic...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-24 Thread Ken Tozier

On Jun 24, 2011, at 8:41 AM, Gustavo Pizano wrote:

 Hello all.
 
 So it will be good idea then to create a Mac app that will record the imput 
 from the mouse/pen in a character basis, then record each character and then 
 pass a string to a method, divided the string in characters and draw each 
 character from the map I already did before... 
 
 maybe yes, maybe no? 
 
 what do you think?
 
 G.

Depending on how much text you're trying to animate, it might be easier to just 
make the individual frames of the animation, by hand, in a graphics program and 
just play them back. If it's just a few words on a title page, you could use 
the erase as you go method I described in my last reply.

If you have Photoshop, create an image with two layers. type the text you want 
on one layer and fill a second layer with white. Use the eraser tool, erase a 
little bit of the overlay, save a frame, erase a little more save another 
frame, etc... It would save you a lot of work on writing an app just to record 
the handwriting strokes and another to play them back...

If you're writing a whole page of text, creating all the frames by hand would 
get real old real quick.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-24 Thread Scott Anguish
I don’t think it’s the amount of page space, rather the quantity of the 
alphabet.

If this is just for an effect for an about screen or soemthing, I’d say your 
photoshop idea is the way to go.

Otherwise, I’d suggest the drawing custom app, but even then you’re going to 
have issues with making sure that as you put in the ‘lines’ to follow for the 
pen that the direction of the animated fill is right (likely at 90 degrees to 
the pen position or previous direction). I only know this because it’s an issue 
with embroidery software. the alternative is to draw points back and forth on 
each side of the each letter for the fill. major tedium.

All this sounds like a lot of work without knowing what the reason is.


On Jun 24, 2011, at 9:26 AM, Ken Tozier wrote:

 If you're writing a whole page of text, creating all the frames by hand would 
 get real old real quick.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-23 Thread Ken Tozier
If you're writing with the mouse the following might help. It isn't done, 
still needs some sort of check in the drawRect method to know when you've drawn 
all the segments and you;ll need to adjust x/y values to the view you're 
drawing in, but it will get you started.

- (void) mouseDown:(NSEvent *) inEvent
{
// allocate a mutable data to store event points and times
dragPoints  = [[NSMutableData alloc] init];

// save fetch time and location of click and store in dragPoints
NSTimeInterval  timestamp   = [inEvent timestamp];
NSPoint clickPoint  = [inEvent locationInWindow];

[dragPoints appendBytes: timestamp length: sizeof(NSTimeInterval)];
[dragPoints appendBytes: dragPoint length: sizeof(NSPoint)];
}

- (void) mouseDragged:(NSEvent *) inEvent
{
NSTimeInterval  timestamp   = [inEvent timestamp];
NSPoint dragPoint   = [inEvent locationInWindow];

// write interval and point to dragPoints mutable data object
[dragPoints appendBytes: timestamp length: sizeof(NSTimeInterval)];
[dragPoints appendBytes: dragPoint length: sizeof(NSPoint)];
}

- (void) mouseUp:(NSEvent *) inEvent
{
// save the recording, either in memory or to a file
[dragPoints writeToFile: @/path/to/some/file.bin];

[dragPoints release];
}


// In your draw method, you could fetch a timestamp/NSPoint pair from the 
recording like so

- (void) drawRect:(NSRect) inRect
{
CGContextRefcontext = [[NSGraphicsContext 
currentContext] graphicsPort];

// some instance variable indicating where you are in the recording
int frameOffset = 
currentIncrement * (sizeof(NSTimeInterval) + sizeof(NSPoint));
NSTimeInterval  time= 
*(NSTimeInterval*)[dragPoints bytes] + frameOffset;
NSPoint point   = 
*(NSPoint*)[dragPoints bytes] + frameOffset + sizeof(NSTimeInterval);

// draw line
CGContextAddLineToPoint(context, point.x, point.y);

// create a new NSTimer with the delay from time variable
[NSTimer scheduledTimerWithTimeInterval: time 
target: self 
selector: @selector(dearRect:) 
userInfo: nil 
repeats: NO];

// increment placeholder
currentIncrement++;
}

On Jun 23, 2011, at 5:21 AM, Gustavo Adolfo Pizano wrote:

 Hello all.
 
 Im wondering if animating handwriting  is somehow possible to do, I
 have been looking but I find only how to do it in flash.
 
 Can somebody give me some headlights in the right direction so I can
 start digging into?
 
 Thanks a lot.
 
 Gustavo
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/kentozier%40comcast.net
 
 This email sent to kentoz...@comcast.net

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-23 Thread Gustavo Adolfo Pizano
Helo Ken.

Thanks for answer,
I meant, I have some title string already, and I wish to be able to
animate as if its being written at the moment, also I forgot to
mention that this is for iOS.

Once again thanks for the reply.

I will still check your code and see how maybe I can apply what I
need. Maybe, and for sure I need to get the points of the path to be
done first somehow and then animate the creating of the path.

i dunno.


G.


On Thu, Jun 23, 2011 at 12:34 PM, Ken Tozier kentoz...@comcast.net wrote:
 If you're writing with the mouse the following might help. It isn't done, 
 still needs some sort of check in the drawRect method to know when you've 
 drawn all the segments and you;ll need to adjust x/y values to the view 
 you're drawing in, but it will get you started.

 - (void) mouseDown:(NSEvent *) inEvent
 {
        // allocate a mutable data to store event points and times
        dragPoints              = [[NSMutableData alloc] init];

        // save fetch time and location of click and store in dragPoints
        NSTimeInterval  timestamp       = [inEvent timestamp];
        NSPoint                 clickPoint      = [inEvent locationInWindow];

        [dragPoints appendBytes: timestamp length: sizeof(NSTimeInterval)];
        [dragPoints appendBytes: dragPoint length: sizeof(NSPoint)];
 }

 - (void) mouseDragged:(NSEvent *) inEvent
 {
        NSTimeInterval  timestamp       = [inEvent timestamp];
        NSPoint                 dragPoint       = [inEvent locationInWindow];

        // write interval and point to dragPoints mutable data object
        [dragPoints appendBytes: timestamp length: sizeof(NSTimeInterval)];
        [dragPoints appendBytes: dragPoint length: sizeof(NSPoint)];
 }

 - (void) mouseUp:(NSEvent *) inEvent
 {
        // save the recording, either in memory or to a file
        [dragPoints writeToFile: @/path/to/some/file.bin];

        [dragPoints release];
 }


 // In your draw method, you could fetch a timestamp/NSPoint pair from the 
 recording like so

 - (void) drawRect:(NSRect) inRect
 {
        CGContextRef            context                 = [[NSGraphicsContext 
 currentContext] graphicsPort];

        // some instance variable indicating where you are in the recording
        int                                     frameOffset             = 
 currentIncrement * (sizeof(NSTimeInterval) + sizeof(NSPoint));
        NSTimeInterval          time                            = 
 *(NSTimeInterval*)[dragPoints bytes] + frameOffset;
        NSPoint                         point                   = 
 *(NSPoint*)[dragPoints bytes] + frameOffset + sizeof(NSTimeInterval);

        // draw line
        CGContextAddLineToPoint(context, point.x, point.y);

        // create a new NSTimer with the delay from time variable
        [NSTimer scheduledTimerWithTimeInterval: time
                        target: self
                        selector: @selector(dearRect:)
                        userInfo: nil
                        repeats: NO];

        // increment placeholder
        currentIncrement++;
 }

 On Jun 23, 2011, at 5:21 AM, Gustavo Adolfo Pizano wrote:

 Hello all.

 Im wondering if animating handwriting  is somehow possible to do, I
 have been looking but I find only how to do it in flash.

 Can somebody give me some headlights in the right direction so I can
 start digging into?

 Thanks a lot.

 Gustavo
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com

 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/kentozier%40comcast.net

 This email sent to kentoz...@comcast.net

 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com

 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/gustavxcodepicora%40gmail.com

 This email sent to gustavxcodepic...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-23 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 6/23/11 6:50 AM, Gustavo Adolfo Pizano wrote:
 Helo Ken.
 
 Thanks for answer,
 I meant, I have some title string already, and I wish to be able to
 animate as if its being written at the moment, also I forgot to
 mention that this is for iOS.

Sorry, do you mean that you have an NSString and a handwriting font,
and you wish to animate the rendering of the string in that font?

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFOA2r9aOlrz5+0JdURAj75AJ9caJFWiklpYPCugSc0DkSyn5/ReACggouj
F8Ua3YVVIWpGvZ1EDK159FA=
=TmNr
-END PGP SIGNATURE-
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-23 Thread Gustavo Pizano
Hello.

Yes kinda.

G.
On Jun 23, 2011, at 6:34 PM, Conrad Shultz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 6/23/11 6:50 AM, Gustavo Adolfo Pizano wrote:
 Helo Ken.
 
 Thanks for answer,
 I meant, I have some title string already, and I wish to be able to
 animate as if its being written at the moment, also I forgot to
 mention that this is for iOS.
 
 Sorry, do you mean that you have an NSString and a handwriting font,
 and you wish to animate the rendering of the string in that font?
 
 - -- 
 Conrad Shultz
 
 Synthetiq Solutions
 www.synthetiqsolutions.com
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (Darwin)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iD8DBQFOA2r9aOlrz5+0JdURAj75AJ9caJFWiklpYPCugSc0DkSyn5/ReACggouj
 F8Ua3YVVIWpGvZ1EDK159FA=
 =TmNr
 -END PGP SIGNATURE-

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-23 Thread Steve Christensen
Is this a correct interpretation of what you're trying to do? You have a title 
string that will be drawn in a handwriting font. You wish to reveal each of the 
letter strokes over time as if someone were actually writing the title on a 
piece of paper.


On Jun 23, 2011, at 9:45 AM, Gustavo Pizano wrote:

 Hello.
 
 Yes kinda.
 
 G.
 On Jun 23, 2011, at 6:34 PM, Conrad Shultz wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 6/23/11 6:50 AM, Gustavo Adolfo Pizano wrote:
 Helo Ken.
 
 Thanks for answer,
 I meant, I have some title string already, and I wish to be able to
 animate as if its being written at the moment, also I forgot to
 mention that this is for iOS.
 
 Sorry, do you mean that you have an NSString and a handwriting font,
 and you wish to animate the rendering of the string in that font?
 
 - -- 
 Conrad Shultz
 
 Synthetiq Solutions
 www.synthetiqsolutions.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Animating handwriting

2011-06-23 Thread Gustavo Pizano
YES.

:D

On Jun 23, 2011, at 7:10 PM, Steve Christensen wrote:

 Is this a correct interpretation of what you're trying to do? You have a 
 title string that will be drawn in a handwriting font. You wish to reveal 
 each of the letter strokes over time as if someone were actually writing the 
 title on a piece of paper.
 
 
 On Jun 23, 2011, at 9:45 AM, Gustavo Pizano wrote:
 
 Hello.
 
 Yes kinda.
 
 G.
 On Jun 23, 2011, at 6:34 PM, Conrad Shultz wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 On 6/23/11 6:50 AM, Gustavo Adolfo Pizano wrote:
 Helo Ken.
 
 Thanks for answer,
 I meant, I have some title string already, and I wish to be able to
 animate as if its being written at the moment, also I forgot to
 mention that this is for iOS.
 
 Sorry, do you mean that you have an NSString and a handwriting font,
 and you wish to animate the rendering of the string in that font?
 
 - -- 
 Conrad Shultz
 
 Synthetiq Solutions
 www.synthetiqsolutions.com
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com