Unify Kerning

At work, I was tasked with improving the text display of our application in order to better support text kerning. Our application creates images that appear on television, so image quality is of utmost importance. Therefore, even small improvements in the appearance of any result we generate are very useful.

Our current text engine is implemented using Uniscribe, which seems to be the perfect solution. As already mentioned here , it supports ligature substitution in context with complex scenarios. It also processes languages โ€‹โ€‹from right to left and BiDi. This is important as we need to draw Arabic / italic languages โ€‹โ€‹perfectly.

Therefore, it seems very peculiar that Uniscribe does not seem to display information on glyph caching. I have shown a screenshot to demonstrate this problem.

alt text http://www.aliparr.net/kerning.jpg

My application does the same thing as a notepad, in which each character appears "monospaced." Notice how in Photoshop CS2 the bridge at the top of the โ€œTโ€ hangs beautifully over the โ€œeโ€. I want to recreate this.

I know other APIs like Pango / Freetype, but it seems like a pretty tough decision to include all this just to make the final 1% of this task if Uniscribe is so good at everything else.

Am I missing a step using Uniscribe? What is the best solution? Can Freetype export kerning information in an easy way so I can integrate it with my existing Uniscribe solution?

Nb We just need to run on Windows - platform portability, fortunately, is not a problem that I need to worry about right now.

Welcome in advance!

+4
source share
3 answers

You can manually implement kerning using Uniscribe.

I did this by manually creating a const int *piJustify argument const int *piJustify ScriptTextOut .

 // Initially the justification is simply a copy of the advance array int* piJustify = (int *)malloc(pcGlyphs); memcpy(piJustify, piAdvance, pcGlyphs); // Apply kerning to each glyph for (size_t i = 0; i < pcGlyphs; i++) { if (psva[i].fClusterStart) { // Only add kerning to the first glyph in each cluster piJustify[i] += myKerning; } } 

It is assumed that you have already called ScriptItemize, ScriptShape, and ScriptPlace for pcGlyphs , piAdvance and psva .

+1
source

If you are running Windows XP, I believe that you need to enable the following options in the regional settings of the control panel:

  • Install files for complex scripts and languages โ€‹โ€‹from right to left (including Thai).
  • Install files for East Asian languages

for Uniscribe kerning to work.

0
source

By default, ScriptShape / ScriptPlace applies kerning if the selected font supports it. However, if you want to enable / disable it, you must use OpenType Api to uniscribe.

0
source

All Articles