Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 553

Previous Page 552   Index   Next Page 554

Function Reference
Page 553 of 770
Transform(m, x2, y2);
// We have now the exact start and end coordinate of the
// text's baseline. The text could now be written to a
// file or added to a list of text records depending on
// how the algorithm processes text. Note that the
// string length in the source and Unicode (Kerning)
// 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);
 

Previous topic: Character Spacing, Word Spacing

Next topic: Text Scaling, Sub string coordinates