freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Composite Glyph rendering


From: Brian Stell
Subject: Re: [Freetype] Composite Glyph rendering
Date: Sat, 30 Mar 2002 09:48:19 -0800

David,

Thank you for your help so far!

If it is okay I'd like to ask a few more questions.

In the following code I see the comment "/* pp1 = xMin - lsb */".
Does this indicate that the start of a simple glyph should be 
offset by this amount?

http://cvs.freetype.org/cgi-bin/viewcvs.cgi/freetype2/src/truetype/ttgload.c

  TT_Process_Simple_Glyph(...)
  {
      ...
    /* add shadow points */
    /* Now add the two shadow points at n and n + 1.    */
    /* We need the left side bearing and advance width. */
    {
      ...
      /* pp1 = xMin - lsb */
      pp1    = outline->points + n_points;
      pp1->x = load->bbox.xMin - load->left_bearing;

In Ghostscript I see a similar but different "lsb - xMin"

http://cvs.ghostscript.com/cgi-bin/viewcvs.cgi/gs/src/gstype42.c?rev=1.17&content-type=text/vnd.viewcvs-markup

  /*
   * The TrueType documentation gives no clue as to how the lsb
   * should affect placement of the outline.  Our best guess is
   * that the outline should be translated by lsb - xMin.
   */
  gs_point_transform2fixed(pmat, sbw[0] - S16(glyph + 2) * factor,
                           0.0, &pt);

Both appear to work. Is there any TrueType spec or documentation 
on this?

> > there is a bit flag named "USE_MY_METRICS" that can be set in the
> > flags of any sub-glyph. When it is set, the composite glyphs should
> > use the lsb and advance metrics of the sub-glyph instead of the ones
> > stored in the "hmtx" table..

Does this apply the the whole glyph or just the sub glyph?

> > > FreeType2 seems to render properly but in Ghostscript the sub glyphs
> > > end up on top of each other. When Ghostscript positions the sub
> > > glyph it offsets the subglyph X pos minus xMin.

This is the display issue I have with Ghostscript. Ghostscript 
basically shares the same code for simple and sub-glyphs and 
applies the lsb/xmin offset to the sub-glyphs. FreeType2 code 
seems to have different code paths for sub-glyphs from simple 
glyphs. I am still studying this. 

Would it be convenient for you to give me a brief description 
of the main difference between the 2 code paths in FreeType2? 

Is it just that the simple glyph gets all the control points in
one call and the composite needs to build up the control points
in a series of calls?

Thanks

Brian



reply via email to

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