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-2022 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
85/// Style constants.
86const style no_style = { color::none, 0.0, color::none, 0.0, 0 };
87const style b_style = { color::black, 1.0, color::white, 0.0, 0.5 };
88const style w_style = { color::white, 1.0, color::black, 0.0, 0.5 };
89
90const style r_style = { color::red, 1.0, color::red, 0.0, 0.5 };
94
95
96/// Useful typography constants.
102
103const char* sserif = "Source Serif Pro";
104const char* ssans = "Source Sans Pro";
105const char* smono = "Source Code Pro";
106const char* shsans = "Source Han Sans CN";
107const char* aprcu = "Apercu";
108const char* aprcumo = "Apercu Mono";
109const char* ccode = "Calling Code";
110const char* zslab = "Zilla Slab";
111const char* mexcellent = "Mexcellent";
112const char* hyperl = "Atkinson Hyperlegible";
113
114const typography smono_typo = { smono, 12, b_style, a, al, b, w, p };
115const typography sserif_typo = { sserif, 12, b_style, a, al, b, w, p };
116const typography ssans_typo = { ssans, 12, b_style, a, al, b, w, p };
117const typography shsans_typo = { shsans, 12, b_style, a, al, b, w, p };
118const typography apercu_typo = { aprcu, 12, b_style, a, al, b, w, p };
120const typography ccode_typo = { ccode, 12, b_style, a, al, b, w, p };
121const typography zslab_typo = { zslab, 12, b_style, a, al, b, w, p };
123const typography hyperl_typo = { hyperl, 12, b_style, a, al, b, w, p };
124
125
126/**
127 Default typography.
128
129 NB: Using a global locale. So, filenames are in multiple
130 languages, not just en_US.
131
132 Make sure that the font with the largest support for random
133 characters is used, ie some variant of Source Sans, Source Han Sans
134 XX, etc. Otherwise, blank spaces in rendered output are likely.
135*/
137
138} // namespace svg::constants
139
140#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 instagram_v
const typography ssans_typo
constexpr area p17x22_096_v
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
constexpr area a6_096_v
constexpr area v1080p_h
constexpr area a4_mm_h
const char * aprcumo
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.
const typography d_typo
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.