Simple Stroke Vector font - very few points

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Simple Stroke Vector font - very few points

Post by heyvern »

I created a menu script that creates vector text with a single shape stroke.

One of my pet peeves with AS was no simple way to create labels and descriptions. Yes, notes layers sort of work but you can't create paragraphs of text with detailed instructions. Also note layers stay the same size when zoomed which doesn't work well for bone labels.

For very simple things I used the Text tool but that creates WAY too many points. I have used images as well but that is a pain making sure the images are included with the file.

What is really needed is a very low weight, low point count, stroke shape only "font" for use with AS.

---------------------
Introducing the...

Simple Stroke Text menu script

http://www.hubumedia.com/anime-studio/s ... ketext.zip

Just drop this in your /scripts/menu/ folder in your AS installation. It should work in Debut if you use it as a button (place in the /scripts/tool/ folder and add the name of the script as a button in the _tool_list.txt file.)

--------------------------

This is a "custom" font I designed myself a long time ago for use with the interface drawing in the GUI of AS. I converted it to draw letter shapes on vector layers.

The font is all peaked points with strokes only to keep the script simple. The font design itself is still a work in progress but the script works well for simple things like labels for bones, descriptions for file use etc.

You can either type in a few words in one line in the menu pop up, or check the "import text" check box and import a a simple text file for longer text that has multiple lines, for descriptions etc.

It creates a single shape for the whole block of text. You can set the size of the text but you can't change the line spacing yet. The shape stroke weight is predetermined but you can always change that later in the style plalette.

I have all the alphanumeric characters, and some punctuation. Not done with punctuation because I have to convert "dots" into "vectors". The GUI interface allows for putting a "dot" in a location, but obviously that won't work for vector layers. I converted the "." to a vector but still tweaking.

It's tricky designing the font. It's based on a "grid" that is "10 x 6" with units based on "1". I draw the fonts with the grid turned on over a numbered grid. I then transfer the point locations to the menu script for every single freaking character of the font.

-----------------

In the future it will also have the ability to draw BONE SHAPES on a vector layer. It will draw a vector bone shape for every bone or selected bones in a parent bone layer.

I like to use this so I turn off path display and still see where the bones are to select them and move them.

Anyway, I know this will be HUGELY useful for my use and I hope others find it useful.

-vern
Last edited by heyvern on Sun Jul 08, 2012 3:33 am, edited 1 time in total.
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Post by Víctor Paredes »

thank you, vern, great button for labels and tutorials. I'm very sure it will be a big friend of vector traced bones to create explanatory videos.
Nice to have you back, by the way :)
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Post by heyvern »

Here's a rendered sample at different stroke "weights" of the stroke font:

Image
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Simple Stroke Vector font - very few points

Post by synthsin75 »

heyvern wrote:This is a "custom" font I designed myself a long time ago for use with the interface drawing in the GUI of AS. I converted it to draw letter shapes on vector layers.
Vern, would you be willing to share the GUI drawn version of this? Would save me from reinventing the wheel. Thanks.
User avatar
heyvern
Posts: 7035
Joined: Fri Sep 02, 2005 4:49 am

Re: Simple Stroke Vector font - very few points

Post by heyvern »

synthsin75 wrote:
heyvern wrote:This is a "custom" font I designed myself a long time ago for use with the interface drawing in the GUI of AS. I converted it to draw letter shapes on vector layers.
Vern, would you be willing to share the GUI drawn version of this? Would save me from reinventing the wheel. Thanks.
I will see if I can track it down. It's been awhile. I did it for a bone grouping script. It's probably on a back up CD by now. ;)

The lua tables for each letter used in both versions is practically identical. Just the "mechanics" of "connecting the dots" changed.
The GUI version is drawn almost the same way but uses the GUI draw method which is slightly different than connecting vectors as I recall.
If you know how to draw with the GUI it's the same method of "connecting" points, using the gfx:DrawLine, gfx:AddLine. It's been ages since I used those functions in scripting. I barely remember how it's done. ;)

The letter definitions in the script have each letter array using a 6 x 10 grid with the top left corner -6, 10 and the bottom right corner 0, 0 (don't ask me why it's like that. I didn't have the patience to redo all the letters with a more logical grid). I also included a custom "kerning" value for each letter in the letter array so it "looks nice" (this is not a "monospaced" font).

Text is read in and each letter is stored as point group tables in a larger table. Then the table is iterated and the letters stitched together using the same looping function.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Simple Stroke Vector font - very few points

Post by synthsin75 »

Ah, I found it: viewtopic.php?f=12&t=22797

Thanks, Vern.
Post Reply