izzi
SVG SUBSET C++ API
Loading...
Searching...
No Matches
svg::typography Struct Reference

#include <a60-svg-base-types.h>

Public Types

enum class  align {
  left , center , right , justify , justifyall , start , end , inherit ,
  matchparent , initial , unset
}
 Text alignment. More...
enum class  anchor { start , middle , end , inherit }
 How to align text to a given point. More...
enum class  baseline {
  none , automatic , ideographic , alphabetic , hanging , mathematical , central , middle ,
  text_after_edge , text_before_edge , text_top
}
 How to align text to the dominant-baseline. https://developer.mozilla.org/docs/Web/SVG/Attribute/dominant-baseline. More...
enum class  weight { xlight , light , normal , medium , bold , xbold }
 Weight as per CSS property. More...
enum class  property { normal , italic }
 Face style variant. https://developer.mozilla.org/docs/Web/CSS/font-style. More...

Public Member Functions

typography use_style (const style s) const
const std::string to_string (const align a) const
const std::string to_string (const anchor a) const
const std::string to_string (const weight w) const
const std::string to_string (const baseline b) const
const std::string to_string (const property p) const
const std::string add_attribute (const svg::unit utype=svg::unit::pixel) const

Public Attributes

std::string _M_face
space_type _M_size
style _M_style
anchor _M_anchor
align _M_align
baseline _M_baseline
weight _M_w
property _M_p

Detailed Description

Character rendering, type, fonts, styles.

Expect to keep changing the output, so use this abstraction to set styling defaults, so that one can just assign types instead of doing a bunch of search-and-replace operations when changing type characteristics.

SVG Fonts https://developer.mozilla.org/docs/Web/SVG/Tutorial/SVG_fonts

Definition at line 365 of file a60-svg-base-types.h.

Member Enumeration Documentation

◆ align

enum class svg::typography::align
strong

Text alignment.

Enumerator
left 

Left-most part of text block.

center 

Center part of text block.

right 

Right part of text block.

justify 
justifyall 
start 
end 
inherit 
matchparent 
initial 
unset 

Definition at line 368 of file a60-svg-base-types.h.

◆ anchor

enum class svg::typography::anchor
strong

How to align text to a given point.

Enumerator
start 

Start the text block at point.

middle 

Center the middle of the text block at point.

end 

End the text block at point.

inherit 

Enclosing object or group.

Definition at line 384 of file a60-svg-base-types.h.

◆ baseline

enum class svg::typography::baseline
strong

How to align text to the dominant-baseline. https://developer.mozilla.org/docs/Web/SVG/Attribute/dominant-baseline.

Enumerator
none 

Ignore this attribute.

automatic 

Auto.

ideographic 
alphabetic 
hanging 
mathematical 
central 

For rotated text.

middle 
text_after_edge 
text_before_edge 
text_top 

Definition at line 394 of file a60-svg-base-types.h.

◆ weight

enum class svg::typography::weight
strong

Weight as per CSS property.

Enumerator
xlight 
light 

CSS 300.

normal 

CSS 400.

medium 

CSS 500.

bold 
xbold 

Definition at line 410 of file a60-svg-base-types.h.

◆ property

enum class svg::typography::property
strong

Face style variant. https://developer.mozilla.org/docs/Web/CSS/font-style.

Enumerator
normal 

Book.

italic 

Italic.

Definition at line 422 of file a60-svg-base-types.h.

Member Function Documentation

◆ use_style()

typography svg::typography::use_style ( const style s) const
inline

Definition at line 444 of file a60-svg-base-types.h.

◆ to_string() [1/5]

const std::string svg::typography::to_string ( const align a) const
inline

Definition at line 448 of file a60-svg-base-types.h.

◆ to_string() [2/5]

const std::string svg::typography::to_string ( const anchor a) const
inline

Definition at line 471 of file a60-svg-base-types.h.

◆ to_string() [3/5]

const std::string svg::typography::to_string ( const weight w) const
inline

Definition at line 487 of file a60-svg-base-types.h.

◆ to_string() [4/5]

const std::string svg::typography::to_string ( const baseline b) const
inline

Definition at line 505 of file a60-svg-base-types.h.

◆ to_string() [5/5]

const std::string svg::typography::to_string ( const property p) const
inline

Definition at line 528 of file a60-svg-base-types.h.

◆ add_attribute()

const std::string svg::typography::add_attribute ( const svg::unit utype = svg::unit::pixel) const
inline

Definition at line 542 of file a60-svg-base-types.h.

Here is the call graph for this function:

Member Data Documentation

◆ _M_face

std::string svg::typography::_M_face

Definition at line 429 of file a60-svg-base-types.h.

◆ _M_size

space_type svg::typography::_M_size

Definition at line 430 of file a60-svg-base-types.h.

◆ _M_style

style svg::typography::_M_style

Definition at line 431 of file a60-svg-base-types.h.

◆ _M_anchor

anchor svg::typography::_M_anchor

Definition at line 436 of file a60-svg-base-types.h.

◆ _M_align

align svg::typography::_M_align

Definition at line 437 of file a60-svg-base-types.h.

◆ _M_baseline

baseline svg::typography::_M_baseline

Definition at line 438 of file a60-svg-base-types.h.

◆ _M_w

weight svg::typography::_M_w

Definition at line 439 of file a60-svg-base-types.h.

◆ _M_p

property svg::typography::_M_p

Definition at line 440 of file a60-svg-base-types.h.


The documentation for this struct was generated from the following file: