DynaPDF Manual - Page 609
Previous Page 608 Index Next Page 610
Function Reference
Page 609 of 839
// record can differ, e.g. if a source character is
// decomposed to two or more Unicode characters. In this
// case, the function fntTranslateString2() can be used
// to translate the sub string to Unicode because we
// don't know where we are in the already existing
// Unicode string.
/*AddText(x1, y1,
// Start point
x2, y2,
// End point
Source[i],
// Source record
Kerning[i], // Translated Unicode record
last,
// String offset
j - last);
// String length
*/
}
last = j++;
// Skip additional spaces
while (j < Source[i].Length && Source[i].Text[j] == 32)
{
++j;
}
textWidth += fntGetTextWidth( m_GState.ActiveFont,
Source[i].Text + last,
j - last,
m_GState.CharSpacing,
m_GState.WordSpacing,
m_GState.TextScale);
last = j;
x1 = textWidth;
y1 = 0.0;
// Update the cursor position.
// We are now behind the space(s).
Transform(m_Matrix1, x1, y1);
}
}
// All spaces in the string were processed. Do we have some
// remaining text?
if (j > last)
{
textWidth += fntGetTextWidth( m_GState.ActiveFont,
Source[i].Text + last,
j - last,
m_GState.CharSpacing,
m_GState.WordSpacing,
m_GState.TextScale);
x2 = textWidth;
y2 = 0.0;
Transform(m, x2, y2);
/*AddText(x1, y1,
x2, y2,
Previous topic: Character Spacing, Word Spacing
Next topic: Text Scaling, Sub string coordinates