MWAWFont.hxx Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

MWAWFont.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33
34 #ifndef MWAW_FONT
35 # define MWAW_FONT
36
37 #include <assert.h>
38 #include <string>
39 #include <vector>
40
41 #include "libmwaw_internal.hxx"
42
44 class MWAWFont
45 {
46 public:
48 struct Line {
50 enum Style { None, Simple, Dot, LargeDot, Dash, Wave };
52 enum Type { Single, Double, Triple };
54 Line(Style style=None, Type type=Single, bool wordFlag=false, float w=1.0) :
55 m_style(style), m_type(type), m_word(wordFlag), m_width(w), m_color(MWAWColor::black()) { }
57 bool isSet() const
58 {
59 return m_style != None && m_width>0;
60 }
62 void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const;
64 friend std::ostream &operator<<(std::ostream &o, Line const &line);
66 bool operator==(Line const &oth) const
67 {
68 return cmp(oth)==0;
69 }
71 bool operator!=(Line const &oth) const
72 {
73 return cmp(oth)!=0;
74 }
76 int cmp(Line const &oth) const
77 {
78 if (m_style != oth.m_style) return int(m_style)-int(oth.m_style);
79 if (m_type != oth.m_type) return int(m_type)-int(oth.m_type);
80 if (m_word != oth.m_word) return m_word ? -1 : 1;
81 if (m_width < oth.m_width) return -1;
82 if (m_width > oth.m_width) return 1;
83 if (m_color.isSet() != oth.m_color.isSet())
84 return m_color.isSet();
85 if (m_color.get() < oth.m_color.get()) return -1;
86 if (m_color.get() > oth.m_color.get()) return 1;
87 return 0;
88 }
90 Style m_style;
92 Type m_type;
94 bool m_word;
96 float m_width;
98 Variable<MWAWColor> m_color;
99 };
101 struct Script {
103 Script(float delta=0, librevenge::RVNGUnit deltaUnit=librevenge::RVNG_PERCENT, int scale=100) :
104 m_delta(delta), m_deltaUnit(deltaUnit), m_scale(scale)
105 {
106 }
108 bool isSet() const
109 {
110 return *this != Script();
111 }
113 static Script sub()
114 {
115 return Script(-33,librevenge::RVNG_PERCENT,58);
116 }
118 static Script sub100()
119 {
120 return Script(-20);
121 }
123 static Script super()
124 {
125 return Script(33,librevenge::RVNG_PERCENT,58);
126 }
128 static Script super100()
129 {
130 return Script(20);
131 }
133 std::string str(float fSize) const;
134
136 bool operator==(Script const &oth) const
137 {
138 return cmp(oth)==0;
139 }
141 bool operator!=(Script const &oth) const
142 {
143 return cmp(oth)!=0;
144 }
146 bool operator<(Script const &oth) const
147 {
148 return cmp(oth)<0;
149 }
151 bool operator<=(Script const &oth) const
152 {
153 return cmp(oth)<=0;
154 }
156 bool operator>(Script const &oth) const
157 {
158 return cmp(oth)>0;
159 }
161 bool operator>=(Script const &oth) const
162 {
163 return cmp(oth)>=0;
164 }
166 int cmp(Script const &oth) const
167 {
168 if (m_delta > oth.m_delta) return -1;
169 if (m_delta < oth.m_delta) return 1;
170 if (m_deltaUnit != oth.m_deltaUnit) return int(m_deltaUnit)-int(oth.m_deltaUnit);
171 if (m_scale != oth.m_scale) return m_scale-oth.m_scale;
172 return 0;
173 }
175 float m_delta;
177 librevenge::RVNGUnit m_deltaUnit;
179 int m_scale;
180 };
181
183 enum FontBits { boldBit=1, italicBit=2, blinkBit=4, embossBit=8, engraveBit=0x10,
184 hiddenBit=0x20, outlineBit=0x40, shadowBit=0x80,
185 reverseVideoBit=0x100, smallCapsBit=0x200, allCapsBit=0x400,
186 lowercaseBit=0x800, boxedBit=0x1000, boxedRoundedBit=0x2000,
187 reverseWritingBit=0x4000
188 };
194 MWAWFont(int newId=-1, float sz=12, uint32_t f = 0) : m_id(newId), m_size(sz), m_deltaSpacing(0), m_texteWidthScaling(1.0), m_scriptPosition(),
195 m_flags(f), m_overline(Line::None), m_strikeoutline(Line::None), m_underline(Line::None),
196 m_color(MWAWColor::black()), m_backgroundColor(MWAWColor::white()), m_language(""), m_extra("")
197 {
198 resetColor();
199 };
201 bool isSet() const
202 {
203 return m_id.isSet();
204 }
206 void insert(MWAWFont const &ft)
207 {
208 m_id.insert(ft.m_id);
209 m_size.insert(ft.m_size);
210 m_deltaSpacing.insert(ft.m_deltaSpacing);
211 m_texteWidthScaling.insert(ft.m_texteWidthScaling);
212 m_scriptPosition.insert(ft.m_scriptPosition);
213 if (ft.m_flags.isSet()) {
214 if (m_flags.isSet())
215 setFlags(flags()| ft.flags());
216 else
217 m_flags = ft.m_flags;
218 }
219 m_overline.insert(ft.m_overline);
220 m_strikeoutline.insert(ft.m_strikeoutline);
221 m_underline.insert(ft.m_underline);
222 m_color.insert(ft.m_color);
223 m_extra += ft.m_extra;
224 }
226 void setFont(int newId)
227 {
228 resetColor();
229 m_id=newId;
230 }
231
233 int id() const
234 {
235 return m_id.get();
236 }
238 void setId(int newId)
239 {
240 m_id = newId;
241 }
242
244 float size() const
245 {
246 return m_size.get();
247 }
249 void setSize(float sz)
250 {
251 m_size = sz;
252 }
253
255 float deltaLetterSpacing() const
256 {
257 return m_deltaSpacing.get();
258 }
260 void setDeltaLetterSpacing(float d)
261 {
262 m_deltaSpacing=d;
263 }
265 float texteWidthScaling() const
266 {
267 return m_texteWidthScaling.get();
268 }
270 void setTexteWidthScaling(float scale=1.0)
271 {
272 m_texteWidthScaling = scale;
273 }
275 Script const &script() const
276 {
277 return m_scriptPosition.get();
278 }
279
281 void set(Script const &newscript)
282 {
283 m_scriptPosition = newscript;
284 }
285
287 uint32_t flags() const
288 {
289 return m_flags.get();
290 }
292 void setFlags(uint32_t fl)
293 {
294 m_flags = fl;
295 }
296
298 bool hasColor() const
299 {
300 return m_color.isSet() && !m_color.get().isBlack();
301 }
303 void getColor(MWAWColor &c) const
304 {
305 c = m_color.get();
306 }
308 void setColor(MWAWColor color)
309 {
310 m_color = color;
311 }
312
314 void getBackgroundColor(MWAWColor &c) const
315 {
316 c = m_backgroundColor.get();
317 }
319 void setBackgroundColor(MWAWColor color)
320 {
321 m_backgroundColor = color;
322 }
324 void resetColor()
325 {
326 m_color = MWAWColor::black();
327 m_backgroundColor = MWAWColor::white();
328 }
329
331 bool hasDecorationLines() const
332 {
333 return (m_overline.isSet() && m_overline->isSet()) ||
334 (m_strikeoutline.isSet() && m_strikeoutline->isSet()) ||
335 (m_underline.isSet() && m_underline->isSet());
336 }
338 void resetDecorationLines()
339 {
340 if (m_overline.isSet()) m_overline=Line(Line::None);
341 if (m_strikeoutline.isSet()) m_strikeoutline=Line(Line::None);
342 if (m_underline.isSet()) m_underline=Line(Line::None);
343 }
345 Line const &getOverline() const
346 {
347 return m_overline.get();
348 }
350 void setOverline(Line const &line)
351 {
352 m_overline = line;
353 }
355 void setOverlineStyle(Line::Style style=Line::None, bool doReset=true)
356 {
357 if (doReset)
358 m_overline = Line(style);
359 else
360 m_overline->m_style = style;
361 }
363 void setOverlineType(Line::Type type=Line::Single)
364 {
365 m_overline->m_type = type;
366 }
368 void setOverlineWordFlag(bool wordFlag=false)
369 {
370 m_overline->m_word = wordFlag;
371 }
373 void setOverlineWidth(float w)
374 {
375 m_overline->m_width = w;
376 }
378 void setOverlineColor(MWAWColor const &color)
379 {
380 m_overline->m_color = color;
381 }
382
384 Line const &getStrikeOut() const
385 {
386 return m_strikeoutline.get();
387 }
389 void setStrikeOut(Line const &line)
390 {
391 m_strikeoutline = line;
392 }
394 void setStrikeOutStyle(Line::Style style=Line::None, bool doReset=true)
395 {
396 if (doReset)
397 m_strikeoutline = Line(style);
398 else
399 m_strikeoutline->m_style = style;
400 }
402 void setStrikeOutType(Line::Type type=Line::Single)
403 {
404 m_strikeoutline->m_type = type;
405 }
407 void setStrikeOutWordFlag(bool wordFlag=false)
408 {
409 m_strikeoutline->m_word = wordFlag;
410 }
412 void setStrikeOutWidth(float w)
413 {
414 m_strikeoutline->m_width = w;
415 }
417 void setStrikeOutColor(MWAWColor const &color)
418 {
419 m_strikeoutline->m_color = color;
420 }
421
423 Line const &getUnderline() const
424 {
425 return m_underline.get();
426 }
428 void setUnderline(Line const &line)
429 {
430 m_underline = line;
431 }
433 void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
434 {
435 if (doReset)
436 m_underline = Line(style);
437 else
438 m_underline->m_style = style;
439 }
441 void setUnderlineType(Line::Type type=Line::Single)
442 {
443 m_underline->m_type = type;
444 }
446 void setUnderlineWordFlag(bool wordFlag=false)
447 {
448 m_underline->m_word = wordFlag;
449 }
451 void setUnderlineWidth(float w)
452 {
453 m_underline->m_width = w;
454 }
456 void setUnderlineColor(MWAWColor const &color)
457 {
458 m_underline->m_color = color;
459 }
460
462 std::string const &language() const
463 {
464 return m_language.get();
465 }
467 void setLanguage(std::string const &lang)
468 {
469 m_language=lang;
470 }
472 void addTo(librevenge::RVNGPropertyList &propList, shared_ptr<MWAWFontConverter> fontConverter) const;
473
475 std::string getDebugString(shared_ptr<MWAWFontConverter> &converter) const;
476
478 bool operator==(MWAWFont const &f) const
479 {
480 return cmp(f) == 0;
481 }
483 bool operator!=(MWAWFont const &f) const
484 {
485 return cmp(f) != 0;
486 }
487
489 int cmp(MWAWFont const &oth) const
490 {
491 int diff = id() - oth.id();
492 if (diff != 0) return diff;
493 if (size() < oth.size()) return -1;
494 if (size() > oth.size()) return -1;
495 if (flags() < oth.flags()) return -1;
496 if (flags() > oth.flags()) return 1;
497 if (m_deltaSpacing.get() < oth.m_deltaSpacing.get()) return -1;
498 if (m_deltaSpacing.get() > oth.m_deltaSpacing.get()) return 1;
499 if (m_texteWidthScaling.get() < oth.m_texteWidthScaling.get()) return -1;
500 if (m_texteWidthScaling.get() > oth.m_texteWidthScaling.get()) return 1;
501 diff = script().cmp(oth.script());
502 if (diff != 0) return diff;
503 diff = m_overline.get().cmp(oth.m_overline.get());
504 if (diff != 0) return diff;
505 diff = m_strikeoutline.get().cmp(oth.m_strikeoutline.get());
506 if (diff != 0) return diff;
507 diff = m_underline.get().cmp(oth.m_underline.get());
508 if (diff != 0) return diff;
509 if (m_color.get() < oth.m_color.get()) return -1;
510 if (m_color.get() > oth.m_color.get()) return 1;
511 if (m_backgroundColor.get() < oth.m_backgroundColor.get()) return -1;
512 if (m_backgroundColor.get() > oth.m_backgroundColor.get()) return 1;
513 if (m_language.get() < oth.m_language.get()) return -1;
514 if (m_language.get() > oth.m_language.get()) return 1;
515 return diff;
516 }
517
518 protected:
519 Variable<int> m_id ;
520 Variable<float> m_size ;
521 Variable<float> m_deltaSpacing ;
522 Variable<float> m_texteWidthScaling ;
523 Variable<Script> m_scriptPosition ;
524 Variable<uint32_t> m_flags ;
525 Variable<Line> m_overline ;
526 Variable<Line> m_strikeoutline ;
527 Variable<Line> m_underline ;
528 Variable<MWAWColor> m_color ;
529 Variable<MWAWColor> m_backgroundColor ;
530 Variable<std::string> m_language ;
531 public:
533 std::string m_extra;
534 };
535
536
537 #endif
538 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWFont::Line::Simple
Definition: MWAWFont.hxx:50
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:281
MWAWFont::setStrikeOutColor
void setStrikeOutColor(MWAWColor const &color)
sets the strikeoutline color
Definition: MWAWFont.hxx:417
MWAWFont::setFont
void setFont(int newId)
sets the font id and resets size to the previous size for this font
Definition: MWAWFont.hxx:226
MWAWFont::script
Script const & script() const
returns the script position
Definition: MWAWFont.hxx:275
MWAWFont::allCapsBit
Definition: MWAWFont.hxx:185
MWAWFont::setUnderlineType
void setUnderlineType(Line::Type type=Line::Single)
sets the underline type
Definition: MWAWFont.hxx:441
MWAWFont::m_flags
Variable< uint32_t > m_flags
font attributes
Definition: MWAWFont.hxx:524
MWAWFont::setDeltaLetterSpacing
void setDeltaLetterSpacing(float d)
sets the letter spacing ( delta value in point )
Definition: MWAWFont.hxx:260
MWAWFont::Line::Dash
Definition: MWAWFont.hxx:50
MWAWFont::Line::Type
Type
the line style
Definition: MWAWFont.hxx:52
MWAWFont::boldBit
Definition: MWAWFont.hxx:183
MWAWFont::resetColor
void resetColor()
resets the font color to black and the background color to white
Definition: MWAWFont.hxx:324
MWAWFont::Script::str
std::string str(float fSize) const
return a string which correspond to style:text-position
Definition: MWAWFont.cxx:141
MWAWFont::Script::cmp
int cmp(Script const &oth) const
small comparison function
Definition: MWAWFont.hxx:166
MWAWFont::smallCapsBit
Definition: MWAWFont.hxx:185
MWAWFont::hasDecorationLines
bool hasDecorationLines() const
return true if the font has decorations line (overline, strikeout, underline)
Definition: MWAWFont.hxx:331
MWAWFont::Line::Triple
Definition: MWAWFont.hxx:52
MWAWFont::Line::Wave
Definition: MWAWFont.hxx:50
libmwaw_internal.hxx
MWAWFont::Line::m_color
Variable< MWAWColor > m_color
the color ( if not set, we use the font color )
Definition: MWAWFont.hxx:98
Variable::insert
void insert(Variable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:477
MWAWFont::m_underline
Variable< Line > m_underline
underline attributes
Definition: MWAWFont.hxx:527
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:216
MWAWFont::setStrikeOutStyle
void setStrikeOutStyle(Line::Style style=Line::None, bool doReset=true)
sets the strikeoutline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:394
MWAWFont::setOverlineStyle
void setOverlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the overline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:355
MWAWFont::addTo
void addTo(librevenge::RVNGPropertyList &propList, shared_ptr< MWAWFontConverter > fontConverter) const
add to the propList
Definition: MWAWFont.cxx:230
MWAWFont::Script::operator<=
bool operator<=(Script const &oth) const
operator<=
Definition: MWAWFont.hxx:151
MWAWFont::hasColor
bool hasColor() const
returns true if the font color is not black
Definition: MWAWFont.hxx:298
MWAWFont::m_extra
std::string m_extra
extra data
Definition: MWAWFont.hxx:533
MWAWFont::Line::m_type
Type m_type
the type
Definition: MWAWFont.hxx:92
MWAWFont::m_scriptPosition
Variable< Script > m_scriptPosition
the sub/super script definition
Definition: MWAWFont.hxx:523
MWAWFont::deltaLetterSpacing
float deltaLetterSpacing() const
returns the condensed(negative)/extended(positive) width
Definition: MWAWFont.hxx:255
MWAWFont::FontBits
FontBits
the different font bit
Definition: MWAWFont.hxx:183
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:211
MWAWFont::id
int id() const
returns the font id
Definition: MWAWFont.hxx:233
Variable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:512
MWAWFont::m_language
Variable< std::string > m_language
the language if set
Definition: MWAWFont.hxx:530
MWAWFont::outlineBit
Definition: MWAWFont.hxx:184
MWAWFont::embossBit
Definition: MWAWFont.hxx:183
MWAWFont::Line::None
Definition: MWAWFont.hxx:50
MWAWFont::resetDecorationLines
void resetDecorationLines()
reset the decoration
Definition: MWAWFont.hxx:338
MWAWFont::setUnderlineColor
void setUnderlineColor(MWAWColor const &color)
sets the underline color
Definition: MWAWFont.hxx:456
MWAWFont::Line::isSet
bool isSet() const
return true if the line is not empty
Definition: MWAWFont.hxx:57
MWAWFont::Line::operator<<
friend std::ostream & operator<<(std::ostream &o, Line const &line)
operator<<
Definition: MWAWFont.cxx:48
MWAWFont::Script::super
static Script super()
return a yposition which correspond to a basic superscript
Definition: MWAWFont.hxx:123
MWAWFont::Line::Single
Definition: MWAWFont.hxx:52
MWAWFont::engraveBit
Definition: MWAWFont.hxx:183
MWAWFont::reverseWritingBit
Definition: MWAWFont.hxx:187
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:167
MWAWFont::boxedRoundedBit
Definition: MWAWFont.hxx:186
MWAWFont::Line::m_style
Style m_style
the style
Definition: MWAWFont.hxx:90
MWAWFont::Script::sub
static Script sub()
return a yposition which correspond to a basic subscript
Definition: MWAWFont.hxx:113
MWAWFont::shadowBit
Definition: MWAWFont.hxx:184
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:308
MWAWFont::m_color
Variable< MWAWColor > m_color
font color
Definition: MWAWFont.hxx:528
MWAWFont::Script::isSet
bool isSet() const
return true if the position is not default
Definition: MWAWFont.hxx:108
MWAWFont::m_strikeoutline
Variable< Line > m_strikeoutline
overline attributes
Definition: MWAWFont.hxx:526
MWAWFont::Script::operator>=
bool operator>=(Script const &oth) const
operator>=
Definition: MWAWFont.hxx:161
MWAWFont::blinkBit
Definition: MWAWFont.hxx:183
MWAWFont::Line::operator==
bool operator==(Line const &oth) const
operator==
Definition: MWAWFont.hxx:66
MWAWFont::Line::Style
Style
the line style
Definition: MWAWFont.hxx:50
MWAWFont::Line::Double
Definition: MWAWFont.hxx:52
MWAWFont::m_id
Variable< int > m_id
font identificator
Definition: MWAWFont.hxx:519
MWAWFont::setStrikeOutType
void setStrikeOutType(Line::Type type=Line::Single)
sets the strikeoutline type
Definition: MWAWFont.hxx:402
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
MWAWFont::getColor
void getColor(MWAWColor &c) const
returns the font color
Definition: MWAWFont.hxx:303
MWAWFont::setUnderline
void setUnderline(Line const &line)
sets the underline
Definition: MWAWFont.hxx:428
MWAWFont::setSize
void setSize(float sz)
sets the font size
Definition: MWAWFont.hxx:249
MWAWFont::Script::super100
static Script super100()
return a yposition which correspond to a basic superscript100
Definition: MWAWFont.hxx:128
MWAWFont::m_deltaSpacing
Variable< float > m_deltaSpacing
expand(> 0), condensed(< 0) depl in point
Definition: MWAWFont.hxx:521
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:238
MWAWFont::m_texteWidthScaling
Variable< float > m_texteWidthScaling
the texte width scaling
Definition: MWAWFont.hxx:522
MWAWFont::Script::operator==
bool operator==(Script const &oth) const
operator==
Definition: MWAWFont.hxx:136
MWAWFont::Script::sub100
static Script sub100()
return a yposition which correspond to a basic subscript100
Definition: MWAWFont.hxx:118
MWAWFont::setOverline
void setOverline(Line const &line)
sets the overline
Definition: MWAWFont.hxx:350
MWAWFont::MWAWFont
MWAWFont(int newId=-1, float sz=12, uint32_t f=0)
constructor
Definition: MWAWFont.hxx:194
MWAWFont::getOverline
Line const & getOverline() const
returns the overline
Definition: MWAWFont.hxx:345
MWAWFont::cmp
int cmp(MWAWFont const &oth) const
a comparison function
Definition: MWAWFont.hxx:489
MWAWFont::boxedBit
Definition: MWAWFont.hxx:186
MWAWFont::operator==
bool operator==(MWAWFont const &f) const
operator==
Definition: MWAWFont.hxx:478
MWAWFont::setUnderlineWidth
void setUnderlineWidth(float w)
sets the underline width
Definition: MWAWFont.hxx:451
MWAWFont::Line::Line
Line(Style style=None, Type type=Single, bool wordFlag=false, float w=1.0)
constructor
Definition: MWAWFont.hxx:54
MWAWFont::Script::m_delta
float m_delta
the ydelta
Definition: MWAWFont.hxx:175
MWAWFont::Line::operator!=
bool operator!=(Line const &oth) const
operator!=
Definition: MWAWFont.hxx:71
MWAWFont::Script::m_scale
int m_scale
the font scaling ( in percent )
Definition: MWAWFont.hxx:179
MWAWFont::Line::m_width
float m_width
the width in point
Definition: MWAWFont.hxx:96
MWAWFont::setOverlineWidth
void setOverlineWidth(float w)
sets the overline width
Definition: MWAWFont.hxx:373
MWAWFont::language
std::string const & language() const
returns the language
Definition: MWAWFont.hxx:462
Variable::get
T const & get() const
return the current value
Definition: libmwaw_internal.hxx:507
MWAWFont::operator!=
bool operator!=(MWAWFont const &f) const
operator!=
Definition: MWAWFont.hxx:483
MWAWFont::flags
uint32_t flags() const
returns the font flags
Definition: MWAWFont.hxx:287
MWAWFont::Script::operator!=
bool operator!=(Script const &oth) const
operator!=
Definition: MWAWFont.hxx:141
MWAWFont::m_overline
Variable< Line > m_overline
overline attributes
Definition: MWAWFont.hxx:525
MWAWFont::italicBit
Definition: MWAWFont.hxx:183
MWAWFont::setOverlineType
void setOverlineType(Line::Type type=Line::Single)
sets the overline type
Definition: MWAWFont.hxx:363
MWAWFont::getDebugString
std::string getDebugString(shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:174
MWAWFont::setOverlineColor
void setOverlineColor(MWAWColor const &color)
sets the overline color
Definition: MWAWFont.hxx:378
MWAWFont::Line::cmp
int cmp(Line const &oth) const
small comparison function
Definition: MWAWFont.hxx:76
MWAWFont::texteWidthScaling
float texteWidthScaling() const
returns the text width scaling
Definition: MWAWFont.hxx:265
MWAWFont::m_backgroundColor
Variable< MWAWColor > m_backgroundColor
font background color
Definition: MWAWFont.hxx:529
MWAWFont::Line::m_word
bool m_word
word or not word line
Definition: MWAWFont.hxx:94
MWAWFont::setUnderlineWordFlag
void setUnderlineWordFlag(bool wordFlag=false)
sets the underline word flag
Definition: MWAWFont.hxx:446
MWAWFont::setStrikeOutWidth
void setStrikeOutWidth(float w)
sets the strikeoutline width
Definition: MWAWFont.hxx:412
MWAWFont::Line
a small struct to define a line in MWAWFont
Definition: MWAWFont.hxx:48
MWAWFont::Script::Script
Script(float delta=0, librevenge::RVNGUnit deltaUnit=librevenge::RVNG_PERCENT, int scale=100)
constructor
Definition: MWAWFont.hxx:103
MWAWFont::setOverlineWordFlag
void setOverlineWordFlag(bool wordFlag=false)
sets the overline word flag
Definition: MWAWFont.hxx:368
MWAWFont::Line::LargeDot
Definition: MWAWFont.hxx:50
MWAWFont::Script::operator<
bool operator<(Script const &oth) const
operator<
Definition: MWAWFont.hxx:146
MWAWFont::getBackgroundColor
void getBackgroundColor(MWAWColor &c) const
returns the font background color
Definition: MWAWFont.hxx:314
MWAWFont::getUnderline
Line const & getUnderline() const
returns the underline
Definition: MWAWFont.hxx:423
MWAWFont::Script::operator>
bool operator>(Script const &oth) const
operator>
Definition: MWAWFont.hxx:156
MWAWFont::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the font background color
Definition: MWAWFont.hxx:319
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:250
MWAWFont::Script::m_deltaUnit
librevenge::RVNGUnit m_deltaUnit
the ydelta unit ( point or percent )
Definition: MWAWFont.hxx:177
MWAWFont::setStrikeOutWordFlag
void setStrikeOutWordFlag(bool wordFlag=false)
sets the strikeoutline word flag
Definition: MWAWFont.hxx:407
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:244
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:292
MWAWFont::setStrikeOut
void setStrikeOut(Line const &line)
sets the strikeoutline
Definition: MWAWFont.hxx:389
MWAWFont::Line::Dot
Definition: MWAWFont.hxx:50
MWAWFont::setTexteWidthScaling
void setTexteWidthScaling(float scale=1.0)
sets the text width scaling
Definition: MWAWFont.hxx:270
MWAWFont::insert
void insert(MWAWFont const &ft)
inserts the set value in the current font
Definition: MWAWFont.hxx:206
MWAWFont::lowercaseBit
Definition: MWAWFont.hxx:186
Variable< MWAWColor >
MWAWFont::m_size
Variable< float > m_size
font size
Definition: MWAWFont.hxx:520
MWAWFont::isSet
bool isSet() const
returns true if the font id is initialized
Definition: MWAWFont.hxx:201
MWAWFont::reverseVideoBit
Definition: MWAWFont.hxx:185
MWAWFont::setLanguage
void setLanguage(std::string const &lang)
set the language ( in the for en_US, en_GB, en, ...)
Definition: MWAWFont.hxx:467
MWAWFont::setUnderlineStyle
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
sets the underline style ( by default, we also reset the style)
Definition: MWAWFont.hxx:433
MWAWFont::Line::addTo
void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const
add a line to the propList knowing the type (line-through, underline, overline )
Definition: MWAWFont.cxx:91
MWAWFont::hiddenBit
Definition: MWAWFont.hxx:184
MWAWFont::getStrikeOut
Line const & getStrikeOut() const
returns the strikeoutline
Definition: MWAWFont.hxx:384
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:101