Hello Guest

Author Topic: How is kerning handled when DupeCaps is enabled?  (Read 4822 times)

OnlineCop

  • Newbie
  • *
  • Posts: 11
    • View Profile
How is kerning handled when DupeCaps is enabled?
« on: August 29, 2012, 08:34:41 pm »
If I import a font that contains kerning information and apply the "Dupe Caps" option for the tk2dFont, will the kerning for various "cases" of the characters be applied?

ae
aE
Ae
AE

The id for 'a' is 97, and 'e' is 101. I can set the kerning between those two with the lines:

kerning first=97 second=101 amount=-1

Now, the id for 'E' is 69, so both the 'ae' and 'aE' should be rendering the same glyph, but will the kerning still apply between the letters?  If not, do I have to create its own kerning entry:

kerning first=97 second=69 amount=-1

If this is the case, I have to do a separate kerning for each of these scenarios above:

kerning first=97 second=101 amount=-1
kerning first=97 second=69 amount=-1
kerning first=65 second=101 amount=-1
kerning first=65 second=69 amount=-1

instead of just a single line (I'm not sure if the Dupe Caps uses uppercase glyphs, lowercase glyphs, or chooses based on which one is available -- or picks one if both are available?), which is nearly 4x the amount of test scenarios I'll have to check for when writing the kerning info.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How is kerning handled when DupeCaps is enabled?
« Reply #1 on: August 29, 2012, 10:52:11 pm »
How is kerning handled when DupeCaps is enabled?

Good question. The answer is, it isn't.
Initially, I thought this could be fixed up really easily in the kerning table. While its straightforward to do this, this will obviously make the kerning table 3x larger as it would need to store all 4 permutations.

Isn't the simplest solution just to ToUpper() / ToLower() before you set text? That way, there won't be any incorrect lookups.

OnlineCop

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: How is kerning handled when DupeCaps is enabled?
« Reply #2 on: August 30, 2012, 03:53:37 pm »
ToUpper() or ToLower() is fine to use, if it would just triple the kerning table otherwise. What does Dupe Caps choose to use: uppercase or lowercase?  As in, does it duplicate the capital letters into the space of the lowercase ones, or copy the lowercase ones in place of the capital ones?  Do we want to ToUpper() all of our lowercase text, or do we want to ToLower() all of our uppercase ones?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How is kerning handled when DupeCaps is enabled?
« Reply #3 on: August 30, 2012, 04:07:05 pm »
Duplicate caps will fill the characters which don't exist. So if your font only contains uppercase chars, then the lowercase chars will take their place. If lowercase chars exist, then uppercase fills in there.

So depending on how your font is set-up, use the appropriate thing.