Re: [dev] Getting warning [Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()]
Hi m...@2008, Am in a need of Openoffice that runs onto DirectFB. Please can you provide some inputs on the port that you have done. Like what is the memory footprint and what all features does it support. I would really like to know more about your work on this openoffice port. Regards, PKapoor -- View this message in context: http://old.nabble.com/Getting-warning--Pango-WARNING-**%3A-Invalid-UTF-8-string-passed-to-pango_layout_set_text%28%29--tp17643055p29602275.html Sent from the openoffice - dev mailing list archive at Nabble.com. - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
Re: [dev] Getting warning [Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()]
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]
Re: [dev] Getting warning [Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()]
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]
Re: [dev] Getting warning [Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()]
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]
Re: [dev] Getting warning [Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()]
[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(). -Stephan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Getting warning [Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()]
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 ); For a simple line text properly formatted there is no problem. But Have noticed significant corruption in rendered text when 1)multiple tabs are present infont of a line in the sample doc. 2)Extra spaces are present in the original doc. 3)A space in the form of a "grey area" is present in the original doc. ...and many more instances not found yet. A removal of the above spaces and tabs removes the warning and the document is rendered cleanly without corruption. Any ideas on the same will be greatle appreciated. :) 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--tp17643055p17643055.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]