1
//========================================================================
3
// This file comes from pdftohtml project
4
// http://pdftohtml.sourceforge.net
8
// Rainer Dorsch <http://www.ra.informatik.uni-stuttgart.de/~rainer/>
9
// Mikhail Kruk <meshko@cs.brandeis.edu>
11
//========================================================================
13
//========================================================================
15
// Modified under the Poppler project - http://poppler.freedesktop.org
17
// All changes made under the Poppler project to this file are licensed
18
// under GPL version 2 or later
20
// Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (leenac@cdacmumbai.in) and Onkar Potdar (onkar@cdacmumbai.in)
21
// Copyright (C) 2010 Albert Astals Cid <aacid@kde.org>
23
// To see a description of the changes please see the Changelog file that
24
// came with your tarball or type make ChangeLog if you are building from git
26
//========================================================================
30
#include "goo/GooString.h"
32
#include "CharTypes.h"
40
GBool Ok(unsigned int xcol){ return ((xcol<=255)&&(xcol>=0));}
41
GooString *convtoX(unsigned int xcol) const;
43
HtmlFontColor():r(0),g(0),b(0){}
44
HtmlFontColor(GfxRGB rgb);
45
HtmlFontColor(const HtmlFontColor& x){r=x.r;g=x.g;b=x.b;}
46
HtmlFontColor& operator=(const HtmlFontColor &x){
51
GooString* toString() const;
52
GBool isEqual(const HtmlFontColor& col) const{
53
return ((r==col.r)&&(g==col.g)&&(b==col.b));
64
int pos; // position of the font name in the fonts array
65
static GooString *DefaultFont;
68
static GooString* HtmlFilter(Unicode* u, int uLen); //char* s);
71
HtmlFont(){FontName=NULL;};
72
HtmlFont(GooString* fontname,int _size, GfxRGB rgb);
73
HtmlFont(const HtmlFont& x);
74
HtmlFont& operator=(const HtmlFont& x);
75
HtmlFontColor getColor() const {return color;}
78
GooString* getFullName();
79
GBool isItalic() const {return italic;}
80
GBool isBold() const {return bold;}
81
unsigned int getSize() const {return size;}
82
int getLineSize() const {return lineSize;}
83
void setLineSize(int _lineSize) { lineSize = _lineSize; }
84
GooString* getFontName();
85
static GooString* getDefaultFont();
86
static void setDefaultFont(GooString* defaultFont);
87
GBool isEqual(const HtmlFont& x) const;
88
GBool isEqualIgnoreBold(const HtmlFont& x) const;
89
static GooString* simple(HtmlFont *font, Unicode *content, int uLen);
90
void print() const {printf("font: %s %d %s%spos: %d\n", FontName->getCString(), size, bold ? "bold " : "", italic ? "italic " : "", pos);};
95
std::vector<HtmlFont> *accu;
100
int AddFont(const HtmlFont& font);
101
HtmlFont *Get(int i){
104
GooString* getCSStyle (int i,GooString* content, int j = 0);
105
GooString* CSStyle(int i, int j = 0);
106
int size() const {return accu->size();}