Digital Glyph Representation and Rendering


This was from a module called ‘Personal Inquiry’, where we had to research a topic which is of interest to us. I chose ‘Digital Glyph Representation and Rendering’ as font rendering (which is a part of it) has always interested me.

The video above is a simple implementation of two glyph rendering techniques from the following papers:

Resolution independent curve rendering using programmable graphics hardware. (Loop and Blinn 2005)

Resolution Independent NURBS curves rendering using programmable graphics pipeline. (Santina 2011)

The program is written with C++ and OpenGL (using NGL lib). It reads spline info from a file and then converts the control points of each quadratic spline to triangles which are passed to the GPU. Custom shaders then evaluate the implicit functions of the quadratic bezier and the quadratic NURBS curves.

Here is the report I wrote for this module, where you can read of my research in greater detail. Since the report was not assessed itself it could contain factual mistakes so please don’t take it as an authoritative source, and if you do happen to notice anything wrong, please let me know I will be happy to fix it. Digital Glyph Representation and Rendering Report


Tags: , , , , , ,

6 responses to “Digital Glyph Representation and Rendering”

  1. Amir says :

    Hi. I want programming a font creator. a big job is converting handwriting (in bmp, jpg, …) to line and bezier. My question is: can represented papers algorithms doing this? I can detecting edge of a handwrited as a region but i can not extracting line and bezier from this region. another question: can i impelment this algorithm with C# and emgu Cv?
    thank you for reply.

    • grassovsky says :

      Hi, so the short answer is, Yes.
      What you want is to implement a technique which traces a raster (bitmap) and creates a vector representation of it (some keywords to look out for: ‘raster tracing’, ‘thinning’, ‘filling’, ‘node detecting’, ‘skeletonizing’, those are some, related classical techniques).
      Here are some ideas: ‘strabo’ – used for road maps, another map ‘thinning’ apprach, A signed-distance field (SDF) approach by Valve (not exactly following the paper, you could get the SDF of a raster image and construct a vector from the SDF – quite innovative), I personally am interested and would recommend looking into the last, however if you find it easier to begin with one of the other techniques (you might find more information), then go ahead. (Those are not the only ones, so make sure you do full research before stopping on a concrete one.)
      I am afraid I cannot offer you any more practical help on ‘raster to vector conversion’ as I haven’t done it myself.
      Once you have some sort of vector representation… then you might find some of my research in this field useful,… when it comes to the actual rendering of the vector… Quadratic/Cubic Beziers ~ Loop and Blinn 2005, Quadratic/Cubic NURBS ~ Santina 2011, Circular Arc Splines ~ GLyphy 2014
      As for doing your project in C# and Emgu Cv, I also cannot offer my opinion as I haven’t used them really, so I would say, it shouldn’t be a problem, but make sure you check with someone else too, who has used them for a similar purpose.

  2. grassovsky says :

    I see, well yes, as i said earlier, your project basically consists of 2 parts (or 2 smaller projects really):

    1.) Contouring a Raster and extracting a set of curves and lines (raster to vector)

    2.) Using the data to render vector fonts

    This is perfectly fine, in fact, you will learn a lot by doing them from scratch, so I will encourage that.
    However it is probably also a good idea to take a look at some of the standard font types eg., TrueType, Type1, OpenType, FreeType, as they basically offer what you are trying to create in project (1.)… as they have a set of splines and lines (stored differently for each of them), and then you can proceed with the next stage (2.).

    But doing both sounds very robust, as you would be able to take an arbitrary hand-written scan and convert it into vector art, rendering it as text, which sounds great! So do let me know how it is going and what you have come up with!

    • Amir says :

      thoanks for attention. Last (!) question: the points in your second part fo video(a shape like “c”), are you importing the points and application triangulated them OR you only drawing the shape and application triangulated the shape and returned critical points.
      Because i can find a very large number of point in shape’s edge and i can drawing a redrawing a same shape but it is not good idea, if i can find only the critical point (approximation), it resolved!
      With my current knowledge(!) other big job is smoothing the shape.

      • grassovsky says :

        Yes, I import the points from a regular text file as vectors eg.:
        Point 0.0 0.0 (for 2D)
        I have a simple parser which reads the file which I have created manually (so i chose where the points should be), the parser reads each 3 points and additional information like “type of spline” (Bezier or NURBS), “drawing type” (convex, convave or filled) and “weights” (only valid for NURBS)…
        Then I pass each 3 points as a triangle to the GPU and pass in all the relevant data, as parameters (weights, draw type,…etc) the rest is done in the shaders.

        As I said, there is a whole smaller project that you are undertaking before that, namely to generate those points using a drawing… (extracting them from a raster)… separate the 2 projects and tackle them one at a time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: