freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Synthetic styling and stroking APIs


From: David Turner
Subject: [Devel] Synthetic styling and stroking APIs
Date: Tue, 02 Jul 2002 00:20:22 +0200

Hello,

  I've just commited two rather important change to the
  CVS repository. Both are still highly experimental but
  should work in a relatively short time..

  First of all, the automatic emboldening code in "ftsynth.h"
  (a.k.a. FT_SYNTHESIS_H) has been completely rewritten. The
  APIs in there have changed and are called FT_GlyphSlot_Oblique
  and FT_GlyphSlot_Embolden, you should only call them with 
  a glyph slot containing a scaled and hinted glyph outline
  for now (more bit-flags magic will occur soon to allow other
  uses)


  Second, I've added a new optional component named FT_STROKER_H
  (ftstroker.h), whose purpose is to be able to "stroke" glyph
  outlines. This should allow effects like artificial emboldening,
  slimming as well as "colored bordering" or "stroking/outlining".
  It will also let FreeType render the Type 1 Hershey fonts correctly,
  by the way.

  This is a rewrite of some old but very working code I authored
  a few years ago. The API should let you stroke FT_Outline paths,
  or even your own ones.. Note that this optional component has been
  designed very carefully to be both efficient and accurate. Among
  other things:

   * it is capable of stroking bezier arcs directly (instead of
     decomposing them into numerous line segments and stroking
     these). This makes it a lot faster than many alternate
     implementations I've seen

   * it is free from any numerical instabilities by avoiding the
     computation of intersections, and using angle arithmetic
     instead (with the help of the high-speed fixed-point functions
     contained in FT_TRIGONOMETRY_H, now you know why this component
     was included a long time ago :-)

  Finally, I don't plan to support dashing, since this would require
  another 10Kb of code to perform correct path length measurement
  and decomposition..


  This code is not finished, but you can start examining it, and
  even try it at your own risks. What I'd like to collect however is
  some opinion to the best API they could provide. I would like
  something that is both straightforward to understand and
  sufficiently powerful for common uses, which is why I'm asking
  for input...

Regards,

- David Turner
- The FreeType Project  (www.freetype.org)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]