// we don't use CreateFormatterArgsDoc() to not introduce dependency
// on gGlobalPrefs in EngineDump
HtmlFormatterArgs *CreateFormatterArgsDoc2(Doc doc, int dx, int dy, PoolAllocator *textAllocator)
{
    HtmlFormatterArgs *args = CreateFormatterArgsDoc(doc, dx, dy, textAllocator);
    args->SetFontName(GetFontName());
    args->fontSize = GetFontSize();
    return args;
}
Example #2
0
HtmlFormatterArgs *CreateFormatterArgsDoc(Doc doc, int dx, int dy, Allocator *textAllocator)
{
    HtmlFormatterArgs *args = CreateFormatterDefaultArgs(dx, dy, textAllocator);
    args->htmlStr = doc.GetHtmlData(args->htmlStrLen);
    args->SetFontName(GetFontName());
    args->fontSize = GetFontSize();
    return args;
}
Example #3
0
HtmlFormatterArgs* CreateFormatterDefaultArgs(int dx, int dy, Allocator* textAllocator) {
    HtmlFormatterArgs* args = new HtmlFormatterArgs();
    args->SetFontName(L"Georgia");
    args->fontSize = 12.5f;
    args->pageDx = (REAL)dx;
    args->pageDy = (REAL)dy;
    args->textAllocator = textAllocator;
    args->textRenderMethod = GetTextRenderMethod();
    return args;
}
Example #4
0
// This loads and layouts a given mobi file. Used for profiling layout process.
static void MobiLayout(MobiDoc *mobiDoc)
{
    PoolAllocator textAllocator;

    HtmlFormatterArgs args;
    args.pageDx = 640;
    args.pageDy = 480;
    args.SetFontName(L"Tahoma");
    args.fontSize = 12;
    args.htmlStr = mobiDoc->GetHtmlData(args.htmlStrLen);
    args.textAllocator = &textAllocator;

    MobiFormatter mf(&args, mobiDoc);
    Vec<HtmlPage*> *pages = mf.FormatAllPages();
    DeleteVecMembers<HtmlPage*>(*pages);
    delete pages;
}