Page 1 of 1

True type shapes ?

Posted: Mon Dec 25, 2017 2:52 pm
by mmkw43
Another question I have is I know a lot of graphics symbols shapes etc can be made into a true type font. has anyone seen a link for getting some basic graphic shapes (like dots, squares, etc) in ttf format? -- thanks

Re: True type shapes ?

Posted: Mon Dec 25, 2017 3:47 pm
by scruss
TTF files are collections of shapes with some quite stiff limitations:
  • they must be filled shapes defined by outlines - no single strokes allowed
  • they fit into square boxes of side 1024, 2048, 4096, ... points with no negative coordinates
  • coordinates should be integers
  • curves are defined by quadratic splines
  • points at the extrema of shapes need to be defined (this may already be handled by the quadratic spline limitation)
Personally, I've used FontForge - https://fontforge.github.io/ - along with its Python library to generate arbitrary shapes in the forms of characters, but it's got a very steep learning curve.

What kind of shapes are you wanting to create? I've got a Fontforge script somewhere that will take a folder full of suitably-named SVG files and make a font from them.

Re: True type shapes ?

Posted: Tue Dec 26, 2017 3:46 pm
by mmkw43
Well it would make my life easier if I could find a simple "dot" (solid circle) that I could just substitute in a label that now has some text in it.

Just something small that will display on and off showing the "heartbeat" of the program. A spinner would be nice but the ttf font would be a cinch.

I ask because I remember some years ago I had a a logo converted to a ttf font (for a fee). If only the letter O wasn't a donut?

Re: True type shapes ?

Posted: Wed Dec 27, 2017 12:11 am
by Paeryn
For a simple filled circle you should be able to use the bullet character which is unicode 0x2022, most modern fonts include quite a lot of symbols. On a quick look at DejaVu Sans, unicode characters 0x25cb to 0x25d5 are all circles with various fills and there are some squares a few characters earlier.

Re: True type shapes ?

Posted: Wed Dec 27, 2017 11:44 am
by scruss
mmkw43 wrote:
Tue Dec 26, 2017 3:46 pm
Well it would make my life easier if I could find a simple "dot" (solid circle) that I could just substitute in a label that now has some text in it.
Unicode has lots:

Code: Select all

2022	•	BULLET
2219	∙	BULLET OPERATOR
2E33	⸳	RAISED DOT
25CF	●	BLACK CIRCLE
26AB	⚫	MEDIUM BLACK CIRCLE
2B24	⬤	BLACK LARGE CIRCLE
1F784	🞄	BLACK SLIGHTLY SMALL CIRCLE
You can install Character Map (it's a Gnome thing) to find 'em, or enable your Compose key and type Compose + ^ + . to get either bullet or raised dot

Just something small that will display on and off showing the "heartbeat" of the program. A spinner would be nice but the ttf font would be a cinch.
ISTR Motif having a spinner widget, but you could use the U+26AA/U+26AB pair (⚪/⚫). There are also some very silly ideas at https://github.com/swelljoe/spinner

Re: True type shapes ?

Posted: Wed Dec 27, 2017 2:50 pm
by mmkw43
Thanks guys -- appreciate the help.

Re: True type shapes ?

Posted: Wed Dec 27, 2017 2:54 pm
by mmkw43
I like those simple spinner ideas --- never thought about using a slash or something and then just
repositioning my Tkinter label in my loop.

Re: True type shapes ?

Posted: Wed Dec 27, 2017 2:59 pm
by mmkw43
Heck, I like the ascii "inflate" -- I'll just make a bold O and change the text size ! Love it.