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_width(w), m_color(MWAWColor::black()), m_word(wordFlag) { }
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 float m_width;
95 MWAWVariable<MWAWColor> m_color;
97 bool m_word;
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_sizeIsRelative(false), 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_sizeIsRelative.insert(ft.m_sizeIsRelative);
213 m_deltaSpacing.insert(ft.m_deltaSpacing);
214 m_deltaSpacingUnit.insert(ft.m_deltaSpacingUnit);
215 m_widthStreching.insert(ft.m_widthStreching);
216 m_scriptPosition.insert(ft.m_scriptPosition);
217 if (ft.m_flags.isSet()) {
218 if (m_flags.isSet())
219 setFlags(flags()| ft.flags());
220 else
221 m_flags = ft.m_flags;
222 }
223 m_overline.insert(ft.m_overline);
224 m_strikeoutline.insert(ft.m_strikeoutline);
225 m_underline.insert(ft.m_underline);
226 m_color.insert(ft.m_color);
227 m_backgroundColor.insert(ft.m_backgroundColor);
228 m_extra += ft.m_extra;
229 }
231 void setFont(int newId)
232 {
233 resetColor();
234 m_id=newId;
235 }
236
238 int id() const
239 {
240 return m_id.get();
241 }
243 void setId(int newId)
244 {
245 m_id = newId;
246 }
247
249 float size() const
250 {
251 return m_size.get();
252 }
254 void setSize(float sz, bool isRelative=false)
255 {
256 m_size = sz;
257 m_sizeIsRelative = isRelative;
258 }
259
261 float deltaLetterSpacing() const
262 {
263 return m_deltaSpacing.get();
264 }
266 librevenge::RVNGUnit deltaLetterSpacingUnit() const
267 {
268 return m_deltaSpacingUnit.get();
269 }
271 void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
272 {
273 m_deltaSpacing=d;
274 m_deltaSpacingUnit=unit;
275 }
277 float widthStreching() const
278 {
279 return m_widthStreching.get();
280 }
282 void setWidthStreching(float scale=1.0)
283 {
284 m_widthStreching = scale;
285 }
287 Script const &script() const
288 {
289 return m_scriptPosition.get();
290 }
291
293 void set(Script const &newscript)
294 {
295 m_scriptPosition = newscript;
296 }
297
299 uint32_t flags() const
300 {
301 return m_flags.get();
302 }
304 void setFlags(uint32_t fl)
305 {
306 m_flags = fl;
307 }
308
310 bool hasColor() const
311 {
312 return m_color.isSet() && !m_color.get().isBlack();
313 }
315 void getColor(MWAWColor &c) const
316 {
317 c = m_color.get();
318 }
320 void setColor(MWAWColor color)
321 {
322 m_color = color;
323 }
324
326 void getBackgroundColor(MWAWColor &c) const
327 {
328 c = m_backgroundColor.get();
329 }
331 void setBackgroundColor(MWAWColor color)
332 {
333 m_backgroundColor = color;
334 }
336 void resetColor()
337 {
338 m_color = MWAWColor::black();
339 m_backgroundColor = MWAWColor::white();
340 }
341
343 bool hasDecorationLines() const
344 {
345 return (m_overline.isSet() && m_overline->isSet()) ||
346 (m_strikeoutline.isSet() && m_strikeoutline->isSet()) ||
347 (m_underline.isSet() && m_underline->isSet());
348 }
350 void resetDecorationLines()
351 {
352 if (m_overline.isSet()) m_overline=Line(Line::None);
353 if (m_strikeoutline.isSet()) m_strikeoutline=Line(Line::None);
354 if (m_underline.isSet()) m_underline=Line(Line::None);
355 }
357 Line const &getOverline() const
358 {
359 return m_overline.get();
360 }
362 void setOverline(Line const &line)
363 {
364 m_overline = line;
365 }
367 void setOverlineStyle(Line::Style style=Line::None, bool doReset=true)
368 {
369 if (doReset)
370 m_overline = Line(style);
371 else
372 m_overline->m_style = style;
373 }
375 void setOverlineType(Line::Type type=Line::Single)
376 {
377 m_overline->m_type = type;
378 }
380 void setOverlineWordFlag(bool wordFlag=false)
381 {
382 m_overline->m_word = wordFlag;
383 }
385 void setOverlineWidth(float w)
386 {
387 m_overline->m_width = w;
388 }
390 void setOverlineColor(MWAWColor const &color)
391 {
392 m_overline->m_color = color;
393 }
394
396 Line const &getStrikeOut() const
397 {
398 return m_strikeoutline.get();
399 }
401 void setStrikeOut(Line const &line)
402 {
403 m_strikeoutline = line;
404 }
406 void setStrikeOutStyle(Line::Style style=Line::None, bool doReset=true)
407 {
408 if (doReset)
409 m_strikeoutline = Line(style);
410 else
411 m_strikeoutline->m_style = style;
412 }
414 void setStrikeOutType(Line::Type type=Line::Single)
415 {
416 m_strikeoutline->m_type = type;
417 }
419 void setStrikeOutWordFlag(bool wordFlag=false)
420 {
421 m_strikeoutline->m_word = wordFlag;
422 }
424 void setStrikeOutWidth(float w)
425 {
426 m_strikeoutline->m_width = w;
427 }
429 void setStrikeOutColor(MWAWColor const &color)
430 {
431 m_strikeoutline->m_color = color;
432 }
433
435 Line const &getUnderline() const
436 {
437 return m_underline.get();
438 }
440 void setUnderline(Line const &line)
441 {
442 m_underline = line;
443 }
445 void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
446 {
447 if (doReset)
448 m_underline = Line(style);
449 else
450 m_underline->m_style = style;
451 }
453 void setUnderlineType(Line::Type type=Line::Single)
454 {
455 m_underline->m_type = type;
456 }
458 void setUnderlineWordFlag(bool wordFlag=false)
459 {
460 m_underline->m_word = wordFlag;
461 }
463 void setUnderlineWidth(float w)
464 {
465 m_underline->m_width = w;
466 }
468 void setUnderlineColor(MWAWColor const &color)
469 {
470 m_underline->m_color = color;
471 }
472
474 std::string const &language() const
475 {
476 return m_language.get();
477 }
479 void setLanguage(std::string const &lang)
480 {
481 m_language=lang;
482 }
484 void addTo(librevenge::RVNGPropertyList &propList, shared_ptr<MWAWFontConverter> fontConverter) const;
486 void addToListLevel(librevenge::RVNGPropertyList &propList, shared_ptr<MWAWFontConverter> fontConverter) const;
487
489 std::string getDebugString(shared_ptr<MWAWFontConverter> &converter) const;
490
492 bool operator==(MWAWFont const &f) const
493 {
494 return cmp(f) == 0;
495 }
497 bool operator!=(MWAWFont const &f) const
498 {
499 return cmp(f) != 0;
500 }
501
503 int cmp(MWAWFont const &oth) const
504 {
505 int diff = id() - oth.id();
506 if (diff != 0) return diff;
507 if (size() < oth.size()) return -1;
508 if (size() > oth.size()) return 1;
509 if (m_sizeIsRelative.get() != oth.m_sizeIsRelative.get()) return m_sizeIsRelative.get() ? 1 : -1;
510 if (flags() < oth.flags()) return -1;
511 if (flags() > oth.flags()) return 1;
512 if (m_deltaSpacing.get() < oth.m_deltaSpacing.get()) return -1;
513 if (m_deltaSpacing.get() > oth.m_deltaSpacing.get()) return 1;
514 if (m_deltaSpacingUnit.get() < oth.m_deltaSpacingUnit.get()) return -1;
515 if (m_deltaSpacingUnit.get() > oth.m_deltaSpacingUnit.get()) return 1;
516 if (m_widthStreching.get() < oth.m_widthStreching.get()) return -1;
517 if (m_widthStreching.get() > oth.m_widthStreching.get()) return 1;
518 diff = script().cmp(oth.script());
519 if (diff != 0) return diff;
520 diff = m_overline.get().cmp(oth.m_overline.get());
521 if (diff != 0) return diff;
522 diff = m_strikeoutline.get().cmp(oth.m_strikeoutline.get());
523 if (diff != 0) return diff;
524 diff = m_underline.get().cmp(oth.m_underline.get());
525 if (diff != 0) return diff;
526 if (m_color.get() < oth.m_color.get()) return -1;
527 if (m_color.get() > oth.m_color.get()) return 1;
528 if (m_backgroundColor.get() < oth.m_backgroundColor.get()) return -1;
529 if (m_backgroundColor.get() > oth.m_backgroundColor.get()) return 1;
530 if (m_language.get() < oth.m_language.get()) return -1;
531 if (m_language.get() > oth.m_language.get()) return 1;
532 return diff;
533 }
534
535 protected:
536 MWAWVariable<int> m_id ;
537 MWAWVariable<float> m_size ;
538 MWAWVariable<bool> m_sizeIsRelative ;
539 MWAWVariable<float> m_deltaSpacing ;
540 MWAWVariable<librevenge::RVNGUnit> m_deltaSpacingUnit ;
541 MWAWVariable<float> m_widthStreching ;
542 MWAWVariable<Script> m_scriptPosition ;
543 MWAWVariable<uint32_t> m_flags ;
544 MWAWVariable<Line> m_overline ;
545 MWAWVariable<Line> m_strikeoutline ;
546 MWAWVariable<Line> m_underline ;
547 MWAWVariable<MWAWColor> m_color ;
548 MWAWVariable<MWAWColor> m_backgroundColor ;
549 MWAWVariable<std::string> m_language ;
550 public:
552 std::string m_extra;
553 };
554
555 namespace MWAWFontManagerInternal
556 {
557 struct State;
558 }
559
561 class MWAWFontManager
562 {
563 public:
565 explicit MWAWFontManager(shared_ptr<MWAWFontConverter> fontConverter);
567 ~MWAWFontManager();
569 int getId(MWAWFont const &font);
571 bool getFont(int id, MWAWFont &font) const;
573 shared_ptr<MWAWFontConverter> getFontConverter();
574 protected:
576 shared_ptr<MWAWFontManagerInternal::State> m_state;
577 private:
578 MWAWFontManager(MWAWFontManager const &);
579 MWAWFontManager &operator=(MWAWFontManager const &);
580 };
581 #endif
582 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWFont::m_sizeIsRelative
MWAWVariable< bool > m_sizeIsRelative
true if the size is percent
Definition: MWAWFont.hxx:538
MWAWFont::Line::Simple
Definition: MWAWFont.hxx:49
MWAWFont::Script::operator<
bool operator<(Script const &oth) const
operator<
Definition: MWAWFont.hxx:145
MWAWFont::setStrikeOutColor
void setStrikeOutColor(MWAWColor const &color)
sets the strikeoutline color
Definition: MWAWFont.hxx:429
MWAWFont::m_color
MWAWVariable< MWAWColor > m_color
font color
Definition: MWAWFont.hxx:547
MWAWFont::setFont
void setFont(int newId)
sets the font id and resets size to the previous size for this font
Definition: MWAWFont.hxx:231
MWAWFont::language
std::string const & language() const
returns the language
Definition: MWAWFont.hxx:474
MWAWFont::isSet
bool isSet() const
returns true if the font id is initialized
Definition: MWAWFont.hxx:203
MWAWFont::deltaLetterSpacingUnit
librevenge::RVNGUnit deltaLetterSpacingUnit() const
returns the condensed(negative)/extended(positive) unit
Definition: MWAWFont.hxx:266
MWAWFont::setUnderlineType
void setUnderlineType(Line::Type type=Line::Single)
sets the underline type
Definition: MWAWFont.hxx:453
MWAWFont::Line::isSet
bool isSet() const
return true if the line is not empty
Definition: MWAWFont.hxx:56
MWAWFont::operator==
bool operator==(MWAWFont const &f) const
operator==
Definition: MWAWFont.hxx:492
MWAWFont::Line::cmp
int cmp(Line const &oth) const
small comparison function
Definition: MWAWFont.hxx:75
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:95
MWAWFontManager::m_state
shared_ptr< MWAWFontManagerInternal::State > m_state
the state
Definition: MWAWFont.hxx:576
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:336
MWAWFont::smallCapsBit
Definition: MWAWFont.hxx:184
MWAWFontManager
a font manager which can be used to store fonts, ...
Definition: MWAWFont.hxx:561
MWAWFont::getOverline
Line const & getOverline() const
returns the overline
Definition: MWAWFont.hxx:357
MWAWVariable::get
T const & get() const
return the current value
Definition: libmwaw_internal.hxx:595
MWAWFont::Line::Triple
Definition: MWAWFont.hxx:51
MWAWFont::Line::Wave
Definition: MWAWFont.hxx:49
librevenge
Definition: MWAWDocument.hxx:56
libmwaw_internal.hxx
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:279
MWAWFont::getBackgroundColor
void getBackgroundColor(MWAWColor &c) const
returns the font background color
Definition: MWAWFont.hxx:326
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:245
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:406
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:367
MWAWFont::Script::cmp
int cmp(Script const &oth) const
small comparison function
Definition: MWAWFont.hxx:165
MWAWFont::m_widthStreching
MWAWVariable< float > m_widthStreching
the width streching in percent
Definition: MWAWFont.hxx:541
MWAWFont::setDeltaLetterSpacing
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
sets the letter spacing ( delta value in point )
Definition: MWAWFont.hxx:271
MWAWFont::m_overline
MWAWVariable< Line > m_overline
overline attributes
Definition: MWAWFont.hxx:544
MWAWFont::m_extra
std::string m_extra
extra data
Definition: MWAWFont.hxx:552
MWAWFontManagerInternal
namespace used to define structure for the font manager
Definition: MWAWFont.cxx:387
MWAWFont::Line::m_type
Type m_type
the type
Definition: MWAWFont.hxx:91
MWAWFont::Script::operator>
bool operator>(Script const &oth) const
operator>
Definition: MWAWFont.hxx:155
MWAWFont::FontBits
FontBits
the different font bit
Definition: MWAWFont.hxx:182
MWAWFont::Script::operator!=
bool operator!=(Script const &oth) const
operator!=
Definition: MWAWFont.hxx:140
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:240
MWAWVariable::insert
void insert(MWAWVariable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:565
MWAWFont::setWidthStreching
void setWidthStreching(float scale=1.0)
sets the text width streching
Definition: MWAWFont.hxx:282
MWAWFont::id
int id() const
returns the font id
Definition: MWAWFont.hxx:238
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::getStrikeOut
Line const & getStrikeOut() const
returns the strikeoutline
Definition: MWAWFont.hxx:396
MWAWFont::resetDecorationLines
void resetDecorationLines()
reset the decoration
Definition: MWAWFont.hxx:350
MWAWFont::setUnderlineColor
void setUnderlineColor(MWAWColor const &color)
sets the underline color
Definition: MWAWFont.hxx:468
MWAWFont::Line::operator<<
friend std::ostream & operator<<(std::ostream &o, Line const &line)
operator<<
Definition: MWAWFont.cxx:49
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
MWAWVariable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:600
MWAWFont::engraveBit
Definition: MWAWFont.hxx:182
MWAWFont::reverseWritingBit
Definition: MWAWFont.hxx:189
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:196
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:320
MWAWFont::blinkBit
Definition: MWAWFont.hxx:182
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:249
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:414
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:43
MWAWFont::getDebugString
std::string getDebugString(shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
MWAWFont::Line::operator==
bool operator==(Line const &oth) const
operator==
Definition: MWAWFont.hxx:65
MWAWFont::hasDecorationLines
bool hasDecorationLines() const
return true if the font has decorations line (overline, strikeout, underline)
Definition: MWAWFont.hxx:343
MWAWFont::setUnderline
void setUnderline(Line const &line)
sets the underline
Definition: MWAWFont.hxx:440
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:549
MWAWFont::operator!=
bool operator!=(MWAWFont const &f) const
operator!=
Definition: MWAWFont.hxx:497
MWAWFont::Script::operator<=
bool operator<=(Script const &oth) const
operator<=
Definition: MWAWFont.hxx:150
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:243
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:96
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:362
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:539
MWAWFont::m_id
MWAWVariable< int > m_id
font identificator
Definition: MWAWFont.hxx:536
MWAWFont::m_strikeoutline
MWAWVariable< Line > m_strikeoutline
overline attributes
Definition: MWAWFont.hxx:545
MWAWFont::m_underline
MWAWVariable< Line > m_underline
underline attributes
Definition: MWAWFont.hxx:546
MWAWFont::addToListLevel
void addToListLevel(librevenge::RVNGPropertyList &propList, shared_ptr< MWAWFontConverter > fontConverter) const
add to the propList to a list level
Definition: MWAWFont.cxx:355
MWAWFont::boxedBit
Definition: MWAWFont.hxx:187
MWAWFont::setUnderlineWidth
void setUnderlineWidth(float w)
sets the underline width
Definition: MWAWFont.hxx:463
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:548
MWAWFont::script
Script const & script() const
returns the script position
Definition: MWAWFont.hxx:287
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:93
MWAWFont::setOverlineWidth
void setOverlineWidth(float w)
sets the overline width
Definition: MWAWFont.hxx:385
MWAWFont::getColor
void getColor(MWAWColor &c) const
returns the font color
Definition: MWAWFont.hxx:315
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:254
MWAWFont::m_scriptPosition
MWAWVariable< Script > m_scriptPosition
the sub/super script definition
Definition: MWAWFont.hxx:542
MWAWFont::Script::isSet
bool isSet() const
return true if the position is not default
Definition: MWAWFont.hxx:107
MWAWFont::m_size
MWAWVariable< float > m_size
font size
Definition: MWAWFont.hxx:537
MWAWFont::m_deltaSpacingUnit
MWAWVariable< librevenge::RVNGUnit > m_deltaSpacingUnit
the delta spacing unit
Definition: MWAWFont.hxx:540
MWAWFont::italicBit
Definition: MWAWFont.hxx:182
MWAWFont::flags
uint32_t flags() const
returns the font flags
Definition: MWAWFont.hxx:299
MWAWFont::setOverlineType
void setOverlineType(Line::Type type=Line::Single)
sets the overline type
Definition: MWAWFont.hxx:375
MWAWFont::Line::operator!=
bool operator!=(Line const &oth) const
operator!=
Definition: MWAWFont.hxx:70
MWAWFont::setOverlineColor
void setOverlineColor(MWAWColor const &color)
sets the overline color
Definition: MWAWFont.hxx:390
MWAWFont::getUnderline
Line const & getUnderline() const
returns the underline
Definition: MWAWFont.hxx:435
MWAWFont::Line::m_word
bool m_word
word or not word line
Definition: MWAWFont.hxx:97
MWAWFont::setUnderlineWordFlag
void setUnderlineWordFlag(bool wordFlag=false)
sets the underline word flag
Definition: MWAWFont.hxx:458
MWAWFont::setStrikeOutWidth
void setStrikeOutWidth(float w)
sets the strikeoutline width
Definition: MWAWFont.hxx:424
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:380
MWAWFont::Line::LargeDot
Definition: MWAWFont.hxx:49
MWAWFont::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the font background color
Definition: MWAWFont.hxx:331
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:419
MWAWFont::Script::operator==
bool operator==(Script const &oth) const
operator==
Definition: MWAWFont.hxx:135
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:304
MWAWFont::deltaLetterSpacing
float deltaLetterSpacing() const
returns the condensed(negative)/extended(positive) width
Definition: MWAWFont.hxx:261
MWAWFont::cmp
int cmp(MWAWFont const &oth) const
a comparison function
Definition: MWAWFont.hxx:503
MWAWFont::setStrikeOut
void setStrikeOut(Line const &line)
sets the strikeoutline
Definition: MWAWFont.hxx:401
MWAWFont::Line::Dot
Definition: MWAWFont.hxx:49
MWAWFont::m_flags
MWAWVariable< uint32_t > m_flags
font attributes
Definition: MWAWFont.hxx:543
MWAWFont::Script::operator>=
bool operator>=(Script const &oth) const
operator>=
Definition: MWAWFont.hxx:160
MWAWFont::widthStreching
float widthStreching() const
returns the text width streching
Definition: MWAWFont.hxx:277
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::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:479
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:445
MWAWFont::hiddenBit
Definition: MWAWFont.hxx:183
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:100
MWAWFont::hasColor
bool hasColor() const
returns true if the font color is not black
Definition: MWAWFont.hxx:310