Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Introduced - special effects in Debug mode to help tracking down issu…

…es with shapers
  • Loading branch information...
commit 8ad6dbacc9cf0bd94c7407721714273ac33b068a 1 parent 8fac29d
Pierre Marchand authored
View
17 CMakeLists.txt
@@ -84,10 +84,10 @@ ENDIF(WANT_M17N)
#>> m17n
-SET(HARFBUZZ_DIR harfbuzz/src)
- ADD_SUBDIRECTORY(${HARFBUZZ_DIR})
- MESSAGE(STATUS "Adding "${CMAKE_SOURCE_DIR}/${HARFBUZZ_DIR})
-SET(HARFBUZZ_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${HARFBUZZ_DIR})
+# SET(HARFBUZZ_DIR harfbuzz/src)
+# ADD_SUBDIRECTORY(${HARFBUZZ_DIR})
+# MESSAGE(STATUS "Adding "${CMAKE_SOURCE_DIR}/${HARFBUZZ_DIR})
+# SET(HARFBUZZ_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${HARFBUZZ_DIR})
# I can’t remember what it does :|
@@ -96,8 +96,9 @@ ADD_DEFINITIONS( -DHIGH_PERF )
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
MESSAGE(STATUS "Debug build")
+ ADD_DEFINITIONS(-DBUILD_TYPE_DEBUG)
ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug")
- ADD_DEFINITIONS(-DQT_NO_DEBUG_OUTPUT )
+ ADD_DEFINITIONS(-DQT_NO_DEBUG_OUTPUT)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
# A lot from Scribus
@@ -130,6 +131,12 @@ IF(QT_QTOPENGL_FOUND)
ADD_DEFINITIONS(-DHAVE_QTOPENGL )
ENDIF(QT_QTOPENGL_FOUND)
+SET(HARFBUZZ_DIR harfbuzz/src)
+ ADD_SUBDIRECTORY(${HARFBUZZ_DIR})
+ MESSAGE(STATUS "Adding "${CMAKE_SOURCE_DIR}/${HARFBUZZ_DIR})
+SET(HARFBUZZ_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${HARFBUZZ_DIR})
+
+
#<< FreeType2
# We give a try to the built-in cmake Freetype.cmake
FIND_PACKAGE(Freetype REQUIRED)
View
3  harfbuzz/src/harfbuzz-indic.cpp
@@ -1128,8 +1128,9 @@ static const HB_OpenTypeFeature indic_features[] = {
};
#endif
-// #define INDIC_DEBUG
+#define INDIC_DEBUG
#ifdef INDIC_DEBUG
+#include <QDebug>
#define IDEBUG qDebug
#else
#define IDEBUG if(0) printf
View
10 src/fmlayout.cpp
@@ -16,6 +16,8 @@
#include "typotek.h"
#include "textprogression.h"
+#include <cstdlib>
+
#include <QDialog>
#include <QGridLayout>
#include <QString>
@@ -866,6 +868,14 @@ void FMLayout::doDraw()
/**********************************************/
glyphList << glyph;
theScene->addItem ( glyph );
+ glyph->setPen(Qt::NoPen);
+#ifdef BUILD_TYPE_DEBUG
+ // visual debug
+ QColor dbgColor( i * 255 / refGlyph.count() , i * 255 / refGlyph.count() , 0, 125);
+ glyph->setBrush(dbgColor);
+ if(refGlyph[i].lChar == 32) glyph->setBrush(Qt::blue);
+ //end visual debug
+#endif
glyph->setPos ( pen.x() + ( refGlyph[i].xoffset ),
pen.y() + ( refGlyph[i].yoffset ) );
glyph->setZValue ( 100.0 );
View
3  src/fmshaper.cpp
@@ -210,9 +210,10 @@ QList< RenderedGlyph > FMShaper::doShape(QString string, bool ltr)
// dbgS += "["+ QString::number(gIndex)+ " ; " + QString::number(gl.log)+ " ; " +( (gl.log > 32) ? QString(QChar(gl.log)) : "--")+"] ";
// dbgS += QChar(gl.log);
// dbgS += "[" + QString::number(gl.lChar) + "]";
+ dbgS += "["+QString::number(gIndex)+ ";" +QString::number(gl.log)+"]";
}
// qDebug() << "EndOf FMShaper::doShape("<<string<<","<<ltr<<")";
-// qDebug() <<"LOGS:"<<dbgS;
+ qDebug() <<"LOGS:"<<dbgS;
return renderedString;
}
Please sign in to comment.
Something went wrong with that request. Please try again.