DRAWING

Detect a character outlines

Here is one approach if you have Adobe Illustrator. You could type your letters in an Illustrator document and then use the Convert To Outline command to turn the type into a vector drawing. Save the file and open it in a word processor. The drawing commands to create the letters should be easy to find near the end of the document. It is easy to figure out what the format for the commands are. As for the bezier curved lines, I have some code that can read them and turn them into a series of straight line segments that follow the curve. Let me know if you want it.

Joe Lertola

Here is what I would do. Make the letter black, and the background white (or vice versa).
From a couple of lines above where the letter starts, go pixel by pixel calling GETCPIXEL, and compare the values you get to black and white, whereever you get a "hit" for a black color, the starting point XY gets stored. When you get a white again, store that one, next black, store that one, all on across that row of pixels.
Depending on the resolution you want, skip every other line on down, or do every 4th line.
You can always do fewer lines, then interpolate to get more points. This will give you a rough to fine trace of your letter depending on how many rows you sample.
From a couple of lines above where the letter starts, go pixel by pixel calling GETCPIXEL, and compare the values you get to black and white, whereever you get a "hit" for a black color, the starting point XY gets stored. When you get a white again, store that one, next black, store that one, all on across that row of pixels.
Depending on the resolution you want, skip every other line on down, or do every 4th line.
You can always do fewer lines, then interpolate later to get more points. This will give you a rough to fine trace of your letter depending on how many rows you sample. You still may wish to sample all the points even if you don't store them to grab special case x/y's like the apex of the split in a "Y" for example, or a sharp V's bottom
Pseudocode ' so pseu me, this won't work as written

'say a 200x200 pixel pict, every line checked
DIM RGB.6
DIM x 'need an array I imagine, I am not good at those
DIM y 'arrays of Titans <g>
_black=0
END GLOBALS
CLEAR LOCAL
LOCAL FN WhatBeDaColor,Man(j,k)
LONG IF RGB=_black
j=x.j
k=y.k
END IF
END FN
CLEAR LOCAL
LOCAL FN GetDemPoints
FOR k=0 to 199 ' first row down, then the next
FOR j=0 to 199 ' first row across, then the next
CALL GETCPIXEL(j,k,RGB) 'maybe the other way around
FN WhatBeDaColor,Man(j,k)
next j ' next pixel across
next k ' next row down
END FN
'==Main
FN GetDemPoints

Robert Covington

Record the character into a region. Then duplicate the region, expand the copy region by 1 pixel, and XOR them.

David Blache

You've gotten several good suggestions, but here's one more, assuming you want individual pixels rather than bezier points:
Start from the middle of the left edge and search to the right until you find a black pixel. Record it as your starting point. Now, starting after the last white pixel you found, search the adjacent pixels in a circular pattern for a transition to black. That is your next point, and the center of your next circular search. Just be sure to begin your circle with (or after) the last known white pixel, and always use the same direction circle. This loop continues until you return to the starting point. I think this would be potentially much faster and more efficient than checking every pixel, but it assumes you do in fact want only the outside edge. It would not find interior whites without another algorithm to locate them (then it could trace them).
Sounds like so much fun, I'm tempted to try it myself. Alas, too many other irons.

Jay

A: can see lots of ways to draw to b****er, but getting the points is the hard bit ;-)
However something comes to mind: all drawing apps have a function that transforms a glyph to a bezier outline, can you work with beziers?
Otherwise for a Q&D, howabout, drawing your letter in a B/W offscreen gWorld, using an edge detection algorythm to get the edge in other B/W gWorld, then using GETPIXEL to get the X,Y points.
For a Q&D edge detection, howabout scanning the image by a square of 4 pixels, if they're the same colour do nothing in the second GWorld if at least 1 is different then just put in a pixel. You can then rescan the second GWorld and reduce the globs of pixels.

jonathan

I don't know what your final goal is here, but would it help if you just set the _outlineBit flag when you drew your big letters? For example:

WINDOW 1
TEXT _courier, 60, _outlineBit%
CLS
PRINT "Hello"

Rick

Methinks that your post is re: your stitching machines and info re: working in Fontographer and then coming to FB isn't gonna help as you want to distribute the app without bundling Fontographer (?).
You probably want to give your users the possibility to type in text and then stitch it...
An idea hit me, and once I recovered...
Someone must have one of those routines for creating ASCII art somewhere!
Then you draw the char in the offscreen GWorld, then parse it thru an ASCII art converter, but with just one letter set -'x', and then - depending on what and how you want to embroider - either clear out the letters inside the art or not.
Would this work?