| |
...
This blog has no purpose
...
David Scott
dave@recoil.org
| August 2005 |
| Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
| |
1 |
2 |
3 |
4 |
5 |
6 |
| 7 |
8 |
9 |
10 |
11 |
12 |
13 |
| 14 |
15 |
16 |
17 |
18 |
19 |
20 |
| 21 |
22 |
23 |
24 |
25 |
26 |
27 |
| 28 |
29 |
30 |
31 |
|
|
|
RSS Feed
Subscribe to an RSS feed.
Affiliations
Other blogs

Except where otherwise noted, this blog is licensed under a Creative Commons License.
|
|
|
Camlimages, freetype and kerning
I decided to revamp the font rendering code used by my OpenGL apps. The font support (originally written by Anil) predates (I think) the time when
camlimages
had bindings for the
freetype
library. Now that the bindings exist it makes sense to me to take advantage of them. Anyway, I threw together a simple bit of code to extract font outlines (a mix of linear, quadratic and cubic curves) and perform adaptive subdivision
to convert the quadratic and cubic curves to straight-line segments. This was a fairly straight-forward implementation of
de Casteljau's algorithm
with a slightly hacky "flatness criterion" for the time-being (some notes on this topic can be found
here).
Once the basics were working I noticed that the camlimages/freetype binding seems to lack an API to extract kerning information
(definition of kerning from wikipedia). So I added that and it seems to work! Check out these two pictures:
The topmost picture is without kerning enabled and the bottommost one has kerning enabled. Check out the relative distance between the "A" and the "V". Now to work on
ligatures...
[/misc]
permanent link
|
|