1 // Scintilla source code edit control
3 ** Defines the font and colour style for a class of text.
5 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
15 struct FontSpecification
{
24 weight(SC_WEIGHT_NORMAL
),
26 size(10 * SC_FONT_SIZE_MULTIPLIER
),
30 bool operator==(const FontSpecification
&other
) const;
31 bool operator<(const FontSpecification
&other
) const;
34 // Just like Font but only has a copy of the FontID so should not delete it
35 class FontAlias
: public Font
{
36 // Private so FontAlias objects can not be assigned except for intiialization
37 FontAlias
&operator=(const FontAlias
&);
40 FontAlias(const FontAlias
&);
42 void MakeAlias(Font
&fontOrigin
);
46 struct FontMeasurements
{
49 XYPOSITION aveCharWidth
;
50 XYPOSITION spaceWidth
;
58 class Style
: public FontSpecification
, public FontMeasurements
{
64 enum ecaseForced
{caseMixed
, caseUpper
, caseLower
};
65 ecaseForced caseForce
;
73 Style(const Style
&source
);
75 Style
&operator=(const Style
&source
);
76 void Clear(ColourDesired fore_
, ColourDesired back_
,
78 const char *fontName_
, int characterSet_
,
79 int weight_
, bool italic_
, bool eolFilled_
,
80 bool underline_
, ecaseForced caseForce_
,
81 bool visible_
, bool changeable_
, bool hotspot_
);
82 void ClearTo(const Style
&source
);
83 void Copy(Font
&font_
, const FontMeasurements
&fm_
);
84 bool IsProtected() const { return !(changeable
&& visible
);}