简体   繁体   中英

How can i convert cahracters drawn with draw(rect:) into strings?

在此处输入图像描述 I am working on a project where I need to draw alphabetic characters using draw(rect:) method. Until now I am able to draw these hand-drawn characters but I am unable to export these characters as strings. I tried to get the drawn alphabets using screenshots and OCR but all other algorithms just detect the test and resample the text to redefined shapes whereas, i need to convert the drawn character as it to the string or ".ttf".

If your goal is to have the user draw characters and turn their drawings into a font, you have your work cut out for you.

I suggest you have the user draw one character at a time. Since you know which one they are drawing, you know what character you're getting.

You'd then need to convert their raw gestures into a series of bezier curves. Then you'd need to encode those bezier curves into a glyph in the font you are building.

I've never figured out how to generate Bezier curves from points along the curve, since the middle control points for a Bezier curve don't lie along the curve. I've read that it's possible however.

As to encoding the curves into a glyph in TrueType font format, I got nuttin'. I suggest googling it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM