Stephan Bergmann wrote:
> 
> Philipp Lohmann wrote:
>> 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).
> 
> So a better approach would be to use one of the conversion functions 
> from rtl::OUString to RTL_TEXTENCODING_UTF8 rtl::OString 
> (rtl::OUStringToOString, rtl::OUString::convertToString) and use the 
> resulting rtl::OString's data in the call to pango_layout_set_text.
> 
> -Stephan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


Thanks Stephan and Phil for your valuable inputs.Yes with the new API it
seems to be rendering the lines which previously were being rendered as
'?'.However the bullets in the text are still being rendered as ? and if the
text contains some spaces marked by "grey areas" still render as  '?' as i
had mentioned earlier. Any ideas on it?
Thanks again guys for ur suggestions!! :)

Regards,
Karl
-- 
View this message in context: 
http://www.nabble.com/Getting-warning--Pango-WARNING-**%3A-Invalid-UTF-8-string-passed-to-pango_layout_set_text%28%29--tp17643055p17649898.html
Sent from the openoffice - dev mailing list archive at Nabble.com.


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

Reply via email to