Sinhala support - Sri Lanka
Hi,
I am working on a project at the moment which has the requirement to be localised into Sinhala.
We are working with AS3, CS5 and the TLF, the text is being loaded in XML format. We are using the font Iskoola Pota.
I have a sample piece of text in xml, I load it in and set the text property of a Textfield instance to the loaded text. The Zero-Width-Joiners (ZWJ) are NOT removed and the glyphs combine correctly (as per the XML), however the line breaks (Text Field wraps the text) in the middle of a word where ZWJ/ZWNJ are present. The wrapping is what I expect to see as I am purley setting the text property of a clasic text field.
When I use TLF to create TextLine instances and add them to my container, the text breaks correctly - i.e. not in the middle of the word - however the ZWJs are removed causing the letters to be displayed individually (not joined).
This is the AS I am using for reference:
// create a line starting at the previous line (null, as non existant) and breaking at the width
var textLine:TextLine = textBlock.createTextLine(null, lineWidth);
while (textLine)
{
// position the x
if (align == TextFormatAlign.CENTER) {
// place this x at x location of the orig textfield + half its width minus half the textWidth of the new line
textLine.x = (xPos + (lineWidth / 2)) - (textLine.textWidth / 2);
} else if (align == TextFormatAlign.LEFT) {
// place this x at x location of the orig textfield
textLine.x = xPos;
} else {
// place this x at x location of the orig textfield + its width minus the textWidth of the new line
textLine.x = (xPos + lineWidth) - textLine.textWidth;
}
// add the height of the text
yPos += textLine.height;
// if not the first line, add some space down
if (textLine.previousLine != null) {
yPos += iVerticalLineSpacer;
} else {
//add 12%
// TODO - need to come up with a better solution here
yPos += textLine.height * 0.12;
}
// position the y
textLine.y = yPos;
// add to sprite
container.addChild(textLine);
// create a line starting at the previous line (textLine) and breaking at the width
textLine = textBlock.createTextLine(textLine, lineWidth);
}
Does anyone have any insight into how to go about solving this issue?
Thanks for your time,
Dave
