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  property { normal , italic }
 Face style variant. https://developer.mozilla.org/docs/Web/CSS/font-style. More...
 
enum class  weight { xlight , light , normal , medium , bold , xbold }
 Weight as per CSS property. More...
 

Public Member Functions

const std::string add_attribute (const svg::unit utype=svg::unit::pixel) 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 baseline b) const
 
const std::string to_string (const property p) const
 
const std::string to_string (const weight w) const
 
typography use_style (const style s) const
 

Public Attributes

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

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 287 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 290 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 306 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 316 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 344 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 332 of file a60-svg-base-types.h.

Member Function Documentation

◆ add_attribute()

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

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

+ Here is the call graph for this function:

◆ to_string() [1/5]

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

Definition at line 370 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 393 of file a60-svg-base-types.h.

◆ to_string() [3/5]

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

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

◆ to_string() [4/5]

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

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

◆ to_string() [5/5]

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

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

◆ use_style()

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

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

Member Data Documentation

◆ _M_align

align svg::typography::_M_align

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

◆ _M_anchor

anchor svg::typography::_M_anchor

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

◆ _M_baseline

baseline svg::typography::_M_baseline

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

◆ _M_face

std::string svg::typography::_M_face

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

◆ _M_p

property svg::typography::_M_p

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

◆ _M_size

space_type svg::typography::_M_size

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

◆ _M_style

style svg::typography::_M_style

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

◆ _M_w

weight svg::typography::_M_w

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


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