Commit 0e6a0896 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov
parent 3a60e85c
//#include <QCoreApplication>
#include "../../fontengine/ApplicationFonts.h"
#include "../../graphics/GraphicsRenderer.h"
int main(int argc, char *argv[])
{
CApplicationFonts oFonts;
oFonts.Initialize();
CBgraFrame oFrame;
int nRasterW = 300;
int nRasterH = 300;
double dWidthMM = 25.4 * nRasterW / 96;
double dHeightMM = 25.4 * nRasterH / 96;
if (true)
{
nRasterW *= 2;
nRasterH *= 2;
}
oFrame.put_Width(nRasterW);
oFrame.put_Height(nRasterH);
oFrame.put_Stride(-4 * nRasterW);
BYTE* pDataRaster = new BYTE[4 * nRasterW * nRasterH];
memset(pDataRaster, 0xFF, 4 * nRasterW * nRasterH);
oFrame.put_Data(pDataRaster);
CFontManager* pManager = oFonts.GenerateFontManager();
CImageFilesCache* pCache = new CImageFilesCache();
CGraphicsRenderer oRenderer;
oRenderer.SetFontManager(pManager);
oRenderer.SetImageCache(pCache);
oRenderer.CreateFromBgraFrame(&oFrame);
oRenderer.SetSwapRGB(false);
oRenderer.put_Width(dWidthMM);
oRenderer.put_Height(dHeightMM);
oRenderer.put_FontPath(L"D:\\activex\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\DesktopEditor\\ChromiumBasedEditors2\\app\\test\\src\\build\\win64\\Debug\\fonts\\fonts\\truetype\\xmind\\Lobster-Regular.ttf");
oRenderer.put_FontFaceIndex(0);
oRenderer.put_FontSize(18);
oRenderer.CommandDrawText(L"Lobster", 10, dHeightMM / 2, 0, 0);
oFrame.SaveFile(L"D:\\111.png", 4);
return 0;
}
#-------------------------------------------------
#
# Project created by QtCreator 2015-07-21T18:28:42
#
#-------------------------------------------------
QT -= core
QT -= gui
TARGET = test
CONFIG += console
CONFIG -= app_bundle
CONFIG += c++11
INCLUDEPATH += \
../../agg-2.4/include \
../../freetype-2.5.2/include
TEMPLATE = app
############### destination path ###############
DESTINATION_SDK_PATH = $$PWD/../../../SDK/lib
# WINDOWS
win32:contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64
}
}
win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32
}
}
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_32
}
LIBS += -L$$DESTINATION_SDK_PATH -lgraphics -lOfficeUtils
win32 {
LIBS += -lgdi32 \
-ladvapi32 \
-luser32 \
-lshell32
}
linux-g++ | linux-g++-64 | linux-g++-32 {
}
SOURCES += main.cpp
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment