mmkw43
Posts: 539
Joined: Tue Dec 24, 2013 6:18 pm

True type shapes ?

Mon Dec 25, 2017 2:52 pm

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

User avatar
scruss
Posts: 1603
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: True type shapes ?

Mon Dec 25, 2017 3:47 pm

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.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

mmkw43
Posts: 539
Joined: Tue Dec 24, 2013 6:18 pm

Re: True type shapes ?

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.

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?

User avatar
Paeryn
Posts: 1855
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: True type shapes ?

Wed Dec 27, 2017 12:11 am

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.
She who travels light — forgot something.

User avatar
scruss
Posts: 1603
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: True type shapes ?

Wed Dec 27, 2017 11:44 am

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
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

mmkw43
Posts: 539
Joined: Tue Dec 24, 2013 6:18 pm

Re: True type shapes ?

Wed Dec 27, 2017 2:50 pm

Thanks guys -- appreciate the help.

mmkw43
Posts: 539
Joined: Tue Dec 24, 2013 6:18 pm

Re: True type shapes ?

Wed Dec 27, 2017 2:54 pm

I like those simple spinner ideas --- never thought about using a slash or something and then just
repositioning my Tkinter label in my loop.

mmkw43
Posts: 539
Joined: Tue Dec 24, 2013 6:18 pm

Re: True type shapes ?

Wed Dec 27, 2017 2:59 pm

Heck, I like the ascii "inflate" -- I'll just make a bold O and change the text size ! Love it.

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 0 guests