Stephan Bergmann wrote:
[EMAIL PROTECTED] wrote:
Hi,
Am Working on porting OpenOffice onto DirectFB.Have completed the
implementation of most of the major functionality.
But facing some issues relating document font rendering.
Am getting the warning Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text() for
a regular document text

Have used pango to render the font and implemented a PangoFontLayout class
deriving from SalLayout in unx under vcl.
Following is the code to implement the UTF-16 to UTF-8 conversion where i
have found out the problem is arising.
  m_pLayoutText = new ByteString( rArgs.mpStr, rArgs.mnLength);
m_pLayoutText->Convert( RTL_TEXTENCODING_UNICODE, RTL_TEXTENCODING_UTF8 );
  pango_layout_set_text( m_pPangoLayout, m_pLayoutText->GetBuffer(),
rArgs.mnLength );

What is rArgs in your code snippet? A (class instance wrapping a) char[] that contains UTF-16 (-LE or -BE?) data? What strikes me as odd is that you use rArgs.mnLength in the final call, instead of m_pLayoutText->GetLength().

That's ImplLayoutArgs, a helper class in vcl's SalLayout interface which is for text output. The contained string is not necessarily output as a whole but only part of it (e.g. a word out of a paragraph by writer). The contained characters are xub_Unicode (which is effectively sal_Unicode).

Kind regards, pl


--
If you give someone a program, you will frustrate them for a day;
if you teach them how to program, you will frustrate them for a lifetime.
     -- Author unknown

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to