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 <string>
38 #include <vector>
39
40 #include "libmwaw_internal.hxx"
41
43 class MWAWFont
44 {
45 public:
47 struct Line {
49 enum Style { None, Simple, Dot, LargeDot, Dash, Wave };
51 enum Type { Single, Double, Triple };
53 Line(Style style=None, Type type=Single, bool wordFlag=false, float w=1.0) :
54 m_style(style), m_type(type), m_word(wordFlag), m_width(w), m_color(MWAWColor::black()) { }
56 bool isSet() const
57 {
58 return m_style != None && m_width>0;
59 }
61 void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const;
63 friend std::ostream &operator<<(std::ostream &o, Line const &line);
65 bool operator==(Line const &oth) const
66 {
67 return cmp(oth)==0;
68 }
70 bool operator!=(Line const &oth) const
71 {
72 return cmp(oth)!=0;
73 }
75 int cmp(Line const &oth) const
76 {
77 if (m_style != oth.m_style) return int(m_style)-int(oth.m_style);
78 if (m_type != oth.m_type) return int(m_type)-int(oth.m_type);
79 if (m_word != oth.m_word) return m_word ? -1 : 1;
80 if (m_width < oth.m_width) return -1;
81 if (m_width > oth.m_width) return 1;
82 if (m_color.isSet() != oth.m_color.isSet())
83 return m_color.isSet();
84 if (m_color.get() < oth.m_color.get()) return -1;
85 if (m_color.get() > oth.m_color.get()) return 1;
86 return 0;
87 }
89 Style m_style;
91 Type m_type;
93 bool m_word;
95 float m_width;
97 MWAWVariable<MWAWColor> m_color;
98 };
100 struct Script {
102 Script(float delta=0, librevenge::RVNGUnit deltaUnit=librevenge::RVNG_PERCENT, int scale=100) :
103 m_delta(delta), m_deltaUnit(deltaUnit), m_scale(scale)
104 {
105 }
107 bool isSet() const
108 {
109 return *this != Script();
110 }
112 static Script sub()
113 {
114 return Script(-33,librevenge::RVNG_PERCENT,58);
115 }
117 static Script sub100()
118 {
119 return Script(-20);
120 }
122 static Script super()
123 {
124 return Script(33,librevenge::RVNG_PERCENT,58);
125 }
127 static Script super100()
128 {
129 return Script(20);
130 }
132 std::string str(float fSize) const;
133
135 bool operator==(Script const &oth) const
136 {
137 return cmp(oth)==0;
138 }
140 bool operator!=(Script const &oth) const
141 {
142 return cmp(oth)!=0;
143 }
145 bool operator<(Script const &oth) const
146 {
147 return cmp(oth)<0;
148 }
150 bool operator<=(Script const &oth) const
151 {
152 return cmp(oth)<=0;
153 }
155 bool operator>(Script const &oth) const
156 {
157 return cmp(oth)>0;
158 }
160 bool operator>=(Script const &oth) const
161 {
162 return cmp(oth)>=0;
163 }
165 int cmp(Script const &oth) const
166 {
167 if (m_delta > oth.m_delta) return -1;
168 if (m_delta < oth.m_delta) return 1;
169 if (m_deltaUnit != oth.m_deltaUnit) return int(m_deltaUnit)-int(oth.m_deltaUnit);
170 if (m_scale != oth.m_scale) return m_scale-oth.m_scale;
171 return 0;
172 }
174 float m_delta;
176 librevenge::RVNGUnit m_deltaUnit;
178 int m_scale;
179 };
180
182 enum FontBits { boldBit=1, italicBit=2, blinkBit=4, embossBit=8, engraveBit=0x10,
183 hiddenBit=0x20, outlineBit=0x40, shadowBit=0x80,
184 reverseVideoBit=0x100, smallCapsBit=0x200, uppercaseBit=0x400,
185 lowercaseBit=0x800,
186 initialcaseBit=2*lowercaseBit,
187 boxedBit=2*initialcaseBit,
188 boxedRoundedBit=2*boxedBit,
189 reverseWritingBit=2*boxedRoundedBit
190 };
196 MWAWFont(int newId=-1, float sz=12, uint32_t f = 0) : m_id(newId), m_size(sz), m_deltaSpacing(0), m_deltaSpacingUnit(librevenge::RVNG_POINT), m_widthStreching(1), m_scriptPosition(),
197 m_flags(f), m_overline(Line::None), m_strikeoutline(Line::None), m_underline(Line::None),
198 m_color(MWAWColor::black()), m_backgroundColor(MWAWColor::white()), m_language(""), m_extra("")
199 {
200 resetColor();
201 };
203 bool isSet() const
204 {
205 return m_id.isSet();
206 }
208 void insert(MWAWFont const &ft)
209 {
210 m_id.insert(ft.m_id);
211 m_size.insert(ft.m_size);
212 m_deltaSpacing.insert(ft.m_deltaSpacing);
213 m_deltaSpacingUnit.insert(ft.m_deltaSpacingUnit);
214 m_widthStreching.insert(ft.m_widthStreching);
215 m_scriptPosition.insert(ft.m_scriptPosition);
216 if (ft.m_flags.isSet()) {
217 if (m_flags.isSet())
218 setFlags(flags()| ft.flags());
219 else
220 m_flags = ft.m_flags;
221 }
222 m_overline.insert(ft.m_overline);
223 m_strikeoutline.insert(ft.m_strikeoutline);
224 m_underline.insert(ft.m_underline);
225 m_color.insert(ft.m_color);
226 m_extra += ft.m_extra;
227 }
229 void setFont(int newId)
230 {
231 resetColor();
232 m_id=newId;
233 }
234
236 int id() const
237 {
238 return m_id.get();
239 }
241 void setId(int newId)
242 {
243 m_id = newId;
244 }
245
247 float size() const
248 {
249 return m_size.get();
250 }
252 void setSize(float sz)
253 {
254 m_size = sz;
255 }
256
258 float deltaLetterSpacing() const
259 {
260 return m_deltaSpacing.get();
261 }
263 librevenge::RVNGUnit deltaLetterSpacingUnit() const
264 {
265 return m_deltaSpacingUnit.get();
266 }
268 void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
269 {
270 m_deltaSpacing=d;
271 m_deltaSpacingUnit=unit;
272 }
274 float widthStreching() const
275 {
276 return m_widthStreching.get();
277 }
279 void setWidthStreching(float scale=1.0)
280 {
281 m_widthStreching = scale;
282 }
284 Script const &script() const
285 {
286 return m_scriptPosition.get();
287 }
288
290 void set(Script const &newscript)
291 {
292 m_scriptPosition = newscript;
293 }
294
296 uint32_t flags() const
297 {
298 return m_flags.get();
299 }
301 void setFlags(uint32_t fl)
302 {
303 m_flags = fl;
304 }
305
307 bool hasColor() const
308 {
309 return m_color.isSet() && !m_color.get().isBlack();
310 }
312 void getColor(MWAWColor &c) const
313 {
314 c = m_color.get();
315 }
317 void setColor(MWAWColor color)
318 {
319 m_color = color;
320 }
321
323 void getBackgroundColor(MWAWColor &c) const
324 {
325 c = m_backgroundColor.get();
326 }
328 void setBackgroundColor(MWAWColor color)
329 {
330 m_backgroundColor = color;
331 }
333 void resetColor()
334 {
335 m_color = MWAWColor::black();
336 m_backgroundColor = MWAWColor::white();
337 }
338
340 bool hasDecorationLines() const
341 {
342 return (m_overline.isSet() && m_overline->isSet()) ||
343 (m_strikeoutline.isSet() && m_strikeoutline->isSet()) ||
344 (m_underline.isSet() && m_underline->isSet());
345 }
347 void resetDecorationLines()
348 {
349 if (m_overline.isSet()) m_overline=Line(Line::None);
350 if (m_strikeoutline.isSet()) m_strikeoutline=Line(Line::None);
351 if (m_underline.isSet()) m_underline=Line(Line::None);
352 }
354 Line const &getOverline() const
355 {
356 return m_overline.get();
357 }
359 void setOverline(Line const &line)
360 {
361 m_overline = line;
362 }
364 void setOverlineStyle(Line::Style style=Line::None, bool doReset=true)
365 {
366 if (doReset)
367 m_overline = Line(style);
368 else
369 m_overline->m_style = style;
370 }
372 void setOverlineType(Line::Type type=Line::Single)
373 {
374 m_overline->m_type = type;
375 }
377 void setOverlineWordFlag(bool wordFlag=false)
378 {
379 m_overline->m_word = wordFlag;
380 }
382 void setOverlineWidth(float w)
383 {
384 m_overline->m_width = w;
385 }
387 void setOverlineColor(MWAWColor const &color)
388 {
389 m_overline->m_color = color;
390 }
391
393 Line const &getStrikeOut() const
394 {
395 return m_strikeoutline.get();
396 }
398 void setStrikeOut(Line const &line)
399 {
400 m_strikeoutline = line;
401 }
403 void setStrikeOutStyle(Line::Style style=Line::None, bool doReset=true)
404 {
405 if (doReset)
406 m_strikeoutline = Line(style);
407 else
408 m_strikeoutline->m_style = style;
409 }
411 void setStrikeOutType(Line::Type type=Line::Single)
412 {
413 m_strikeoutline->m_type = type;
414 }
416 void setStrikeOutWordFlag(bool wordFlag=false)
417 {
418 m_strikeoutline->m_word = wordFlag;
419 }
421 void setStrikeOutWidth(float w)
422 {
423 m_strikeoutline->m_width = w;
424 }
426 void setStrikeOutColor(MWAWColor const &color)
427 {
428 m_strikeoutline->m_color = color;
429 }
430
432 Line const &getUnderline() const
433 {
434 return m_underline.get();
435 }
437 void setUnderline(Line const &line)
438 {
439 m_underline = line;
440 }
442 void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
443 {
444 if (doReset)
445 m_underline = Line(style);
446 else
447 m_underline->m_style = style;
448 }
450 void setUnderlineType(Line::Type type=Line::Single)
451 {
452 m_underline->m_type = type;
453 }
455 void setUnderlineWordFlag(bool wordFlag=false)
456 {
457 m_underline->m_word = wordFlag;
458 }
460 void setUnderlineWidth(float w)
461 {
462 m_underline->m_width = w;
463 }
465 void setUnderlineColor(MWAWColor const &color)
466 {
467 m_underline->m_color = color;
468 }
469
471 std::string const &language() const
472 {
473 return m_language.get();
474 }
476 void setLanguage(std::string const &lang)
477 {
478 m_language=lang;
479 }
481 void addTo(librevenge::RVNGPropertyList &propList, shared_ptr<MWAWFontConverter> fontConverter) const;
482
484 std::string getDebugString(shared_ptr<MWAWFontConverter> &converter) const;
485
487 bool operator==(MWAWFont const &f) const
488 {
489 return cmp(f) == 0;
490 }
492 bool operator!=(MWAWFont const &f) const
493 {
494 return cmp(f) != 0;
495 }
496
498 int cmp(MWAWFont const &oth) const
499 {
500 int diff = id() - oth.id();
501 if (diff != 0) return diff;
502 if (size() < oth.size()) return -1;
503 if (size() > oth.size()) return -1;
504 if (flags() < oth.flags()) return -1;
505 if (flags() > oth.flags()) return 1;
506 if (m_deltaSpacing.get() < oth.m_deltaSpacing.get()) return -1;
507 if (m_deltaSpacing.get() > oth.m_deltaSpacing.get()) return 1;
508 if (m_deltaSpacingUnit.get() < oth.m_deltaSpacingUnit.get()) return -1;
509 if (m_deltaSpacingUnit.get() > oth.m_deltaSpacingUnit.get()) return 1;
510 if (m_widthStreching.get() < oth.m_widthStreching.get()) return -1;
511 if (m_widthStreching.get() > oth.m_widthStreching.get()) return 1;
512 diff = script().cmp(oth.script());
513 if (diff != 0) return diff;
514 diff = m_overline.get().cmp(oth.m_overline.get());
515 if (diff != 0) return diff;
516 diff = m_strikeoutline.get().cmp(oth.m_strikeoutline.get());
517 if (diff != 0) return diff;
518 diff = m_underline.get().cmp(oth.m_underline.get());
519 if (diff != 0) return diff;
520 if (m_color.get() < oth.m_color.get()) return -1;
521 if (m_color.get() > oth.m_color.get()) return 1;
522 if (m_backgroundColor.get() < oth.m_backgroundColor.get()) return -1;
523 if (m_backgroundColor.get() > oth.m_backgroundColor.get()) return 1;
524 if (m_language.get() < oth.m_language.get()) return -1;
525 if (m_language.get() > oth.m_language.get()) return 1;
526 return diff;
527 }
528
529 protected:
530 MWAWVariable<int> m_id ;
531 MWAWVariable<float> m_size ;
532 MWAWVariable<float> m_deltaSpacing ;
533 MWAWVariable<librevenge::RVNGUnit> m_deltaSpacingUnit ;
534 MWAWVariable<float> m_widthStreching ;
535 MWAWVariable<Script> m_scriptPosition ;
536 MWAWVariable<uint32_t> m_flags ;
537 MWAWVariable<Line> m_overline ;
538 MWAWVariable<Line> m_strikeoutline ;
539 MWAWVariable<Line> m_underline ;
540 MWAWVariable<MWAWColor> m_color ;
541 MWAWVariable<MWAWColor> m_backgroundColor ;
542 MWAWVariable<std::string> m_language ;
543 public:
545 std::string m_extra;
546 };
547
548
549 #endif
550 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWFont::Line::Simple
Definition: MWAWFont.hxx:49
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:290
MWAWFont::setStrikeOutColor
void setStrikeOutColor(MWAWColor const &color)
sets the strikeoutline color
Definition: MWAWFont.hxx:426
MWAWFont::m_color
MWAWVariable< MWAWColor > m_color
font color
Definition: MWAWFont.hxx:540
MWAWFont::setFont
void setFont(int newId)
sets the font id and resets size to the previous size for this font
Definition: MWAWFont.hxx:229
MWAWFont::script
Script const & script() const
returns the script position
Definition: MWAWFont.hxx:284
MWAWFont::setUnderlineType
void setUnderlineType(Line::Type type=Line::Single)
sets the underline type
Definition: MWAWFont.hxx:450
MWAWFont::Line::Dash
Definition: MWAWFont.hxx:49
MWAWFont::Line::Type
Type
the line style
Definition: MWAWFont.hxx:51
MWAWFont::Line::m_color
MWAWVariable< MWAWColor > m_color
the color ( if not set, we use the font color )
Definition: MWAWFont.hxx:97
MWAWFont::boldBit
Definition: MWAWFont.hxx:182
MWAWFont::resetColor
void resetColor()
resets the font color to black and the background color to white
Definition: MWAWFont.hxx:333
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:165
MWAWFont::smallCapsBit
Definition: MWAWFont.hxx:184
MWAWFont::hasDecorationLines
bool hasDecorationLines() const
return true if the font has decorations line (overline, strikeout, underline)
Definition: MWAWFont.hxx:340
MWAWFont::Line::Triple
Definition: MWAWFont.hxx:51
MWAWFont::Line::Wave
Definition: MWAWFont.hxx:49
librevenge
Definition: MWAWDocument.hxx:56
libmwaw_internal.hxx
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:225
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:403
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:364
MWAWFont::addTo
void addTo(librevenge::RVNGPropertyList &propList, shared_ptr< MWAWFontConverter > fontConverter) const
add to the propList
Definition: MWAWFont.cxx:233
MWAWFont::Script::operator<=
bool operator<=(Script const &oth) const
operator<=
Definition: MWAWFont.hxx:150
MWAWFont::m_widthStreching
MWAWVariable< float > m_widthStreching
the width streching in percent
Definition: MWAWFont.hxx:534
MWAWFont::hasColor
bool hasColor() const
returns true if the font color is not black
Definition: MWAWFont.hxx:307
MWAWFont::setDeltaLetterSpacing
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
sets the letter spacing ( delta value in point )
Definition: MWAWFont.hxx:268
MWAWFont::m_overline
MWAWVariable< Line > m_overline
overline attributes
Definition: MWAWFont.hxx:537
MWAWFont::m_extra
std::string m_extra
extra data
Definition: MWAWFont.hxx:545
MWAWFont::Line::m_type
Type m_type
the type
Definition: MWAWFont.hxx:91
MWAWFont::deltaLetterSpacing
float deltaLetterSpacing() const
returns the condensed(negative)/extended(positive) width
Definition: MWAWFont.hxx:258
MWAWFont::FontBits
FontBits
the different font bit
Definition: MWAWFont.hxx:182
MWAWVariable::get
T const & get() const
return the current value
Definition: libmwaw_internal.hxx:567
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:220
MWAWFont::id
int id() const
returns the font id
Definition: MWAWFont.hxx:236
MWAWVariable::insert
void insert(MWAWVariable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:537
MWAWFont::setWidthStreching
void setWidthStreching(float scale=1.0)
sets the text width streching
Definition: MWAWFont.hxx:279
MWAWFont::outlineBit
Definition: MWAWFont.hxx:183
MWAWFont::embossBit
Definition: MWAWFont.hxx:182
MWAWFont::Line::None
Definition: MWAWFont.hxx:49
MWAWFont::uppercaseBit
Definition: MWAWFont.hxx:184
MWAWFont::resetDecorationLines
void resetDecorationLines()
reset the decoration
Definition: MWAWFont.hxx:347
MWAWFont::setUnderlineColor
void setUnderlineColor(MWAWColor const &color)
sets the underline color
Definition: MWAWFont.hxx:465
MWAWFont::Line::isSet
bool isSet() const
return true if the line is not empty
Definition: MWAWFont.hxx:56
MWAWFont::Line::operator<<
friend std::ostream & operator<<(std::ostream &o, Line const &line)
operator<<
Definition: MWAWFont.cxx:48
MWAWFont::widthStreching
float widthStreching() const
returns the text width streching
Definition: MWAWFont.hxx:274
MWAWFont::Script::super
static Script super()
return a yposition which correspond to a basic superscript
Definition: MWAWFont.hxx:122
MWAWFont::Line::Single
Definition: MWAWFont.hxx:51
MWAWFont::engraveBit
Definition: MWAWFont.hxx:182
MWAWFont::reverseWritingBit
Definition: MWAWFont.hxx:189
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:176
MWAWFont::boxedRoundedBit
Definition: MWAWFont.hxx:188
MWAWFont::initialcaseBit
Definition: MWAWFont.hxx:186
MWAWFont::Line::m_style
Style m_style
the style
Definition: MWAWFont.hxx:89
MWAWFont::Script::sub
static Script sub()
return a yposition which correspond to a basic subscript
Definition: MWAWFont.hxx:112
MWAWFont::shadowBit
Definition: MWAWFont.hxx:183
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:317
MWAWFont::Script::isSet
bool isSet() const
return true if the position is not default
Definition: MWAWFont.hxx:107
MWAWFont::Script::operator>=
bool operator>=(Script const &oth) const
operator>=
Definition: MWAWFont.hxx:160
MWAWFont::blinkBit
Definition: MWAWFont.hxx:182
MWAWFont::Line::operator==
bool operator==(Line const &oth) const
operator==
Definition: MWAWFont.hxx:65
MWAWFont::Line::Style
Style
the line style
Definition: MWAWFont.hxx:49
MWAWFont::Line::Double
Definition: MWAWFont.hxx:51
MWAWFont::setStrikeOutType
void setStrikeOutType(Line::Type type=Line::Single)
sets the strikeoutline type
Definition: MWAWFont.hxx:411
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:43
MWAWFont::getColor
void getColor(MWAWColor &c) const
returns the font color
Definition: MWAWFont.hxx:312
MWAWFont::setUnderline
void setUnderline(Line const &line)
sets the underline
Definition: MWAWFont.hxx:437
MWAWFont::setSize
void setSize(float sz)
sets the font size
Definition: MWAWFont.hxx:252
MWAWFont::Script::super100
static Script super100()
return a yposition which correspond to a basic superscript100
Definition: MWAWFont.hxx:127
MWAWFont::m_language
MWAWVariable< std::string > m_language
the language if set
Definition: MWAWFont.hxx:542
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:241
MWAWFont::Script::operator==
bool operator==(Script const &oth) const
operator==
Definition: MWAWFont.hxx:135
MWAWFont::Script::sub100
static Script sub100()
return a yposition which correspond to a basic subscript100
Definition: MWAWFont.hxx:117
MWAWFont::setOverline
void setOverline(Line const &line)
sets the overline
Definition: MWAWFont.hxx:359
MWAWFont::MWAWFont
MWAWFont(int newId=-1, float sz=12, uint32_t f=0)
constructor
Definition: MWAWFont.hxx:196
MWAWFont::m_deltaSpacing
MWAWVariable< float > m_deltaSpacing
expand(> 0), condensed(< 0) depl
Definition: MWAWFont.hxx:532
MWAWFont::getOverline
Line const & getOverline() const
returns the overline
Definition: MWAWFont.hxx:354
MWAWFont::cmp
int cmp(MWAWFont const &oth) const
a comparison function
Definition: MWAWFont.hxx:498
MWAWFont::m_id
MWAWVariable< int > m_id
font identificator
Definition: MWAWFont.hxx:530
MWAWFont::m_strikeoutline
MWAWVariable< Line > m_strikeoutline
overline attributes
Definition: MWAWFont.hxx:538
MWAWFont::m_underline
MWAWVariable< Line > m_underline
underline attributes
Definition: MWAWFont.hxx:539
MWAWFont::boxedBit
Definition: MWAWFont.hxx:187
MWAWFont::operator==
bool operator==(MWAWFont const &f) const
operator==
Definition: MWAWFont.hxx:487
MWAWFont::setUnderlineWidth
void setUnderlineWidth(float w)
sets the underline width
Definition: MWAWFont.hxx:460
MWAWFont::Line::Line
Line(Style style=None, Type type=Single, bool wordFlag=false, float w=1.0)
constructor
Definition: MWAWFont.hxx:53
MWAWFont::Script::m_delta
float m_delta
the ydelta
Definition: MWAWFont.hxx:174
MWAWFont::m_backgroundColor
MWAWVariable< MWAWColor > m_backgroundColor
font background color
Definition: MWAWFont.hxx:541
MWAWFont::Line::operator!=
bool operator!=(Line const &oth) const
operator!=
Definition: MWAWFont.hxx:70
MWAWFont::Script::m_scale
int m_scale
the font scaling ( in percent )
Definition: MWAWFont.hxx:178
MWAWFont::Line::m_width
float m_width
the width in point
Definition: MWAWFont.hxx:95
MWAWFont::setOverlineWidth
void setOverlineWidth(float w)
sets the overline width
Definition: MWAWFont.hxx:382
MWAWFont::language
std::string const & language() const
returns the language
Definition: MWAWFont.hxx:471
MWAWFont::operator!=
bool operator!=(MWAWFont const &f) const
operator!=
Definition: MWAWFont.hxx:492
MWAWFont::flags
uint32_t flags() const
returns the font flags
Definition: MWAWFont.hxx:296
MWAWFont::m_scriptPosition
MWAWVariable< Script > m_scriptPosition
the sub/super script definition
Definition: MWAWFont.hxx:535
MWAWFont::Script::operator!=
bool operator!=(Script const &oth) const
operator!=
Definition: MWAWFont.hxx:140
MWAWFont::m_size
MWAWVariable< float > m_size
font size
Definition: MWAWFont.hxx:531
MWAWFont::m_deltaSpacingUnit
MWAWVariable< librevenge::RVNGUnit > m_deltaSpacingUnit
the delta spacing unit
Definition: MWAWFont.hxx:533
MWAWFont::italicBit
Definition: MWAWFont.hxx:182
MWAWFont::setOverlineType
void setOverlineType(Line::Type type=Line::Single)
sets the overline type
Definition: MWAWFont.hxx:372
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:387
MWAWFont::Line::cmp
int cmp(Line const &oth) const
small comparison function
Definition: MWAWFont.hxx:75
MWAWFont::Line::m_word
bool m_word
word or not word line
Definition: MWAWFont.hxx:93
MWAWFont::setUnderlineWordFlag
void setUnderlineWordFlag(bool wordFlag=false)
sets the underline word flag
Definition: MWAWFont.hxx:455
MWAWFont::setStrikeOutWidth
void setStrikeOutWidth(float w)
sets the strikeoutline width
Definition: MWAWFont.hxx:421
MWAWFont::Line
a small struct to define a line in MWAWFont
Definition: MWAWFont.hxx:47
MWAWFont::Script::Script
Script(float delta=0, librevenge::RVNGUnit deltaUnit=librevenge::RVNG_PERCENT, int scale=100)
constructor
Definition: MWAWFont.hxx:102
MWAWFont::setOverlineWordFlag
void setOverlineWordFlag(bool wordFlag=false)
sets the overline word flag
Definition: MWAWFont.hxx:377
MWAWFont::Line::LargeDot
Definition: MWAWFont.hxx:49
MWAWFont::Script::operator<
bool operator<(Script const &oth) const
operator<
Definition: MWAWFont.hxx:145
MWAWFont::getBackgroundColor
void getBackgroundColor(MWAWColor &c) const
returns the font background color
Definition: MWAWFont.hxx:323
MWAWFont::getUnderline
Line const & getUnderline() const
returns the underline
Definition: MWAWFont.hxx:432
MWAWFont::Script::operator>
bool operator>(Script const &oth) const
operator>
Definition: MWAWFont.hxx:155
MWAWFont::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the font background color
Definition: MWAWFont.hxx:328
MWAWFont::Script::m_deltaUnit
librevenge::RVNGUnit m_deltaUnit
the ydelta unit ( point or percent )
Definition: MWAWFont.hxx:176
MWAWFont::setStrikeOutWordFlag
void setStrikeOutWordFlag(bool wordFlag=false)
sets the strikeoutline word flag
Definition: MWAWFont.hxx:416
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:247
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:301
MWAWFont::setStrikeOut
void setStrikeOut(Line const &line)
sets the strikeoutline
Definition: MWAWFont.hxx:398
MWAWFont::Line::Dot
Definition: MWAWFont.hxx:49
MWAWVariable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:572
MWAWFont::m_flags
MWAWVariable< uint32_t > m_flags
font attributes
Definition: MWAWFont.hxx:536
MWAWFont::insert
void insert(MWAWFont const &ft)
inserts the set value in the current font
Definition: MWAWFont.hxx:208
MWAWFont::lowercaseBit
Definition: MWAWFont.hxx:185
MWAWVariable< MWAWColor >
MWAWFont::isSet
bool isSet() const
returns true if the font id is initialized
Definition: MWAWFont.hxx:203
MWAWFont::reverseVideoBit
Definition: MWAWFont.hxx:184
MWAWFont::setLanguage
void setLanguage(std::string const &lang)
set the language ( in the for en_US, en_GB, en, ...)
Definition: MWAWFont.hxx:476
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:442
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:183
MWAWFont::getStrikeOut
Line const & getStrikeOut() const
returns the strikeoutline
Definition: MWAWFont.hxx:393
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:100
MWAWFont::deltaLetterSpacingUnit
librevenge::RVNGUnit deltaLetterSpacingUnit() const
returns the condensed(negative)/extended(positive) unit
Definition: MWAWFont.hxx:263