Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /is/htdocs/wp10582507_LGPWONUTVE/www/wp-includes/wp-db.php on line 1038
July 17, 2013 - Max Did It
Max Did It
Post the First Comment

Polygon Outlines With Uniform Inset

I want users of my hardware text rendering library firetype to be able to render characters with outlines.

Sounds simple enough, right? Adding an outline to text is a matter of setting a simple value in all major graphic softwares. Since firetype is able to retrieve the shapes of characters from font files, it should not be a problem to add an offset to these and render the result.

Turns out that adding an outline to a simple polygon is not as straightforward as you might think. In fact, to have a robust method of creating polygon outlines means to implement a relatively complex algorithm that encompasses several steps.

Even seemingly minor details like how far each vertex has to be moved to create the outline can create problems. The solution, however, is pleasently elegant, as you will see below. I will cover the other aspects of the outline algorithm in the next posts.


  • RSS Feeds

    Notice: Undefined variable: output in /is/htdocs/wp10582507_LGPWONUTVE/www/wp-content/plugins/category-rss-widget-menu/rss.php on line 127

    Notice: Undefined variable: output in /is/htdocs/wp10582507_LGPWONUTVE/www/wp-content/plugins/category-rss-widget-menu/rss.php on line 90