From 5e1fd7a1ee767b6c8e0d7461b1044d93a42989a2 Mon Sep 17 00:00:00 2001 From: ElOraiby Date: Sat, 30 May 2015 14:11:16 -0400 Subject: generalize the lam-alef case --- mainwindow.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'mainwindow.cpp') diff --git a/mainwindow.cpp b/mainwindow.cpp index ea3a91f..60d9d51 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -97,17 +97,30 @@ MainWindow::MainWindow(QWidget *parent) : FT_Render_Mode render_flags = FT_RENDER_MODE_NORMAL; - data__ = new uchar[1024 * 256 * 4]; - memset(data__, 0, 1024 * 256 * 4); + data__ = new uchar[1024 * 1024 * 4]; + memset(data__, 0, 1024 * 1024 * 4); int col = 1024 - 1; int line = 100; - QImage img(data__, 1024, 256, QImage::Format_RGB32); + QImage img(data__, 1024, 1024, QImage::Format_RGB32); // render the arabic glyphs for( size_t idx = 0; idx < arabic_cp.size(); ++idx ) { uint ch = get_arabic_form(arabic_cp, idx); - if( ch == 0xA || ch == 0xC ) + if( ch == 0xA ) { + line += 30; + col = 1024 - 1; continue; + } + + if ( ch == 0xC ) { + continue; + } + + if ( ch == -1 ) { + continue; + } + + assert(ch != 0); int glyph_index = FT_Get_Char_Index(face, ch); assert( glyph_index && "invalid character" ); -- cgit v1.2.3