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 {
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  }
93  float m_width;
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 
183  hiddenBit=0x20, outlineBit=0x40, shadowBit=0x80,
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);
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);
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 
327  {
328  c = m_backgroundColor.get();
329  }
332  {
333  m_backgroundColor = color;
334  }
336  void resetColor()
337  {
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  }
351  {
352  if (m_overline.isSet()) m_overline=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  }
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  }
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  }
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:
550 public:
552  std::string m_extra;
553 };
554 
555 namespace MWAWFontManagerInternal
556 {
557 struct State;
558 }
559 
562 {
563 public:
565  explicit MWAWFontManager(shared_ptr<MWAWFontConverter> fontConverter);
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:
580 };
581 #endif
582 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWFont::setStrikeOut
void setStrikeOut(Line const &line)
sets the strikeoutline
Definition: MWAWFont.hxx:401
MWAWFont::FontBits
FontBits
the different font bit
Definition: MWAWFont.hxx:182
MWAWFont::reverseVideoBit
@ reverseVideoBit
Definition: MWAWFont.hxx:184
MWAWFontManagerInternal::FontToIdMap
std::map< MWAWFont, int, FontCompare > FontToIdMap
a map font to int
Definition: MWAWFont.cxx:400
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition: MWAWFont.hxx:293
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::setUnderlineType
void setUnderlineType(Line::Type type=Line::Single)
sets the underline type
Definition: MWAWFont.hxx:453
MWAWFont::Script::operator<=
bool operator<=(Script const &oth) const
operator<=
Definition: MWAWFont.hxx:150
MWAWFontManager::~MWAWFontManager
~MWAWFontManager()
destructor
Definition: MWAWFont.cxx:420
MWAWFont::insert
void insert(MWAWFont const &ft)
inserts the set value in the current font
Definition: MWAWFont.hxx:208
MWAWFont::smallCapsBit
@ smallCapsBit
Definition: MWAWFont.hxx:184
MWAWFont::Script::isSet
bool isSet() const
return true if the position is not default
Definition: MWAWFont.hxx:107
MWAWFont::Script::m_delta
float m_delta
the ydelta
Definition: MWAWFont.hxx:174
MWAW_DEBUG_MSG
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
MWAWFont::deltaLetterSpacingUnit
librevenge::RVNGUnit deltaLetterSpacingUnit() const
returns the condensed(negative)/extended(positive) unit
Definition: MWAWFont.hxx:266
MWAWVariable< MWAWColor >
MWAWFont::Line
a small struct to define a line in MWAWFont
Definition: MWAWFont.hxx:47
MWAWFont::resetColor
void resetColor()
resets the font color to black and the background color to white
Definition: MWAWFont.hxx:336
MWAWFont::hasColor
bool hasColor() const
returns true if the font color is not black
Definition: MWAWFont.hxx:310
MWAWFont::Script::sub100
static Script sub100()
return a yposition which correspond to a basic subscript100
Definition: MWAWFont.hxx:117
MWAWFont::id
int id() const
returns the font id
Definition: MWAWFont.hxx:238
MWAWFont::Script::Script
Script(float delta=0, librevenge::RVNGUnit deltaUnit=librevenge::RVNG_PERCENT, int scale=100)
constructor
Definition: MWAWFont.hxx:102
MWAWFont::boldBit
@ boldBit
Definition: MWAWFont.hxx:182
MWAWFontManager
a font manager which can be used to store fonts, ...
Definition: MWAWFont.hxx:562
MWAWFont::language
std::string const & language() const
returns the language
Definition: MWAWFont.hxx:474
MWAWColor::white
static MWAWColor white()
return the white color
Definition: libmwaw_internal.hxx:231
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition: MWAWFont.hxx:320
MWAWFontManagerInternal::State::m_fontToSpanIdMap
FontToIdMap m_fontToSpanIdMap
a map font to id map (used to retrieve span id)
Definition: MWAWFont.cxx:410
MWAWFont::addTo
void addTo(librevenge::RVNGPropertyList &propList, shared_ptr< MWAWFontConverter > fontConverter) const
add to the propList
Definition: MWAWFont.cxx:245
MWAWFont::setWidthStreching
void setWidthStreching(float scale=1.0)
sets the text width streching
Definition: MWAWFont.hxx:282
MWAWFontConverter.hxx
MWAWColor
the class to store a color
Definition: libmwaw_internal.hxx:182
MWAWFont::getBackgroundColor
void getBackgroundColor(MWAWColor &c) const
returns the font background color
Definition: MWAWFont.hxx:326
MWAWFont::outlineBit
@ outlineBit
Definition: MWAWFont.hxx:183
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
MWAWFontManagerInternal
namespace used to define structure for the font manager
Definition: MWAWFont.cxx:388
MWAWColor::str
std::string str() const
print the color in the form #rrggbb
Definition: libmwaw_internal.cxx:231
MWAWFontManager::m_state
shared_ptr< MWAWFontManagerInternal::State > m_state
the state
Definition: MWAWFont.hxx:576
MWAWFont::Script::str
std::string str(float fSize) const
return a string which correspond to style:text-position
Definition: MWAWFont.cxx:148
MWAWFont::Line::Simple
@ Simple
Definition: MWAWFont.hxx:49
MWAWFont::Line::Triple
@ Triple
Definition: MWAWFont.hxx:51
MWAWFont::Line::cmp
int cmp(Line const &oth) const
small comparison function
Definition: MWAWFont.hxx:75
MWAWFont::setUnderline
void setUnderline(Line const &line)
sets the underline
Definition: MWAWFont.hxx:440
MWAWFont::Line::Type
Type
the line style
Definition: MWAWFont.hxx:51
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::engraveBit
@ engraveBit
Definition: MWAWFont.hxx:182
MWAWFont::reverseWritingBit
@ reverseWritingBit
Definition: MWAWFont.hxx:189
MWAWFont::resetDecorationLines
void resetDecorationLines()
reset the decoration
Definition: MWAWFont.hxx:350
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::Line::isSet
bool isSet() const
return true if the line is not empty
Definition: MWAWFont.hxx:56
MWAWFontManagerInternal::State::State
State(shared_ptr< MWAWFontConverter > fontConverter)
constructor
Definition: MWAWFont.cxx:404
MWAWFontManager::getId
int getId(MWAWFont const &font)
returns a span id which can be used to call the list
Definition: MWAWFont.cxx:429
MWAWFont::getOverline
Line const & getOverline() const
returns the overline
Definition: MWAWFont.hxx:357
MWAWFont::Script::super100
static Script super100()
return a yposition which correspond to a basic superscript100
Definition: MWAWFont.hxx:127
MWAWFont::setUnderlineColor
void setUnderlineColor(MWAWColor const &color)
sets the underline color
Definition: MWAWFont.hxx:468
MWAWFont::embossBit
@ embossBit
Definition: MWAWFont.hxx:182
MWAWFont::uppercaseBit
@ uppercaseBit
Definition: MWAWFont.hxx:184
MWAWFontManagerInternal::FontCompare
internal struct used to create sorted map of font
Definition: MWAWFont.cxx:392
MWAWFont::Line::Wave
@ Wave
Definition: MWAWFont.hxx:49
MWAWFont::setStrikeOutType
void setStrikeOutType(Line::Type type=Line::Single)
sets the strikeoutline type
Definition: MWAWFont.hxx:414
MWAWFont::m_id
MWAWVariable< int > m_id
font identificator
Definition: MWAWFont.hxx:536
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
MWAWVariable::isSet
bool isSet() const
return true if the variable is set
Definition: libmwaw_internal.hxx:586
MWAWFont::Script::operator<
bool operator<(Script const &oth) const
operator<
Definition: MWAWFont.hxx:145
MWAWFont::getStrikeOut
Line const & getStrikeOut() const
returns the strikeoutline
Definition: MWAWFont.hxx:396
MWAWFont::setUnderlineWidth
void setUnderlineWidth(float w)
sets the underline width
Definition: MWAWFont.hxx:463
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
MWAWFont::initialcaseBit
@ initialcaseBit
Definition: MWAWFont.hxx:186
MWAWFont::boxedRoundedBit
@ boxedRoundedBit
Definition: MWAWFont.hxx:188
MWAWFont::Line::m_width
float m_width
the width in point
Definition: MWAWFont.hxx:93
MWAWFont::Line::Line
Line(Style style=None, Type type=Single, bool wordFlag=false, float w=1.0)
constructor
Definition: MWAWFont.hxx:53
MWAWFont::Line::None
@ None
Definition: MWAWFont.hxx:49
MWAWFont::shadowBit
@ shadowBit
Definition: MWAWFont.hxx:183
MWAWFont::Line::m_type
Type m_type
the type
Definition: MWAWFont.hxx:91
MWAWFont::getDebugString
std::string getDebugString(shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition: MWAWFont.cxx:181
MWAWFont::getColor
void getColor(MWAWColor &c) const
returns the font color
Definition: MWAWFont.hxx:315
libmwaw_internal.hxx
MWAWPosition.hxx
MWAWFont::blinkBit
@ blinkBit
Definition: MWAWFont.hxx:182
MWAWFont::Script::operator==
bool operator==(Script const &oth) const
operator==
Definition: MWAWFont.hxx:135
MWAWFont::Script::operator>=
bool operator>=(Script const &oth) const
operator>=
Definition: MWAWFont.hxx:160
MWAWColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libmwaw_internal.hxx:265
MWAWFont::Line::operator<<
friend std::ostream & operator<<(std::ostream &o, Line const &line)
operator<<
Definition: MWAWFont.cxx:49
MWAWFont::Script::m_deltaUnit
librevenge::RVNGUnit m_deltaUnit
the ydelta unit ( point or percent )
Definition: MWAWFont.hxx:176
MWAWFont::Line::operator!=
bool operator!=(Line const &oth) const
operator!=
Definition: MWAWFont.hxx:70
MWAWFont::size
float size() const
returns the font size
Definition: MWAWFont.hxx:249
MWAWFont::boxedBit
@ boxedBit
Definition: MWAWFont.hxx:187
MWAWFontManagerInternal::FontCompare::operator()
bool operator()(MWAWFont const &s1, MWAWFont const &s2) const
comparaison function
Definition: MWAWFont.cxx:394
MWAWFont::hasDecorationLines
bool hasDecorationLines() const
return true if the font has decorations line (overline, strikeout, underline)
Definition: MWAWFont.hxx:343
MWAWFontManager::operator=
MWAWFontManager & operator=(MWAWFontManager const &)
MWAWFont::MWAWFont
MWAWFont(int newId=-1, float sz=12, uint32_t f=0)
constructor
Definition: MWAWFont.hxx:196
MWAWFont::m_strikeoutline
MWAWVariable< Line > m_strikeoutline
overline attributes
Definition: MWAWFont.hxx:545
MWAWVariable::insert
void insert(MWAWVariable const &orig)
update the current value if orig is set
Definition: libmwaw_internal.hxx:551
MWAWFont::Script::operator!=
bool operator!=(Script const &oth) const
operator!=
Definition: MWAWFont.hxx:140
MWAWFont::addToListLevel
void addToListLevel(librevenge::RVNGPropertyList &propList, shared_ptr< MWAWFontConverter > fontConverter) const
add to the propList to a list level
Definition: MWAWFont.cxx:355
MWAWColor::black
static MWAWColor black()
return the back color
Definition: libmwaw_internal.hxx:226
MWAWFont::setOverlineWidth
void setOverlineWidth(float w)
sets the overline width
Definition: MWAWFont.hxx:385
MWAWFont::Line::Single
@ Single
Definition: MWAWFont.hxx:51
MWAWFont::Line::m_style
Style m_style
the style
Definition: MWAWFont.hxx:89
MWAWFont::setId
void setId(int newId)
sets the font id
Definition: MWAWFont.hxx:243
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::Line::m_word
bool m_word
word or not word line
Definition: MWAWFont.hxx:97
MWAWFont::Script::cmp
int cmp(Script const &oth) const
small comparison function
Definition: MWAWFont.hxx:165
MWAWFont::Script::sub
static Script sub()
return a yposition which correspond to a basic subscript
Definition: MWAWFont.hxx:112
MWAWFont::m_deltaSpacing
MWAWVariable< float > m_deltaSpacing
expand(> 0), condensed(< 0) depl
Definition: MWAWFont.hxx:539
MWAWFont::setOverline
void setOverline(Line const &line)
sets the overline
Definition: MWAWFont.hxx:362
MWAWFont::Script::operator>
bool operator>(Script const &oth) const
operator>
Definition: MWAWFont.hxx:155
MWAWFont::Line::Style
Style
the line style
Definition: MWAWFont.hxx:49
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition: MWAWFont.hxx:254
MWAWFontManagerInternal::State::m_fontConverter
shared_ptr< MWAWFontConverter > m_fontConverter
the font converter
Definition: MWAWFont.cxx:408
MWAWFont::Line::operator==
bool operator==(Line const &oth) const
operator==
Definition: MWAWFont.hxx:65
MWAWFont::setOverlineType
void setOverlineType(Line::Type type=Line::Single)
sets the overline type
Definition: MWAWFont.hxx:375
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::setOverlineWordFlag
void setOverlineWordFlag(bool wordFlag=false)
sets the overline word flag
Definition: MWAWFont.hxx:380
MWAWFont::italicBit
@ italicBit
Definition: MWAWFont.hxx:182
MWAWFont::Line::Dot
@ Dot
Definition: MWAWFont.hxx:49
MWAWFont::m_scriptPosition
MWAWVariable< Script > m_scriptPosition
the sub/super script definition
Definition: MWAWFont.hxx:542
MWAWTextListener.hxx
MWAWFontManagerInternal::State
the state of a MWAWFontManager
Definition: MWAWFont.cxx:402
MWAWFont::deltaLetterSpacing
float deltaLetterSpacing() const
returns the condensed(negative)/extended(positive) width
Definition: MWAWFont.hxx:261
MWAWFont::Script::super
static Script super()
return a yposition which correspond to a basic superscript
Definition: MWAWFont.hxx:122
MWAWVariable::get
T const & get() const
return the current value
Definition: libmwaw_internal.hxx:581
MWAWFont::m_underline
MWAWVariable< Line > m_underline
underline attributes
Definition: MWAWFont.hxx:546
MWAWFont::setStrikeOutColor
void setStrikeOutColor(MWAWColor const &color)
sets the strikeoutline color
Definition: MWAWFont.hxx:429
MWAWFont::getUnderline
Line const & getUnderline() const
returns the underline
Definition: MWAWFont.hxx:435
MWAWFont::m_size
MWAWVariable< float > m_size
font size
Definition: MWAWFont.hxx:537
MWAWFont::m_flags
MWAWVariable< uint32_t > m_flags
font attributes
Definition: MWAWFont.hxx:543
MWAWFontManager::MWAWFontManager
MWAWFontManager(MWAWFontManager const &)
MWAWFont::setUnderlineWordFlag
void setUnderlineWordFlag(bool wordFlag=false)
sets the underline word flag
Definition: MWAWFont.hxx:458
MWAWFont::widthStreching
float widthStreching() const
returns the text width streching
Definition: MWAWFont.hxx:277
MWAWFont::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the font background color
Definition: MWAWFont.hxx:331
MWAWFontManager::getFont
bool getFont(int id, MWAWFont &font) const
returns the font corresponding to an id
Definition: MWAWFont.cxx:439
MWAWFont::Script
a small struct to define the script position in MWAWFont
Definition: MWAWFont.hxx:100
MWAWFontManagerInternal::State::m_idToFontMap
std::map< int, MWAWFont > m_idToFontMap
a map id to font map
Definition: MWAWFont.cxx:412
MWAWFont::Line::Double
@ Double
Definition: MWAWFont.hxx:51
MWAWColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libmwaw_internal.hxx:270
MWAWPosition::getScaleFactor
static float getScaleFactor(librevenge::RVNGUnit orig, librevenge::RVNGUnit dest)
Definition: MWAWPosition.hxx:143
MWAWFont.hxx
librevenge
Definition: MWAWDocument.hxx:57
MWAWFont::flags
uint32_t flags() const
returns the font flags
Definition: MWAWFont.hxx:299
MWAWFont::Line::Dash
@ Dash
Definition: MWAWFont.hxx:49
MWAWFont
Class to store font.
Definition: MWAWFont.hxx:44
MWAWFont::m_color
MWAWVariable< MWAWColor > m_color
font color
Definition: MWAWFont.hxx:547
MWAWFont::cmp
int cmp(MWAWFont const &oth) const
a comparison function
Definition: MWAWFont.hxx:503
MWAWFont::setLanguage
void setLanguage(std::string const &lang)
set the language ( in the for en_US, en_GB, en, ...)
Definition: MWAWFont.hxx:479
MWAWFont::Line::m_color
MWAWVariable< MWAWColor > m_color
the color ( if not set, we use the font color )
Definition: MWAWFont.hxx:95
MWAWFont::setStrikeOutWidth
void setStrikeOutWidth(float w)
sets the strikeoutline width
Definition: MWAWFont.hxx:424
MWAWFont::m_sizeIsRelative
MWAWVariable< bool > m_sizeIsRelative
true if the size is percent
Definition: MWAWFont.hxx:538
MWAWFont::setStrikeOutWordFlag
void setStrikeOutWordFlag(bool wordFlag=false)
sets the strikeoutline word flag
Definition: MWAWFont.hxx:419
MWAWFont::hiddenBit
@ hiddenBit
Definition: MWAWFont.hxx:183
MWAWFont::m_deltaSpacingUnit
MWAWVariable< librevenge::RVNGUnit > m_deltaSpacingUnit
the delta spacing unit
Definition: MWAWFont.hxx:540
MWAWFont::operator==
bool operator==(MWAWFont const &f) const
operator==
Definition: MWAWFont.hxx:492
MWAWFont::m_widthStreching
MWAWVariable< float > m_widthStreching
the width streching in percent
Definition: MWAWFont.hxx:541
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
MWAWFontManager::getFontConverter
shared_ptr< MWAWFontConverter > getFontConverter()
returns the font converter
Definition: MWAWFont.cxx:424
MWAWFont::isSet
bool isSet() const
returns true if the font id is initialized
Definition: MWAWFont.hxx:203
MWAWFont::Script::m_scale
int m_scale
the font scaling ( in percent )
Definition: MWAWFont.hxx:178
MWAWFont::Line::LargeDot
@ LargeDot
Definition: MWAWFont.hxx:49
MWAWFontManager::MWAWFontManager
MWAWFontManager(shared_ptr< MWAWFontConverter > fontConverter)
constructor
Definition: MWAWFont.cxx:416
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition: MWAWFont.hxx:304
MWAWFont::lowercaseBit
@ lowercaseBit
Definition: MWAWFont.hxx:185
MWAWFont::setOverlineColor
void setOverlineColor(MWAWColor const &color)
sets the overline color
Definition: MWAWFont.hxx:390
operator<<
std::ostream & operator<<(std::ostream &o, MWAWFont::Line const &line)
Definition: MWAWFont.cxx:49

Generated on Wed Jun 17 2020 06:30:11 for libmwaw by doxygen 1.8.18