Re: Pango development trouble (Kerning - PLEASE HELP!)



On Sat, 2003-11-15 at 08:42, Trever L. Adams wrote:

> I am having trouble figuring this out.  I am trying to add the much
> needed manual kerning functionality to the Pango library.  The problem
> is that pango_fc_font_kern_glyphs in pangofc-font.c doesn't get the
> Markup attributes from the shaper (basic-fc.c in this case).  I am
> having trouble following this back far enough to figure out how to get
> the data down.
> 
> My best guess so far is that layout calls the shaper.  So, how can I get
> layout to modify a new version of GlyphItem setting the manual kerning
> value inside of it, so that I can access it from pangofc-font.c?

My instinct is that this should be handled at the layout or driver
layers, not at the shaper or backend layers.

To implement justification, the higher layers need to know where 
space can be added in the line. Once we have that information, adding
a manually specified amount of space should be trivial.

The way the that justification needs to work is to add flags to 
PangoGlyphVisAttr indicating the properties of the position before
the glyph; it gets a little complicated because of:

 - You may want a hierarchy where some places are better than 
   others to add space and you add space in those places first.
 - Arabic justification with Kashida

But it's possible that for now we can just add a simple "can add
space here" flag, if we don't have anybody interested in doing the
research to come up with a full solution.

> I have removed the absolute kerning from the patch.  It is not relative
> using em, much like the rise functionality works.  This also simplifies
> my patch tremendously.

I can't quite follow this. 'rise' is in device units, not relative to
the font size, and I'd expect a kerning/tracking adjustment to be the
same way.

[...]

> I am assuming the markup for pango WANTS to follow the XML rules,
> meaning no overlapping tags like <b1>a<b2></b1>b</b2>.  So, for kerning,
> if you do <span kern="100">abc</span> it will modify the kerning between
> all of those... to be simple here.

Markup for Pango is (almost) an XML subset. It certainly follows the
XML nesting rules.

> The question is, since you usually only want to kern specific pairs this
> way, should the <span kern="100>?</span> go around the a in ai or the i
> in ai?

The i. While it doesn't really matter here, if we use a consistent 
principle that properties on the character after applies to the
space before, that allows to set properties on the spaces before
and after the string. (Since PangoAttributes have a range of 
O => MAXINT)
 
 A B C
^ ^ ^ ^ 

While using the character before wouldn't allow setting properties
on that first position.

> So, two questions, how can I get this kerning data (just an integer) to
> be added to every GlyphItem in the Layout functions so that it is
> available in the kerning function way down in?  And 2) How do people
> want this tag to work?
> 
> People, we really need this functionality if we want Pango to be worth
> much.  Yes, it is great as is, but this is needed.

Wow, what hyperbole! :-) Manual kerns are occasionally useful, but
way behind, say, justification and hyphenation in terms of typographic
features that Pango doesn't yet support.

I actually don't think "kerning" is a good name here ... in the computer
world, it usually gets used to refer to binomial kerning tables. 
(kerning pairs)

"tracking" might be a better term to use here, especially since 
you can set it over spans of text ("letter spacing" is another term
that could be used.)

An interesting question is what is the interaction of this with
automatic kerning... does it apply after the automatic kerning
or replace it? If it applies after (which seems easier), do we
need some separate way to suppress the automatic kerning?

Regards,
						Owen





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