KiCad PCB EDA Suite
Loading...
Searching...
No Matches
font.h File Reference
#include <gal/gal.h>
#include <iostream>
#include <map>
#include <algorithm>
#include <wx/string.h>
#include <font/glyph.h>
#include <font/text_attributes.h>

Go to the source code of this file.

Classes

class  KIFONT::METRICS
 
class  KIFONT::FONT
 FONT is an abstract base class for both outline and stroke fonts. More...
 

Namespaces

namespace  KIGFX
 The Cairo implementation of the graphics abstraction layer.
 
namespace  KIFONT
 

Typedefs

using TEXT_STYLE_FLAGS = unsigned int
 

Enumerations

enum  TEXT_STYLE {
  BOLD = 1 , ITALIC = 1 << 1 , SUBSCRIPT = 1 << 2 , SUPERSCRIPT = 1 << 3 ,
  OVERBAR = 1 << 4 , UNDERLINE = 1 << 5
}
 

Functions

bool IsBold (TEXT_STYLE_FLAGS aFlags)
 
bool IsItalic (TEXT_STYLE_FLAGS aFlags)
 
bool IsSuperscript (TEXT_STYLE_FLAGS aFlags)
 
bool IsSubscript (TEXT_STYLE_FLAGS aFlags)
 
std::ostream & operator<< (std::ostream &os, const KIFONT::FONT &aFont)
 
std::ostream & operator<< (std::ostream &os, const KIFONT::FONT *aFont)
 

Variables

static constexpr double ITALIC_TILT = 1.0 / 8
 Tilt factor for italic style (this is the scaling factor on dY relative coordinates to give a tilted shape).
 

Typedef Documentation

◆ TEXT_STYLE_FLAGS

using TEXT_STYLE_FLAGS = unsigned int

Definition at line 64 of file font.h.

Enumeration Type Documentation

◆ TEXT_STYLE

enum TEXT_STYLE
Enumerator
BOLD 
ITALIC 
SUBSCRIPT 
SUPERSCRIPT 
OVERBAR 
UNDERLINE 

Definition at line 44 of file font.h.

Function Documentation

◆ IsBold()

bool IsBold ( TEXT_STYLE_FLAGS  aFlags)
inline

Definition at line 67 of file font.h.

References BOLD.

◆ IsItalic()

bool IsItalic ( TEXT_STYLE_FLAGS  aFlags)
inline

Definition at line 73 of file font.h.

References ITALIC.

◆ IsSubscript()

bool IsSubscript ( TEXT_STYLE_FLAGS  aFlags)
inline

Definition at line 85 of file font.h.

References SUBSCRIPT.

Referenced by KIFONT::OUTLINE_FONT::getTextAsGlyphsUnlocked().

◆ IsSuperscript()

bool IsSuperscript ( TEXT_STYLE_FLAGS  aFlags)
inline

Definition at line 79 of file font.h.

References SUPERSCRIPT.

Referenced by KIFONT::OUTLINE_FONT::getTextAsGlyphsUnlocked().

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream &  os,
const KIFONT::FONT aFont 
)
inline

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  os,
const KIFONT::FONT aFont 
)
inline

Definition at line 299 of file font.h.

References operator<<().

Variable Documentation

◆ ITALIC_TILT

constexpr double ITALIC_TILT = 1.0 / 8
staticconstexpr

Tilt factor for italic style (this is the scaling factor on dY relative coordinates to give a tilted shape).

This is applied directly to stroke fonts, and is used as an estimate for outline fonts (which have the actual tilt built in to their polygonal glyph outlines).

Definition at line 61 of file font.h.

Referenced by KIFONT::STROKE_FONT::GetTextAsGlyphs(), and EDA_TEXT::GetTextBox().