MWAWFont.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libmwaw
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef MWAW_FONT
# define MWAW_FONT
#include <string>
#include <vector>
#include "libmwaw_internal.hxx"
class MWAWFont
{
public:
struct Line {
enum Style { None, Simple, Dot, LargeDot, Dash, Wave };
enum Type { Single, Double, Triple };
explicit Line(Style style=None, Type type=Single, bool wordFlag=false, float w=1.0)
: m_style(style)
, m_type(type)
, m_width(w)
, m_color(MWAWColor::black())
, m_word(wordFlag)
{
}
bool isSet() const
{
return m_style != None && m_width>0;
}
void addTo(librevenge::RVNGPropertyList &propList, std::string const &type) const;
friend std::ostream &operator<<(std::ostream &o, Line const &line);
bool operator==(Line const &oth) const
{
return cmp(oth)==0;
}
bool operator!=(Line const &oth) const
{
return cmp(oth)!=0;
}
int cmp(Line const &oth) const
{
if (m_style != oth.m_style) return int(m_style)-int(oth.m_style);
if (m_type != oth.m_type) return int(m_type)-int(oth.m_type);
if (m_word != oth.m_word) return m_word ? -1 : 1;
if (m_width < oth.m_width) return -1;
if (m_width > oth.m_width) return 1;
if (m_color.isSet() != oth.m_color.isSet())
return m_color.isSet();
if (m_color.get() < oth.m_color.get()) return -1;
if (m_color.get() > oth.m_color.get()) return 1;
return 0;
}
Style m_style;
Type m_type;
float m_width;
MWAWVariable<MWAWColor> m_color;
bool m_word;
};
struct Script {
explicit Script(float delta=0, librevenge::RVNGUnit deltaUnit=librevenge::RVNG_PERCENT, int scale=100)
: m_delta(delta)
, m_deltaUnit(deltaUnit)
, m_scale(scale)
{
}
bool isSet() const
{
return *this != Script();
}
static Script sub()
{
return Script(-33,librevenge::RVNG_PERCENT,58);
}
static Script sub100()
{
return Script(-20);
}
static Script super()
{
return Script(33,librevenge::RVNG_PERCENT,58);
}
static Script super100()
{
return Script(20);
}
std::string str(float fSize) const;
bool operator==(Script const &oth) const
{
return cmp(oth)==0;
}
bool operator!=(Script const &oth) const
{
return cmp(oth)!=0;
}
bool operator<(Script const &oth) const
{
return cmp(oth)<0;
}
bool operator<=(Script const &oth) const
{
return cmp(oth)<=0;
}
bool operator>(Script const &oth) const
{
return cmp(oth)>0;
}
bool operator>=(Script const &oth) const
{
return cmp(oth)>=0;
}
int cmp(Script const &oth) const
{
if (m_delta > oth.m_delta) return -1;
if (m_delta < oth.m_delta) return 1;
if (m_deltaUnit != oth.m_deltaUnit) return int(m_deltaUnit)-int(oth.m_deltaUnit);
if (m_scale != oth.m_scale) return m_scale-oth.m_scale;
return 0;
}
float m_delta;
librevenge::RVNGUnit m_deltaUnit;
int m_scale;
};
enum FontBits { boldBit=1, italicBit=2, blinkBit=4, embossBit=8, engraveBit=0x10,
hiddenBit=0x20, outlineBit=0x40, shadowBit=0x80,
reverseVideoBit=0x100, smallCapsBit=0x200, uppercaseBit=0x400,
lowercaseBit=0x800,
initialcaseBit=2*lowercaseBit,
boxedBit=2*initialcaseBit,
boxedRoundedBit=2*boxedBit,
reverseWritingBit=2*boxedRoundedBit
};
explicit 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()
, m_flags(f)
, m_overline(Line(Line::None))
, m_strikeoutline(Line(Line::None))
, m_underline(Line(Line::None))
, m_color(MWAWColor::black())
, m_backgroundColor(MWAWColor::white())
, m_language("")
, m_extra("")
{
resetColor();
}
bool isSet() const
{
return m_id.isSet();
}
void insert(MWAWFont const &ft)
{
m_id.insert(ft.m_id);
m_size.insert(ft.m_size);
m_sizeIsRelative.insert(ft.m_sizeIsRelative);
m_deltaSpacing.insert(ft.m_deltaSpacing);
m_deltaSpacingUnit.insert(ft.m_deltaSpacingUnit);
m_widthStreching.insert(ft.m_widthStreching);
m_scriptPosition.insert(ft.m_scriptPosition);
if (ft.m_flags.isSet()) {
if (m_flags.isSet())
setFlags(flags()| ft.flags());
else
m_flags = ft.m_flags;
}
m_overline.insert(ft.m_overline);
m_strikeoutline.insert(ft.m_strikeoutline);
m_underline.insert(ft.m_underline);
m_color.insert(ft.m_color);
m_backgroundColor.insert(ft.m_backgroundColor);
m_extra += ft.m_extra;
}
void setFont(int newId)
{
resetColor();
m_id=newId;
}
int id() const
{
return m_id.get();
}
void setId(int newId)
{
m_id = newId;
}
float size() const
{
return m_size.get();
}
void setSize(float sz, bool isRelative=false)
{
m_size = sz;
m_sizeIsRelative = isRelative;
}
float deltaLetterSpacing() const
{
return m_deltaSpacing.get();
}
librevenge::RVNGUnit deltaLetterSpacingUnit() const
{
return m_deltaSpacingUnit.get();
}
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
{
m_deltaSpacing=d;
m_deltaSpacingUnit=unit;
}
float widthStreching() const
{
return m_widthStreching.get();
}
void setWidthStreching(float scale=1.0)
{
m_widthStreching = scale;
}
Script const &script() const
{
return m_scriptPosition.get();
}
void set(Script const &newscript)
{
m_scriptPosition = newscript;
}
uint32_t flags() const
{
return m_flags.get();
}
void setFlags(uint32_t fl)
{
m_flags = fl;
}
bool hasColor() const
{
return m_color.isSet() && !m_color.get().isBlack();
}
void getColor(MWAWColor &c) const
{
c = m_color.get();
}
void setColor(MWAWColor color)
{
m_color = color;
}
void getBackgroundColor(MWAWColor &c) const
{
c = m_backgroundColor.get();
}
void setBackgroundColor(MWAWColor color)
{
m_backgroundColor = color;
}
void resetColor()
{
m_color = MWAWColor::black();
m_backgroundColor = MWAWColor::white();
}
bool hasDecorationLines() const
{
return (m_overline.isSet() && m_overline->isSet()) ||
(m_strikeoutline.isSet() && m_strikeoutline->isSet()) ||
(m_underline.isSet() && m_underline->isSet());
}
void resetDecorationLines()
{
if (m_overline.isSet()) m_overline=Line(Line::None);
if (m_strikeoutline.isSet()) m_strikeoutline=Line(Line::None);
if (m_underline.isSet()) m_underline=Line(Line::None);
}
Line const &getOverline() const
{
return m_overline.get();
}
void setOverline(Line const &line)
{
m_overline = line;
}
void setOverlineStyle(Line::Style style=Line::None, bool doReset=true)
{
if (doReset)
m_overline = Line(style);
else
m_overline->m_style = style;
}
void setOverlineType(Line::Type type=Line::Single)
{
m_overline->m_type = type;
}
void setOverlineWordFlag(bool wordFlag=false)
{
m_overline->m_word = wordFlag;
}
void setOverlineWidth(float w)
{
m_overline->m_width = w;
}
void setOverlineColor(MWAWColor const &color)
{
m_overline->m_color = color;
}
Line const &getStrikeOut() const
{
return m_strikeoutline.get();
}
void setStrikeOut(Line const &line)
{
m_strikeoutline = line;
}
void setStrikeOutStyle(Line::Style style=Line::None, bool doReset=true)
{
if (doReset)
m_strikeoutline = Line(style);
else
m_strikeoutline->m_style = style;
}
void setStrikeOutType(Line::Type type=Line::Single)
{
m_strikeoutline->m_type = type;
}
void setStrikeOutWordFlag(bool wordFlag=false)
{
m_strikeoutline->m_word = wordFlag;
}
void setStrikeOutWidth(float w)
{
m_strikeoutline->m_width = w;
}
void setStrikeOutColor(MWAWColor const &color)
{
m_strikeoutline->m_color = color;
}
Line const &getUnderline() const
{
return m_underline.get();
}
void setUnderline(Line const &line)
{
m_underline = line;
}
void setUnderlineStyle(Line::Style style=Line::None, bool doReset=true)
{
if (doReset)
m_underline = Line(style);
else
m_underline->m_style = style;
}
void setUnderlineType(Line::Type type=Line::Single)
{
m_underline->m_type = type;
}
void setUnderlineWordFlag(bool wordFlag=false)
{
m_underline->m_word = wordFlag;
}
void setUnderlineWidth(float w)
{
m_underline->m_width = w;
}
void setUnderlineColor(MWAWColor const &color)
{
m_underline->m_color = color;
}
std::string const &language() const
{
return m_language.get();
}
void setLanguage(std::string const &lang)
{
m_language=lang;
}
void addTo(librevenge::RVNGPropertyList &propList, std::shared_ptr<MWAWFontConverter> fontConverter) const;
void addToListLevel(librevenge::RVNGPropertyList &propList, std::shared_ptr<MWAWFontConverter> fontConverter) const;
std::string getDebugString(std::shared_ptr<MWAWFontConverter> &converter) const;
bool operator==(MWAWFont const &f) const
{
return cmp(f) == 0;
}
bool operator!=(MWAWFont const &f) const
{
return cmp(f) != 0;
}
int cmp(MWAWFont const &oth) const
{
int diff = id() - oth.id();
if (diff != 0) return diff;
if (size() < oth.size()) return -1;
if (size() > oth.size()) return 1;
if (m_sizeIsRelative.get() != oth.m_sizeIsRelative.get()) return m_sizeIsRelative.get() ? 1 : -1;
if (flags() < oth.flags()) return -1;
if (flags() > oth.flags()) return 1;
if (m_deltaSpacing.get() < oth.m_deltaSpacing.get()) return -1;
if (m_deltaSpacing.get() > oth.m_deltaSpacing.get()) return 1;
if (m_deltaSpacingUnit.get() < oth.m_deltaSpacingUnit.get()) return -1;
if (m_deltaSpacingUnit.get() > oth.m_deltaSpacingUnit.get()) return 1;
if (m_widthStreching.get() < oth.m_widthStreching.get()) return -1;
if (m_widthStreching.get() > oth.m_widthStreching.get()) return 1;
diff = script().cmp(oth.script());
if (diff != 0) return diff;
diff = m_overline.get().cmp(oth.m_overline.get());
if (diff != 0) return diff;
diff = m_strikeoutline.get().cmp(oth.m_strikeoutline.get());
if (diff != 0) return diff;
diff = m_underline.get().cmp(oth.m_underline.get());
if (diff != 0) return diff;
if (m_color.get() < oth.m_color.get()) return -1;
if (m_color.get() > oth.m_color.get()) return 1;
if (m_backgroundColor.get() < oth.m_backgroundColor.get()) return -1;
if (m_backgroundColor.get() > oth.m_backgroundColor.get()) return 1;
if (m_language.get() < oth.m_language.get()) return -1;
if (m_language.get() > oth.m_language.get()) return 1;
return diff;
}
protected:
MWAWVariable<int> m_id ;
MWAWVariable<float> m_size ;
MWAWVariable<bool> m_sizeIsRelative ;
MWAWVariable<float> m_deltaSpacing ;
MWAWVariable<librevenge::RVNGUnit> m_deltaSpacingUnit ;
MWAWVariable<float> m_widthStreching ;
MWAWVariable<Script> m_scriptPosition ;
MWAWVariable<uint32_t> m_flags ;
MWAWVariable<Line> m_overline ;
MWAWVariable<Line> m_strikeoutline ;
MWAWVariable<Line> m_underline ;
MWAWVariable<MWAWColor> m_color ;
MWAWVariable<MWAWColor> m_backgroundColor ;
MWAWVariable<std::string> m_language ;
public:
std::string m_extra;
};
namespace MWAWFontManagerInternal
{
struct State;
}
class MWAWFontManager
{
public:
explicit MWAWFontManager(std::shared_ptr<MWAWFontConverter> const &fontConverter);
~MWAWFontManager();
int getId(MWAWFont const &font);
bool getFont(int id, MWAWFont &font) const;
std::shared_ptr<MWAWFontConverter> getFontConverter();
protected:
std::shared_ptr<MWAWFontManagerInternal::State> m_state;
private:
MWAWFontManager(MWAWFontManager const &) = delete;
MWAWFontManager &operator=(MWAWFontManager const &) = delete;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
MWAWFontManager::getId
int getId(MWAWFont const &font)
returns a span id which can be used to call the list
Definition MWAWFont.cxx:435
MWAWFontManager::operator=
MWAWFontManager & operator=(MWAWFontManager const &)=delete
MWAWFontManager::~MWAWFontManager
~MWAWFontManager()
destructor
Definition MWAWFont.cxx:426
MWAWFontManager::getFontConverter
std::shared_ptr< MWAWFontConverter > getFontConverter()
returns the font converter
Definition MWAWFont.cxx:430
MWAWFontManager::MWAWFontManager
MWAWFontManager(MWAWFontManager const &)=delete
MWAWFontManager::getFont
bool getFont(int id, MWAWFont &font) const
returns the font corresponding to an id
Definition MWAWFont.cxx:446
MWAWFontManager::m_state
std::shared_ptr< MWAWFontManagerInternal::State > m_state
the state
Definition MWAWFont.hxx:597
MWAWFontManager::MWAWFontManager
MWAWFontManager(std::shared_ptr< MWAWFontConverter > const &fontConverter)
constructor
Definition MWAWFont.cxx:421
MWAWFont
Class to store font.
Definition MWAWFont.hxx:44
MWAWFont::m_scriptPosition
MWAWVariable< Script > m_scriptPosition
the sub/super script definition
Definition MWAWFont.hxx:563
MWAWFont::setWidthStreching
void setWidthStreching(float scale=1.0)
sets the text width streching
Definition MWAWFont.hxx:303
MWAWFont::setUnderlineColor
void setUnderlineColor(MWAWColor const &color)
sets the underline color
Definition MWAWFont.hxx:489
MWAWFont::setFont
void setFont(int newId)
sets the font id and resets size to the previous size for this font
Definition MWAWFont.hxx:252
MWAWFont::flags
uint32_t flags() const
returns the font flags
Definition MWAWFont.hxx:320
MWAWFont::getStrikeOut
Line const & getStrikeOut() const
returns the strikeoutline
Definition MWAWFont.hxx:417
MWAWFont::getBackgroundColor
void getBackgroundColor(MWAWColor &c) const
returns the font background color
Definition MWAWFont.hxx:347
MWAWFont::insert
void insert(MWAWFont const &ft)
inserts the set value in the current font
Definition MWAWFont.hxx:229
MWAWFont::setOverlineWordFlag
void setOverlineWordFlag(bool wordFlag=false)
sets the overline word flag
Definition MWAWFont.hxx:401
MWAWFont::FontBits
FontBits
the different font bit
Definition MWAWFont.hxx:190
MWAWFont::shadowBit
@ shadowBit
Definition MWAWFont.hxx:191
MWAWFont::outlineBit
@ outlineBit
Definition MWAWFont.hxx:191
MWAWFont::boxedBit
@ boxedBit
Definition MWAWFont.hxx:195
MWAWFont::uppercaseBit
@ uppercaseBit
Definition MWAWFont.hxx:192
MWAWFont::smallCapsBit
@ smallCapsBit
Definition MWAWFont.hxx:192
MWAWFont::reverseVideoBit
@ reverseVideoBit
Definition MWAWFont.hxx:192
MWAWFont::embossBit
@ embossBit
Definition MWAWFont.hxx:190
MWAWFont::hiddenBit
@ hiddenBit
Definition MWAWFont.hxx:191
MWAWFont::boldBit
@ boldBit
Definition MWAWFont.hxx:190
MWAWFont::lowercaseBit
@ lowercaseBit
Definition MWAWFont.hxx:193
MWAWFont::reverseWritingBit
@ reverseWritingBit
Definition MWAWFont.hxx:197
MWAWFont::initialcaseBit
@ initialcaseBit
Definition MWAWFont.hxx:194
MWAWFont::italicBit
@ italicBit
Definition MWAWFont.hxx:190
MWAWFont::boxedRoundedBit
@ boxedRoundedBit
Definition MWAWFont.hxx:196
MWAWFont::blinkBit
@ blinkBit
Definition MWAWFont.hxx:190
MWAWFont::engraveBit
@ engraveBit
Definition MWAWFont.hxx:190
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:427
MWAWFont::size
float size() const
returns the font size
Definition MWAWFont.hxx:270
MWAWFont::setUnderline
void setUnderline(Line const &line)
sets the underline
Definition MWAWFont.hxx:461
MWAWFont::m_backgroundColor
MWAWVariable< MWAWColor > m_backgroundColor
font background color
Definition MWAWFont.hxx:569
MWAWFont::m_color
MWAWVariable< MWAWColor > m_color
font color
Definition MWAWFont.hxx:568
MWAWFont::script
Script const & script() const
returns the script position
Definition MWAWFont.hxx:308
MWAWFont::id
int id() const
returns the font id
Definition MWAWFont.hxx:259
MWAWFont::setUnderlineWordFlag
void setUnderlineWordFlag(bool wordFlag=false)
sets the underline word flag
Definition MWAWFont.hxx:479
MWAWFont::addToListLevel
void addToListLevel(librevenge::RVNGPropertyList &propList, std::shared_ptr< MWAWFontConverter > fontConverter) const
add to the propList to a list level
Definition MWAWFont.cxx:360
MWAWFont::deltaLetterSpacingUnit
librevenge::RVNGUnit deltaLetterSpacingUnit() const
returns the condensed(negative)/extended(positive) unit
Definition MWAWFont.hxx:287
MWAWFont::addTo
void addTo(librevenge::RVNGPropertyList &propList, std::shared_ptr< MWAWFontConverter > fontConverter) const
add to the propList
Definition MWAWFont.cxx:245
MWAWFont::getDebugString
std::string getDebugString(std::shared_ptr< MWAWFontConverter > &converter) const
returns a string which can be used for debugging
Definition MWAWFont.cxx:181
MWAWFont::setFlags
void setFlags(uint32_t fl)
sets the font attributes bold, ...
Definition MWAWFont.hxx:325
MWAWFont::setBackgroundColor
void setBackgroundColor(MWAWColor color)
sets the font background color
Definition MWAWFont.hxx:352
MWAWFont::cmp
int cmp(MWAWFont const &oth) const
a comparison function
Definition MWAWFont.hxx:524
MWAWFont::operator==
bool operator==(MWAWFont const &f) const
operator==
Definition MWAWFont.hxx:513
MWAWFont::m_size
MWAWVariable< float > m_size
font size
Definition MWAWFont.hxx:558
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:466
MWAWFont::setUnderlineType
void setUnderlineType(Line::Type type=Line::Single)
sets the underline type
Definition MWAWFont.hxx:474
MWAWFont::MWAWFont
MWAWFont(int newId=-1, float sz=12, uint32_t f=0)
constructor
Definition MWAWFont.hxx:204
MWAWFont::getUnderline
Line const & getUnderline() const
returns the underline
Definition MWAWFont.hxx:456
MWAWFont::setStrikeOutWidth
void setStrikeOutWidth(float w)
sets the strikeoutline width
Definition MWAWFont.hxx:445
MWAWFont::m_sizeIsRelative
MWAWVariable< bool > m_sizeIsRelative
true if the size is percent
Definition MWAWFont.hxx:559
MWAWFont::setColor
void setColor(MWAWColor color)
sets the font color
Definition MWAWFont.hxx:341
MWAWFont::m_deltaSpacingUnit
MWAWVariable< librevenge::RVNGUnit > m_deltaSpacingUnit
the delta spacing unit
Definition MWAWFont.hxx:561
MWAWFont::setStrikeOutColor
void setStrikeOutColor(MWAWColor const &color)
sets the strikeoutline color
Definition MWAWFont.hxx:450
MWAWFont::m_id
MWAWVariable< int > m_id
font identificator
Definition MWAWFont.hxx:557
MWAWFont::m_widthStreching
MWAWVariable< float > m_widthStreching
the width streching in percent
Definition MWAWFont.hxx:562
MWAWFont::operator!=
bool operator!=(MWAWFont const &f) const
operator!=
Definition MWAWFont.hxx:518
MWAWFont::setStrikeOut
void setStrikeOut(Line const &line)
sets the strikeoutline
Definition MWAWFont.hxx:422
MWAWFont::setStrikeOutType
void setStrikeOutType(Line::Type type=Line::Single)
sets the strikeoutline type
Definition MWAWFont.hxx:435
MWAWFont::m_overline
MWAWVariable< Line > m_overline
overline attributes
Definition MWAWFont.hxx:565
MWAWFont::m_strikeoutline
MWAWVariable< Line > m_strikeoutline
overline attributes
Definition MWAWFont.hxx:566
MWAWFont::m_deltaSpacing
MWAWVariable< float > m_deltaSpacing
expand(> 0), condensed(< 0) depl
Definition MWAWFont.hxx:560
MWAWFont::resetColor
void resetColor()
resets the font color to black and the background color to white
Definition MWAWFont.hxx:357
MWAWFont::setLanguage
void setLanguage(std::string const &lang)
set the language ( in the for en_US, en_GB, en, ...)
Definition MWAWFont.hxx:500
MWAWFont::setOverlineType
void setOverlineType(Line::Type type=Line::Single)
sets the overline type
Definition MWAWFont.hxx:396
MWAWFont::setDeltaLetterSpacing
void setDeltaLetterSpacing(float d, librevenge::RVNGUnit unit=librevenge::RVNG_POINT)
sets the letter spacing ( delta value in point )
Definition MWAWFont.hxx:292
MWAWFont::hasColor
bool hasColor() const
returns true if the font color is not black
Definition MWAWFont.hxx:331
MWAWFont::setSize
void setSize(float sz, bool isRelative=false)
sets the font size
Definition MWAWFont.hxx:275
MWAWFont::deltaLetterSpacing
float deltaLetterSpacing() const
returns the condensed(negative)/extended(positive) width
Definition MWAWFont.hxx:282
MWAWFont::setOverlineColor
void setOverlineColor(MWAWColor const &color)
sets the overline color
Definition MWAWFont.hxx:411
MWAWFont::m_language
MWAWVariable< std::string > m_language
the language if set
Definition MWAWFont.hxx:570
MWAWFont::resetDecorationLines
void resetDecorationLines()
reset the decoration
Definition MWAWFont.hxx:371
MWAWFont::m_underline
MWAWVariable< Line > m_underline
underline attributes
Definition MWAWFont.hxx:567
MWAWFont::isSet
bool isSet() const
returns true if the font id is initialized
Definition MWAWFont.hxx:224
MWAWFont::hasDecorationLines
bool hasDecorationLines() const
return true if the font has decorations line (overline, strikeout, underline)
Definition MWAWFont.hxx:364
MWAWFont::widthStreching
float widthStreching() const
returns the text width streching
Definition MWAWFont.hxx:298
MWAWFont::setOverlineWidth
void setOverlineWidth(float w)
sets the overline width
Definition MWAWFont.hxx:406
MWAWFont::m_extra
std::string m_extra
extra data
Definition MWAWFont.hxx:573
MWAWFont::language
std::string const & language() const
returns the language
Definition MWAWFont.hxx:495
MWAWFont::set
void set(Script const &newscript)
sets the script position
Definition MWAWFont.hxx:314
MWAWFont::getOverline
Line const & getOverline() const
returns the overline
Definition MWAWFont.hxx:378
MWAWFont::getColor
void getColor(MWAWColor &c) const
returns the font color
Definition MWAWFont.hxx:336
MWAWFont::setId
void setId(int newId)
sets the font id
Definition MWAWFont.hxx:264
MWAWFont::setUnderlineWidth
void setUnderlineWidth(float w)
sets the underline width
Definition MWAWFont.hxx:484
MWAWFont::setOverline
void setOverline(Line const &line)
sets the overline
Definition MWAWFont.hxx:383
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:388
MWAWFont::setStrikeOutWordFlag
void setStrikeOutWordFlag(bool wordFlag=false)
sets the strikeoutline word flag
Definition MWAWFont.hxx:440
MWAWFont::m_flags
MWAWVariable< uint32_t > m_flags
font attributes
Definition MWAWFont.hxx:564
libmwaw_internal.hxx
MWAWFontManagerInternal
namespace used to define structure for the font manager
Definition MWAWFont.cxx:390
librevenge
Definition MWAWDocument.hxx:57
MWAWColor
the class to store a color
Definition libmwaw_internal.hxx:192
MWAWColor::black
static MWAWColor black()
return the back color
Definition libmwaw_internal.hxx:245
MWAWColor::white
static MWAWColor white()
return the white color
Definition libmwaw_internal.hxx:250
MWAWFont::Line
a small struct to define a line in MWAWFont
Definition MWAWFont.hxx:47
MWAWFont::Line::Style
Style
the line style
Definition MWAWFont.hxx:49
MWAWFont::Line::None
@ None
Definition MWAWFont.hxx:49
MWAWFont::Line::Dot
@ Dot
Definition MWAWFont.hxx:49
MWAWFont::Line::Dash
@ Dash
Definition MWAWFont.hxx:49
MWAWFont::Line::LargeDot
@ LargeDot
Definition MWAWFont.hxx:49
MWAWFont::Line::Simple
@ Simple
Definition MWAWFont.hxx:49
MWAWFont::Line::Wave
@ Wave
Definition MWAWFont.hxx:49
MWAWFont::Line::isSet
bool isSet() const
return true if the line is not empty
Definition MWAWFont.hxx:62
MWAWFont::Line::m_type
Type m_type
the type
Definition MWAWFont.hxx:97
MWAWFont::Line::Line
Line(Style style=None, Type type=Single, bool wordFlag=false, float w=1.0)
constructor
Definition MWAWFont.hxx:53
MWAWFont::Line::m_width
float m_width
the width in point
Definition MWAWFont.hxx:99
MWAWFont::Line::operator!=
bool operator!=(Line const &oth) const
operator!=
Definition MWAWFont.hxx:76
MWAWFont::Line::Type
Type
the line style
Definition MWAWFont.hxx:51
MWAWFont::Line::Single
@ Single
Definition MWAWFont.hxx:51
MWAWFont::Line::Double
@ Double
Definition MWAWFont.hxx:51
MWAWFont::Line::Triple
@ Triple
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:101
MWAWFont::Line::operator<<
friend std::ostream & operator<<(std::ostream &o, Line const &line)
operator<<
Definition MWAWFont.cxx:49
MWAWFont::Line::m_style
Style m_style
the style
Definition MWAWFont.hxx:95
MWAWFont::Line::operator==
bool operator==(Line const &oth) const
operator==
Definition MWAWFont.hxx:71
MWAWFont::Line::cmp
int cmp(Line const &oth) const
small comparison function
Definition MWAWFont.hxx:81
MWAWFont::Line::m_word
bool m_word
word or not word line
Definition MWAWFont.hxx:103
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
a small struct to define the script position in MWAWFont
Definition MWAWFont.hxx:106
MWAWFont::Script::operator==
bool operator==(Script const &oth) const
operator==
Definition MWAWFont.hxx:143
MWAWFont::Script::Script
Script(float delta=0, librevenge::RVNGUnit deltaUnit=librevenge::RVNG_PERCENT, int scale=100)
constructor
Definition MWAWFont.hxx:108
MWAWFont::Script::m_deltaUnit
librevenge::RVNGUnit m_deltaUnit
the ydelta unit ( point or percent )
Definition MWAWFont.hxx:184
MWAWFont::Script::sub100
static Script sub100()
return a yposition which correspond to a basic subscript100
Definition MWAWFont.hxx:125
MWAWFont::Script::isSet
bool isSet() const
return true if the position is not default
Definition MWAWFont.hxx:115
MWAWFont::Script::operator<=
bool operator<=(Script const &oth) const
operator<=
Definition MWAWFont.hxx:158
MWAWFont::Script::cmp
int cmp(Script const &oth) const
small comparison function
Definition MWAWFont.hxx:173
MWAWFont::Script::str
std::string str(float fSize) const
return a string which correspond to style:text-position
Definition MWAWFont.cxx:148
MWAWFont::Script::operator>=
bool operator>=(Script const &oth) const
operator>=
Definition MWAWFont.hxx:168
MWAWFont::Script::m_scale
int m_scale
the font scaling ( in percent )
Definition MWAWFont.hxx:186
MWAWFont::Script::super100
static Script super100()
return a yposition which correspond to a basic superscript100
Definition MWAWFont.hxx:135
MWAWFont::Script::operator<
bool operator<(Script const &oth) const
operator<
Definition MWAWFont.hxx:153
MWAWFont::Script::sub
static Script sub()
return a yposition which correspond to a basic subscript
Definition MWAWFont.hxx:120
MWAWFont::Script::m_delta
float m_delta
the ydelta
Definition MWAWFont.hxx:182
MWAWFont::Script::operator>
bool operator>(Script const &oth) const
operator>
Definition MWAWFont.hxx:163
MWAWFont::Script::super
static Script super()
return a yposition which correspond to a basic superscript
Definition MWAWFont.hxx:130
MWAWFont::Script::operator!=
bool operator!=(Script const &oth) const
operator!=
Definition MWAWFont.hxx:148
MWAWVariable
a generic variable template: value + flag to know if the variable is set
Definition libmwaw_internal.hxx:577
MWAWVariable::isSet
bool isSet() const
return true if the variable is set
Definition libmwaw_internal.hxx:635
MWAWVariable::get
T const & get() const
return the current value
Definition libmwaw_internal.hxx:630