izzi
SVG SUBSET C++ API
Loading...
Searching...
No Matches
a60-svg-constants.h
Go to the documentation of this file.
1// -*- mode: C++ -*-
2
3// Copyright (C) 2014-2025 Benjamin De Kosnik <b.dekosnik@gmail.com>
4
5// This file is part of the alpha60-MiL SVG library. This library is
6// free software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the Free
8// Software Foundation; either version 3, or (at your option) any
9// later version.
10
11// This library is distributed in the hope that it will be useful, but
12// WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// General Public License for more details.
15
16#ifndef MiL_SVG_CONSTANTS_H
17#define MiL_SVG_CONSTANTS_H 1
18
19
20namespace svg::constants {
21
22/**
23 Area constants use [h, v] suffix as per
24 - h == horizontal aka landscape
25 - v == vertical aka portrait
26*/
27constexpr area<> no_area = { 0, 0 };
28
29/// Area Constants in millimeter units.
30constexpr area<> letter_mm_h = { 216, 279 };
31
32constexpr area<> a2_mm_h = { 420, 594 };
33constexpr area<> a4_mm_h = { 210, 297 };
34constexpr area<> a5_mm_h = { 148, 210 };
35constexpr area<> a6_mm_h = { 105, 148 };
36
37/// Area Constants in pixel units.
38/// Pixel constants are using 96 PPI unless otherwise noted.
39constexpr area<> a2_096_h = { 2245, 1587 };
40constexpr area<> a4_096_h = { 1123, 794 };
41constexpr area<> a5_096_h = { 794, 559 };
42constexpr area<> a6_096_h = { 559, 397 };
43
44constexpr area<> a2_096_v = { 1587, 2245 };
45constexpr area<> a4_096_v = { 794, 1123 };
46constexpr area<> a5_096_v = { 559, 794 };
47constexpr area<> a6_096_v = { 397, 559 };
48
49constexpr area<> letter_096_v = { 816, 1056 };
50constexpr area<> letter_096_h = { 1056, 816 };
51
52/// Letter bleed (8.625 w x 11.25 h)
53constexpr area<> letterb_096_v = { 816, 1056 };
54constexpr area<> letterb_096_h = { 1056, 816 };
55
56/// Square 8 (8 w x 8 h)
57constexpr area<> square8_096 = { 768, 768 };
58
59/// Square 8bis (8.5 w x 8.5 h)
60constexpr area<> square8bis_096 = { 816, 816 };
61
62/// Square 8bis bleed (8.625 w x 8.75 h) (219 x 222 mm)
63constexpr area<> square8bisb_096_v = { 828, 840 };
64constexpr area<> square8bisb_096_h = { 840, 826 };
65
66/// Square 17 bleed 2 x (8.625 w x 8.75 h) for above at 2x
67constexpr area<> square17b_096_v = { 1656, 1680 };
68constexpr area<> square17b_096_h = { 1680, 1656 };
69
70/// Engineering C, aka 22 x 17 letter quattro
71constexpr area<> p22x17_096_h = { 2112, 1632 };
72constexpr area<> p17x22_096_v = { 1632, 2112 };
73
74constexpr area<> instagram_v = { 1080, 1350 };
75constexpr area<> instagram_s = { 1080, 1080 };
76constexpr area<> instagram_4ks = { 2160, 2160 };
77
78constexpr area<> v1080p_h = { 1920, 1080 };
79constexpr area<> v1080p_v = { 1080, 1920 };
80
81constexpr area<> v4k_h = { 3840, 2160 };
82constexpr area<> v4k_v = { 2160, 3840 };
83
84/// Fine Art max sheet, aka 44 x 30 (1.47:1 ~ 3:2)
85constexpr area<> p44x30_h = { 4224, 2880 };
86constexpr area<> p30x44_v = { 2880, 4224 };
87
88/// Fine Art roll, aka 44 x 22 (2:1)
89constexpr area<> p44x22_h = { 4224, 2112 };
90constexpr area<> p22x44_v = { 2112, 4224 };
91
92
93/// Style constants.
94const style no_style = { color::none, 0.0, color::none, 0.0, 0 };
95const style b_style = { color::black, 1.0, color::white, 0.0, 0.5 };
96const style w_style = { color::white, 1.0, color::black, 0.0, 0.5 };
97
98const style r_style = { color::red, 1.0, color::red, 0.0, 0.5 };
102
103
104/// Useful typography constants.
110
111const char* sserif = "Source Serif Pro";
112const char* ssans = "Source Sans Pro";
113const char* smono = "Source Code Pro";
114const char* shsans = "Source Han Sans CN";
115const char* aprcu = "Apercu";
116const char* aprcumo = "Apercu Mono";
117const char* ccode = "Calling Code";
118const char* zslab = "Zilla Slab";
119const char* mexcellent = "Mexcellent";
120const char* hyperl = "Atkinson Hyperlegible";
121
122const typography smono_typo = { smono, 12, b_style, a, al, b, w, p };
123const typography sserif_typo = { sserif, 12, b_style, a, al, b, w, p };
124const typography ssans_typo = { ssans, 12, b_style, a, al, b, w, p };
125const typography shsans_typo = { shsans, 12, b_style, a, al, b, w, p };
126const typography apercu_typo = { aprcu, 12, b_style, a, al, b, w, p };
128const typography ccode_typo = { ccode, 12, b_style, a, al, b, w, p };
129const typography zslab_typo = { zslab, 12, b_style, a, al, b, w, p };
131const typography hyperl_typo = { hyperl, 12, b_style, a, al, b, w, p };
132
133/// Radial rotation direction.
134enum class rrotation
135 {
136 none, ///< None
137 cw, ///< Clockwise
138 ccw ///< Counter-clockwise
139 };
140
141} // namespace svg::constants
142
143#endif
constexpr area instagram_s
constexpr area letterb_096_h
const typography apercumo_typo
constexpr area a5_mm_h
typography::weight w
constexpr area square17b_096_v
Square 17 bleed 2 x (8.625 w x 8.75 h) for above at 2x.
constexpr area a5_096_v
constexpr area letterb_096_v
Letter bleed (8.625 w x 11.25 h)
constexpr area letter_mm_h
Area Constants in millimeter units.
constexpr area square8_096
Square 8 (8 w x 8 h)
constexpr area a2_096_v
constexpr area v1080p_v
const typography zslab_typo
constexpr area v4k_v
const typography sserif_typo
const typography smono_typo
const typography shsans_typo
constexpr area a2_mm_h
const style wcagg_style
constexpr area p22x44_v
constexpr area p44x22_h
Fine Art roll, aka 44 x 22 (2:1)
constexpr area instagram_v
const typography ssans_typo
constexpr area p17x22_096_v
constexpr area p44x30_h
Fine Art max sheet, aka 44 x 30 (1.47:1 ~ 3:2)
constexpr area instagram_4ks
const style b_style
const typography ccode_typo
constexpr area a5_096_h
constexpr area no_area
typography::align al
const char * sserif
const char * shsans
const char * hyperl
const char * mexcellent
constexpr area a2_096_h
Area Constants in pixel units. Pixel constants are using 96 PPI unless otherwise noted.
const style no_style
Style constants.
constexpr area a6_mm_h
const typography mxcllnt_typo
constexpr area a4_096_h
constexpr area square8bisb_096_h
const style wcaglg_style
constexpr area square8bis_096
Square 8bis (8.5 w x 8.5 h)
const typography apercu_typo
const typography hyperl_typo
constexpr area v4k_h
const style w_style
constexpr area letter_096_v
typography::anchor a
Useful typography constants.
constexpr area a4_096_v
constexpr area square8bisb_096_v
Square 8bis bleed (8.625 w x 8.75 h) (219 x 222 mm)
typography::property p
const style r_style
rrotation
Radial rotation direction.
constexpr area a6_096_v
constexpr area v1080p_h
constexpr area a4_mm_h
const char * aprcumo
constexpr area p30x44_v
constexpr area square17b_096_h
typography::baseline b
constexpr area a6_096_h
const style wcagdg_style
constexpr area letter_096_h
constexpr area p22x17_096_h
Engineering C, aka 22 x 17 letter quattro.
Datum consolidating style preferences.
baseline
How to align text to the dominant-baseline. https://developer.mozilla.org/docs/Web/SVG/Attribute/domi...
@ none
Ignore this attribute.
align
Text alignment.
@ center
Center part of text block.
anchor
How to align text to a given point.
@ middle
Center the middle of the text block at point.
property
Face style variant. https://developer.mozilla.org/docs/Web/CSS/font-style.
weight
Weight as per CSS property.